Repository navigation
fix: prevent stale subagent notifications from failing chats - #149863
fuller-stack-dev merged 1 commit into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 16, 2026, 3:54 AM ET / 07:54 UTC. ClawSweeper reviewWhat this changesPreserves equivalent subagent completion results and cancels obsolete notifications without marking the parent conversation as failed, with regression coverage for both paths. Merge readiness✅ Ready for maintainer review This remains a useful, focused repair: fetched main still contains both failure mechanisms. No actionable introduced defect was found, and the supplied Gateway evidence supports cancellation without hiding genuine failures. Priority: P2 Review scores
Verification
How this fits togetherSubagent completion delivery carries finished child-task results back into the parent conversation. The registry supplies the result, while Gateway admission, cancellation, and durable receipts control whether that notification executes or replays. flowchart TD
A[Child completion reports] --> B[Registry normalizes terminal facts]
B --> C[Prepared parent notification]
C --> D{Source still current?}
D -->|Yes| E[Gateway executes parent turn]
D -->|No| F[Cancel obsolete notification]
E --> G[Durable outcome and chat history]
F --> G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +15, Tests +134. Total +149 across 4 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep terminal-result identity stable for equivalent facts and settle revoked notifications through Gateway’s existing cancellation and replay contracts. Do we have a high-confidence way to reproduce the issue? Yes: current-main source establishes both mechanisms, and supplied red/green probes exercise duplicate completion and source revocation. This read-only review did not execute tests. Is this the best way to solve the issue? Yes: the patch repairs the existing producers and cancellation path without weakening result validation or adding another delivery owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 687865486444. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
What Problem This Solves
Fixes a main conversation showing "This turn ended before a reply: subagent source lifecycle changed before completion delivery" when a completed subagent reports the same result twice or its queued notification becomes obsolete.
User Impact
Unchanged completion results remain deliverable. Obsolete notifications are cancelled without adding a failed-reply message to the conversation or replaying stale work after restart. Genuine execution failures remain visible.
Why This Change Was Made
Both lifecycle events and
agent.waitcan report completion. Replacing an unchanged outcome invalidated the authority captured by an already prepared notification. Preserve that outcome when its facts have not changed, and route actual ownership loss through the existing Gateway cancellation mechanism. Stale-result checks and private-completion observation deadlines remain enforced.Evidence
run-failed-before-replynotice.f2f3deeea602a795c5ab8df349658e438b58aacc. Raw red/green results, Gateway observations and artifact manifest.