🤖 fix: settle child tasks when auto-retry abandons - #3809
Conversation
When a sub-agent hits a stream error that schedules auto-retry, the parent stays blocked waiting for the child. If that retry is later abandoned (missing resume options, retry callback failure) or never starts (auto-retry disabled), settle the child terminally so the parent is not blocked forever.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9807881796
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Use Record<StreamErrorType, true> so new schema values fail typecheck instead of silently dropping the original error on auto-retry abandon.
|
@codex review Addressed the P2: stream-error allowlist is now an exhaustive |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Unblock parent agents when a child sub-agent hits a stream error that never recovers via auto-retry, instead of leaving
waitForAgentReport/ workspace-turn waiters hanging until timeout.Background
Child stream errors that schedule in-session auto-retry intentionally leave parent waiters blocked so a successful retry can complete the turn. Two failure modes left the parent blocked with no recovery path:
missing_retry_optionsor retry callback failure. TaskService only listened to streamerrorevents, notauto-retry-abandonedchat events, so abandonment never settled the handle.Implementation
workspaceServicechat→auto-retry-abandonedand terminally settle active workspace-turn handles and agent tasks (exceptdisabled_by_user, which remains a steerable pause).running, after waiting for the stream-error recovery decision, settle immediately when nothing is streaming/retrying (parity with workspace-turn handling). Keepaborted/context_exceedednon-terminal.Validation
bun test src/node/services/taskService.test.ts -t "auto-retry abandoned|running tasks are NOT settled|running tasks settle immediately|model_refusal|awaiting_report tasks interrupt|workspace-turn auto-retry"make typecheckRisks
Generated with
mux• Model:xai:grok-4.5• Thinking:high