feat(planner): expose plan approval through config (#64) - #206
Merged
Conversation
Planner._generate_plan_with_human_validation has carried an approval loop since it was written (show the plan, Enter approves, typed feedback regenerates it), but its only caller passed human_approve=False and no setting reached it, so the loop was dead code. Issue #64 asks for exactly this gate. Add planner_human_approve to Config (persisted by jsonify/from_json) and a --planner_human_approve flag; main.py passes it to start_planner on the --goal path only. The benchmark, onboarding and web entry points keep the default and never prompt. A headless run with the gate on now fails before the planning LLM call with UserInterventionRequired instead of generating a plan and dying on input(). The exception type and its placement match commit 67b4251 on mimosa_v2_lfx so the two lines merge cleanly. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This was referenced Sep 2, 2026
Member
|
Approved. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Planner._generate_plan_with_human_validationhas carried a plan-approval loop since it was written: display the plan, Enter approves it, typed feedback regenerates it with the feedback appended to the goal. Its only caller passeshuman_approve=Falseand no setting reaches it, so the loop is dead code. Issue #64 asks for this gate.The prompt also reads stdin unconditionally. With the gate on, an unattended run would pay for the plan and then die on
input()withEOF when reading a line.Solution
Config.planner_human_approve(defaultFalse), persisted byjsonifyandfrom_json, exposed as--planner_human_approve.main.pypasses it tostart_planneron the--goalpath only. The benchmark (csv_mode), onboarding and web-bridge callers keep the default and never prompt.start_plannerrefuses the gate before the planning LLM call when stdin is not a TTY, raisingUserInterventionRequired; the prompt itself carries the same guard. The exception class is identical in text and position to the one in 67b4251 onmimosa_v2_lfx, so the two lines merge cleanly.Testing
tests/planner_human_approve_test.py, seven tests: the default path never prompts; feedback regenerates the plan with the feedback in the goal; Enter approves and text is feedback; headless refusal both before planning and at the prompt; the argument defaults to off; the config field round-trips.tests/config_roundtrip_test.pycovers the new field on its own.uv sync --group devenvironment: 236 passed, 17 failed, 4 skipped. The 17 are the same set that fails onmimosa_v2before this change; ci(tests): run pytest on pull requests and pushes #205 lists them.Backwards compatibility
Off by default, so no behaviour changes unless the flag or config key is set.
start_plannergains a keyword argument with a default; existing callers are untouched.🤖 Generated with Claude Code