🤖 fix: resume parents directly from sub-agent reports - #3816
Conversation
Remove the redundant synthetic completion handoff prompt and collapse terminal attention records to source identity plus delivery state. Terminal reports and failures now resume the parent directly from durable history, with artifact-backed repair for missing rows and compatibility for legacy attention records. --- _Generated with `mux` • Model: `openai:gpt-5.6-sol` • Thinking: `xhigh` • Cost: `$48.40`_ <!-- mux-attribution: model=openai:gpt-5.6-sol thinking=xhigh costs=48.40 -->
|
@codex review Please review the prompt-free terminal sub-agent resume refactor, especially crash recovery and mixed background-work delivery. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c169080572
ℹ️ 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".
Correlate assistant responses with the provider history snapshot, isolate orphaned agent attention from unrelated work, and retain downgrade-compatible terminal attention fields on disk. --- _Generated with `mux` • Model: `openai:gpt-5.6-sol` • Thinking: `xhigh` • Cost: `$91.81`_ <!-- mux-attribution: model=openai:gpt-5.6-sol thinking=xhigh costs=91.81 -->
|
Addressed all three Codex findings:
Added regression coverage for each case and pushed the fixes in |
|
@codex review Please take another look at the provider-request correlation, orphan isolation, and downgrade-compatible outbox fixes in |
|
Codex Review: Didn't find any major issues. 🚀 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". |
The automatic pull_request workflow did not dispatch for the prior pushes; create a new synchronize event after the manually dispatched full PR workflow passed. --- _Generated with `mux` • Model: `openai:gpt-5.6-sol` • Thinking: `xhigh` • Cost: `$91.81`_ <!-- mux-attribution: model=openai:gpt-5.6-sol thinking=xhigh costs=91.81 -->
|
@codex review The latest commit only retriggers CI after GitHub's Actions webhook outage; please confirm the reviewed code remains approved at the current head. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 736b392a32
ℹ️ 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".
Leave terminal attention pending after persistent prompt-free resume failures instead of immediately waiting for idle and retrying forever. Busy no-op resumes still retry when the workspace becomes idle. --- _Generated with `mux` • Model: `openai:gpt-5.6-sol` • Thinking: `xhigh` • Cost: `$91.81`_ <!-- mux-attribution: model=openai:gpt-5.6-sol thinking=xhigh costs=91.81 -->
|
Addressed
Local task tests, typecheck, and |
|
@codex review Please review the final persistent-resume-error fix in |
|
Codex Review: Didn't find any major issues. Delightful! 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
Removes the redundant synthetic “Background sub-agent task(s) have completed…” handoff turn. Completed sub-agent reports and failures now resume the parent directly from the durable report rows already in conversation history.
The refactor also removes 1,001 net lines by collapsing terminal-attention branching and deleting tests coupled to the old prompt/output state machine.
Background
Sub-agent completion previously used a two-message handoff:
That second turn surfaced as an
AUTOchat bubble and forced a generic instruction into the transcript. Recent suppression logic only handled the narrow case where the parent had answered an incremental progress update, so normal background completions still showed the prompt.Implementation
Validation
bun test src/node/services/taskService.test.ts src/node/services/terminalAttentionStore.test.ts --timeout 30000— 337 passingbun test src/node/services/agentSession.startupAutoRetry.test.ts— 30 passingbun test src/node/services/aiService.test.ts -t 'uses the latest durable boundary slice'make typecheckmake static-checkRisks
Moderate, scoped to terminal background-work delivery. Workspace-turn and workflow wake prompts retain their existing behavior. Sub-agent completion now depends on
resumeStreamover durable history, with provider-request correlation, artifact-backed repair, orphan isolation, and upgrade/downgrade-compatible outbox records covering concurrency and restart cases.Generated with
mux• Model:openai:gpt-5.6-sol• Thinking:xhigh• Cost:$91.81