feat(tui): update system message for clarity and conciseness in tool usage instructions
This commit is contained in:
@@ -29,8 +29,16 @@ impl Tool for PlanEnter {
|
||||
})
|
||||
}
|
||||
|
||||
fn run(&self, _ctx: &ToolCtx, args: &Value) -> Result<String> {
|
||||
fn run(&self, ctx: &ToolCtx, args: &Value) -> Result<String> {
|
||||
let plan_text = crate::tools::arg_str(args, "plan")?;
|
||||
|
||||
let plan_path = ctx.session_dir.join("PLAN.md");
|
||||
let _ = std::fs::write(&plan_path, &plan_text);
|
||||
if let Some(events) = &ctx.turn_events {
|
||||
let mut q = events.lock().unwrap();
|
||||
q.push_back(crate::TurnEvent::PlanUpdate(plan_text.clone()));
|
||||
}
|
||||
|
||||
Ok(format!(
|
||||
"Plan entered (length: {} chars). Waiting for approval...",
|
||||
plan_text.len()
|
||||
@@ -72,6 +80,15 @@ impl Tool for PlanReady {
|
||||
let path = plan_dir.join(&filename);
|
||||
std::fs::write(&path, &plan_content)
|
||||
.map_err(|e| anyhow::anyhow!("failed to save plan: {e}"))?;
|
||||
|
||||
// Also save the latest plan
|
||||
let plan_path = ctx.session_dir.join("PLAN.md");
|
||||
let _ = std::fs::write(&plan_path, &plan_content);
|
||||
if let Some(events) = &ctx.turn_events {
|
||||
let mut q = events.lock().unwrap();
|
||||
q.push_back(crate::TurnEvent::PlanUpdate(plan_content.clone()));
|
||||
}
|
||||
|
||||
Ok(format!("Plan saved to {filename}. Starting execution."))
|
||||
} else {
|
||||
Ok("Plan is ready. Starting execution.".to_string())
|
||||
|
||||
Reference in New Issue
Block a user