fix(core): wake parent on terminal child status#873
Draft
3nesdeniz wants to merge 2 commits into
Draft
Conversation
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.
Problem
When an interactive child exhausts its turn budget, Strix marks it as
stopped.The parent can nevertheless remain parked in
wait_for_messagebecause only thechild's wake event is set and no inbox item is delivered to the parent.
Root cause
Terminal-state propagation was split across call sites. Crashes had a dedicated
parent notification, normal completion sent a report from
agent_finish, andstopped/failedtransitions had no parent notification at all. Gracefulstops also assigned
stoppeddirectly, bypassing the coordinator's statustransition path.
Changes
completed,stopped,failed, andcrashedas terminal transitionsin
AgentCoordinator.set_status.first transition into a terminal state, including the failure reason when
present.
agent_finish's structured completion report as the primarynotification and suppress a duplicate generic message. If report delivery
fails, make one generic fallback attempt.
child: the tool result already confirms that stop. If a caller stops a deeper
descendant, notify that target's actual parent instead.
parents are part of the same stop cascade.
MaxTurnsExceededpath, all fourterminal statuses, idempotence, completion-report delivery fallback,
direct/deep stop routing, and cascade notification behavior.
Validation
uv run pytest -q— 412 passeduv run pytest -q tests/test_agent_terminal_notifications.py— 14 passeduv run ruff check .uv run ruff format --check strix/core/agents.py strix/core/execution.py strix/tools/agents_graph/tools.py tests/test_agent_terminal_notifications.pyuv run mypy strix/core/agents.py strix/core/execution.py strix/tools/agents_graph/tools.py tests/test_agent_terminal_notifications.pyuv run pyright --pythonpath .venv/bin/python tests/test_agent_terminal_notifications.pyuv run bandit -q -c pyproject.toml strix/core/agents.py strix/core/execution.py strix/tools/agents_graph/tools.pygit diff --checkI also ran the documented
make check-all. On a cleanupstream/mainworktree at
cd8270c, its repository-wide mypy step reports the same existing70 errors (primarily Textual typing drift and missing Pygments stubs), and the
repository-wide Bandit target reports the same existing B105/B310 findings.
The changed-source and new-test checks listed above are clean.
Fixes #870