Skip to content

fix(gateway): interrupt delegated subagents on shutdown#26330

Open
aqilaziz wants to merge 3 commits into
NousResearch:mainfrom
aqilaziz:fix/gateway-interrupt-delegate-subagents
Open

fix(gateway): interrupt delegated subagents on shutdown#26330
aqilaziz wants to merge 3 commits into
NousResearch:mainfrom
aqilaziz:fix/gateway-interrupt-delegate-subagents

Conversation

@aqilaziz

Copy link
Copy Markdown
Contributor

Closes #26315.\n\n## Summary\n- add a process-wide helper to interrupt registered delegated subagents\n- have gateway shutdown/restart call that helper as a safety net before adapter teardown\n- make delegate_task stop waiting for child futures when the parent agent is interrupted, including batch delegation\n\n## Tests\n- python -m pytest -o addopts= tests\agent\test_delegate_shutdown_interrupt.py -q --tb=short\n- python -m pytest -o addopts= tests\gateway\test_session_race_guard.py::test_shutdown_skips_sentinel tests\gateway\test_shutdown_cache_cleanup.py -q --tb=short\n- python -m pytest -o addopts= tests\agent\test_subagent_stop_hook.py tests\cli\test_cli_interrupt_subagent.py -q --tb=short\n- python -m ruff check tools\delegate_tool.py gateway\run.py tests\agent\test_delegate_shutdown_interrupt.py\n- git diff --check

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery tool/delegate Subagent delegation labels May 15, 2026
NishantEC

This comment was marked as outdated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists tool/delegate Subagent delegation type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Gateway restart orphans in-flight delegate subagents — 12+ min timeout

3 participants