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:
@@ -37,7 +37,7 @@ Plan Mode is a cognitive forcing system that prevents:
|
|||||||
## Workflow
|
## Workflow
|
||||||
|
|
||||||
1. **Draft**: Call `plan_read` to check for existing plan, then `plan_write` to create/update
|
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
|
3. **Execute**: Implement items, updating plan with `plan_write` to mark progress
|
||||||
4. **Complete**: When all items are done/blocked, verification runs automatically
|
4. **Complete**: When all items are done/blocked, verification runs automatically
|
||||||
5. **Remember**: Call `remember` to save discovered code locations
|
5. **Remember**: Call `remember` to save discovered code locations
|
||||||
|
|||||||
@@ -828,6 +828,12 @@ pub async fn execute_plan_write<W: UiWriter>(
|
|||||||
return Ok(format!("❌ Plan validation failed: {}", e));
|
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
|
// Write the plan
|
||||||
if let Err(e) = write_plan(session_id, &plan) {
|
if let Err(e) = write_plan(session_id, &plan) {
|
||||||
return Ok(format!("❌ Failed to write plan: {}", e));
|
return Ok(format!("❌ Failed to write plan: {}", e));
|
||||||
|
|||||||
Reference in New Issue
Block a user