Skip to content

fix(gateway): queue follow-ups while delegate subagents run#30819

Closed
dieutx wants to merge 1 commit into
NousResearch:mainfrom
dieutx:fix/30170-delegate-busy-queue
Closed

fix(gateway): queue follow-ups while delegate subagents run#30819
dieutx wants to merge 1 commit into
NousResearch:mainfrom
dieutx:fix/30170-delegate-busy-queue

Conversation

@dieutx

@dieutx dieutx commented May 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • detect active delegate_task children before applying busy interrupt mode
  • queue conversational follow-ups while a delegate child is running so the subagent is not killed
  • preserve normal interrupt behavior when no delegate child is active

Fixes #30170

Tests

  • .venv/bin/python -m pytest tests/gateway/test_busy_session_ack.py -q
  • .venv/bin/python -m pytest tests/gateway/test_busy_session_auth_bypass.py -q
  • .venv/bin/python -m pytest tests/run_agent/test_interrupt_propagation.py -q

@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 23, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Competing fix for #30170 — along with #30241 and #30183, all three detect active delegate_task children and demote busy_input_mode='interrupt' to queue semantics. Each has slightly different implementations of the child-detection helper and different test coverage. Recommend consolidating into a single PR.

@daimon-nous

daimon-nous Bot commented May 25, 2026

Copy link
Copy Markdown
Contributor

Reviewed in the #30170 triage. This PR also guards both interrupt paths (warm + PRIORITY cold), which is the right approach. Two gaps compared to #30183: (1) no custom ack message — user sees generic "Queued for the next turn" without knowing a subagent is active or that /stop is available, and (2) fewer tests (no MagicMock regression test, no steer-mode preservation test). Both are fixable. See #30170 (comment) for the full comparison.

@daimon-nous

daimon-nous Bot commented May 25, 2026

Copy link
Copy Markdown
Contributor

Merged via PR #32076 (#32076) using #30183's implementation. Your PR also guarded both interrupt paths (warm + PRIORITY cold) — credited in the triage. Thanks for the contribution! 🙏

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]: Sending a message while delegate_task is running kills the subagent — interrupt propagates unconditionally to children

2 participants