Auto-approve plans in non-interactive (autonomous/one-shot) mode

- Add auto-approval logic in execute_plan_write() when ctx.is_autonomous is true
- Update system prompt to document auto-approval behavior
- Plans still require explicit approval in interactive mode
This commit is contained in:
Dhanji R. Prasanna
2026-02-02 17:16:21 +11:00
parent 0aead8d86d
commit e332109273
2 changed files with 7 additions and 1 deletions

View File

@@ -37,7 +37,7 @@ Plan Mode is a cognitive forcing system that prevents:
## Workflow
1. **Draft**: Call `plan_read` to check for existing plan, then `plan_write` to create/update
2. **Approval**: Ask user to approve before coding (\"'approve', or edit plan?\")
2. **Approval**: Ask user to approve before coding (\"'approve', or edit plan?\"). In non-interactive mode (autonomous/one-shot), plans auto-approve on write.
3. **Execute**: Implement items, updating plan with `plan_write` to mark progress
4. **Complete**: When all items are done/blocked, verification runs automatically
5. **Remember**: Call `remember` to save discovered code locations

View File

@@ -828,6 +828,12 @@ pub async fn execute_plan_write<W: UiWriter>(
return Ok(format!("❌ Plan validation failed: {}", e));
}
// Auto-approve in non-interactive (autonomous) mode
if ctx.is_autonomous && !plan.is_approved() {
plan.approve();
debug!("Auto-approved plan in autonomous mode at revision {}", plan.revision);
}
// Write the plan
if let Err(e) = write_plan(session_id, &plan) {
return Ok(format!("❌ Failed to write plan: {}", e));