fix(gateway): allow exec-type quick commands to bypass draining guard#28734
Open
zccyman wants to merge 1 commit into
Open
fix(gateway): allow exec-type quick commands to bypass draining guard#28734zccyman wants to merge 1 commit into
zccyman wants to merge 1 commit into
Conversation
Exec-type quick commands run pure shell subprocesses via asyncio.create_subprocess_shell and do not depend on the agent loop or LLM backend. They should remain available during gateway draining (after SIGTERM or repeated LLM failures) so that ops commands are accessible when the system is most unhealthy. Move the exec-type quick command dispatch before the _draining guard in _handle_message(). Alias-type quick commands and regular slash commands remain blocked during draining as they may need the agent loop. Closes NousResearch#28663 Co-authored-by: zccyman <16263913+zccyman@users.noreply.github.com>
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
Exec-type quick commands (
quick_commands.<name>.type: exec) now bypass the_drainingguard inGatewayRunner._handle_message(), ensuring they remain available when the gateway is shutting down or restarting.These commands run pure shell subprocesses via
asyncio.create_subprocess_shelland do not depend on the agent loop or LLM backend — there is no reason to block them during draining. In practice, this means ops commands (health checks, service status, etc.) are accessible when the system is most unhealthy and you need them the most.Changes
_drainingguard. The original dispatch block after the guard is kept as a defensive fallback with a comment. Alias-type quick commands and regular slash commands remain blocked during draining as they may require the agent loop.Testing
test_restart_drain.pytests pass (no regression)test_quick_commands.pytests pass (no regression)Complementary with PR #25804
PR #25804 fixes exec quick commands being blocked when the agent is mid-turn (
_handle_active_session_busy_messagepath). This PR fixes the same class of issue but for the draining trigger condition in_handle_message. Both fixes are complementary — one handles mid-turn, the other handles draining.Closes #28663