fix(tui): make the mode authoritative for YOLO — drop publish prompt carve-out (#3790)#3797
Closed
Hmbown wants to merge 1 commit into
Closed
fix(tui): make the mode authoritative for YOLO — drop publish prompt carve-out (#3790)#3797Hmbown wants to merge 1 commit into
Hmbown wants to merge 1 commit into
Conversation
…carve-out (#3790) The reported symptom (YOLO still prompts on `git push` / publish) traced to a single override: `auto_review_force_prompt_overrides_auto_approve`. The auto-review safety floor classifies publish-like actions (git push, gh release, npm/cargo publish, git tag) as durable-review holds, and this carve-out forced the prompt *past* YOLO by setting `approval_force_prompt = true`, which defeats the UI's YOLO auto-approve (`should_auto_approve_approval_request`). Remove the carve-out so the auto-review ForcePrompt is fully mode-subordinate: YOLO (`auto_approve`) now skips it like every other heuristic hold. An audit of the approval path confirms this was the *only* remaining `force_prompt` source in YOLO (typed ask-rules are already `!auto_approve`-gated), so YOLO is now a true no-prompt mode for shell / MCP / publish. Agent and Plan are unchanged — Agent still reviews publish (the policy layer still classifies it; only the YOLO application changed). Typed deny rules and `disallowed/allowed_tools` remain mode-independent hard prohibitions. - turn_loop.rs: delete `auto_review_force_prompt_overrides_auto_approve` and its use; the ForcePrompt arm now applies only when `!self.session.auto_approve`. - tests: drop the helper assertion; flip `yolo_mode_forces_prompt_for_publish_like_shell` to `yolo_mode_does_not_force_prompt_for_publish_like_shell` (asserts no approval is surfaced and the tool runs under YOLO). Policy-layer tests (auto_review_policy_*) still assert publish → ForcePrompt for Agent. Full `cargo test -p codewhale-tui --bins` green except the two pre-existing non-hermetic `config_command_allow_shell_*` papercuts (machine default_mode=yolo). Part of #3790; the broader dual-authority centralization + Auto-mode removal is called out as a deliberate follow-up in the issue.
Owner
Author
|
Closing — superseded by #3795 (merged), which fixes #3790 more completely. I opened this as the minimal, verified slice (drop the publish force-prompt carve-out). #3795 landed first and does the fuller flatten: removes the auto-review safety floor entirely, and gates MCP / code-execution / hook-ask on |
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.
Addresses the core, user-reported symptom of #3790: YOLO still fires
[approval]prompts (observed ongit pushand publish-like shell). Full audit posted on the issue.Root cause (verified)
The mode is consulted, but one override defeated it:
auto_review'ssafety_floorclassifies publish-like actions (git push, gh release, npm/cargo publish, git tag) as durable-review holds, andauto_review_force_prompt_overrides_auto_approve(turn_loop.rs) forced the prompt past YOLO by settingapproval_force_prompt = true— which is the one bit that makes the UI'sshould_auto_approve_approval_requestignore YOLO.The audit confirmed this was the only remaining
force_promptsource in YOLO (typed ask-rules are already!auto_approve-gated; the MCP gate andrlm_eval"non-bypassable" raiseapproval_requiredwithoutforce_prompt, so the UI already auto-approves them in YOLO). So this one deletion makes YOLO a true no-prompt mode.Change (surgical, deletion-first)
auto_review_force_prompt_overrides_auto_approveand its use; the auto-reviewForcePromptarm now applies only when!self.session.auto_approve. Publish-like holds are now fully mode-subordinate.disallowed/allowed_toolsremain mode-independent hard prohibitions (only ever tighten).Tests
yolo_mode_forces_prompt_for_publish_like_shell→yolo_mode_does_not_force_prompt_for_publish_like_shell: asserts YOLO surfaces no approval and the publish-like tool runs unprompted.auto_review_policy_*unit tests still assert publish →ForcePrompt(Agent path intact).cargo test -p codewhale-tui --bins: 5569 passed; the only 2 failures are the pre-existing non-hermeticconfig_command_allow_shell_*papercuts (machinedefault_mode=yolo).Acceptance (this PR)
request_user_inputstill works in every mode (it's an independent, non-approval event — verified in the audit)Deliberately scoped out (deliberate follow-up — see issue)
The larger "single authority" cleanup — centralizing the two approval deciders (engine raises
approval_required; the UI independently re-derives YOLO/Bypass) so the UI is a pure consumer of an engine-stamped verdict, making the MCP/hook gates consultauto_approvefor consistency, dropping the deadrlm_evalnon-bypassable path, collapsing the composer-bang duplicate, and removing the dormantAppMode::Auto— is the bigger refactor #3790 also describes. It carries real risk in the Agent path and has an open design question (now resolved for deny rules), so it's better staged deliberately rather than rushed into the release. Full map + recommendations are in the issue comment.