mirror of
https://github.com/outbackdingo/optimclaw.git
synced 2026-09-03 01:59:23 +00:00
feat(engine): platform self-awareness, event pipeline fix, globals() builtin, prompt templates
Session 9 changes driven by live trace analysis: - CodeAct event pipeline: handle_execute_code_step now transfers CodeExecutionResult events to thread.events and broadcasts via event_tx (fixes false-positive no_tools_used trace warnings) - Monty globals()/locals() builtins: returns dict of available action names from capability leases, enabling "tool_name" in globals() probing - PlatformInfo injection into system prompts (version, LLM backend, model, database, channels, owner, repo URL) - Mission goal prompts moved to prompts/*.md files (include_str! pattern) - /expected command for triggering self-improvement from user feedback - Session 9 development history Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
This commit is contained in:
@@ -50,6 +50,8 @@ pub struct ExecutionLoop {
|
||||
retrieval: Option<crate::memory::RetrievalEngine>,
|
||||
/// Optional Store for runtime prompt overlay loading and skill retrieval.
|
||||
store: Option<Arc<dyn crate::traits::store::Store>>,
|
||||
/// Runtime platform metadata for self-awareness in system prompts.
|
||||
platform_info: Option<crate::executor::prompt::PlatformInfo>,
|
||||
}
|
||||
|
||||
impl ExecutionLoop {
|
||||
@@ -74,6 +76,7 @@ impl ExecutionLoop {
|
||||
event_tx: None,
|
||||
retrieval: None,
|
||||
store: None,
|
||||
platform_info: None,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,6 +110,12 @@ impl ExecutionLoop {
|
||||
self
|
||||
}
|
||||
|
||||
/// Set platform metadata for self-awareness in system prompts.
|
||||
pub fn with_platform_info(mut self, info: crate::executor::prompt::PlatformInfo) -> Self {
|
||||
self.platform_info = Some(info);
|
||||
self
|
||||
}
|
||||
|
||||
/// Add an event to the thread and broadcast it for live status updates.
|
||||
#[allow(dead_code)]
|
||||
fn emit_event(&mut self, kind: EventKind) {
|
||||
@@ -232,6 +241,7 @@ impl ExecutionLoop {
|
||||
&actions,
|
||||
self.store.as_ref(),
|
||||
self.thread.project_id,
|
||||
self.platform_info.as_ref(),
|
||||
)
|
||||
.await;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user