fix(gateway): allow /yolo and /verbose during active agent runs#12955
Merged
Conversation
/yolo and /verbose are safe to dispatch while an agent is running: /yolo can unblock a pending approval prompt, /verbose cycles the tool-progress display for the ongoing stream. Both modify session state without needing agent interaction. Previously they fell through to the running-agent catch-all (PR #12334) and returned the generic busy message. /fast and /reasoning stay on the catch-all — their handlers explicitly say 'takes effect on next message', so nothing is gained by dispatching them mid-turn. Salvaged from #10116 (elkimek), scoped down.
…ch-all Four parametrized cases that pin down the running-agent guard behavior: /yolo and /verbose dispatch mid-run; /fast and /reasoning get the "can't run mid-turn" catch-all. Prevents the allowlist from silently drifting in either direction.
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.
Summary
/yoloand/verbosenow dispatch while an agent is running instead of returning the generic busy message./yolocan pre-approve a pending approval prompt;/verbosecycles the tool-progress display for the ongoing stream. Both modify session state without needing agent interaction./fastand/reasoningstay on the running-agent catch-all — their handlers say "takes effect on next message," so dispatching them mid-turn gains nothing.Salvaged from #10116 by @elkimek (authorship preserved), scoped down from the original four-command set after reviewing each handler's actual mid-run utility.
Changes
gateway/run.py: small allowlist in the running-agent guard for/yoloand/verbose, placed before the_DEDICATED_HANDLERSdispatch and catch-all reject.tests/gateway/test_running_agent_session_toggles.py: 4 new cases —/yolo+/verbosedispatch mid-run;/fast+/reasoninghit the catch-all.Validation
/yolomid-run/verbosemid-run/fastmid-run/reasoningmid-runTargeted tests: 64 passed (4 new + all neighbors in
test_command_bypass_active_session.py,test_yolo_command.py,test_verbose_command.py,test_fast_command.py,test_reasoning_command.py,test_unknown_command.py).Closes #10116.