Repository navigation
fix: avoid reporting remote worker loss after Gateway restart - #207549
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: passed. What this changesThis PR describes a restarted subagent’s result as unconfirmed and documents checks before repeating remote work. Example: The Gateway restarts while run restart-interrupted-run has no recorded completion and its external worker may still be active.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it corrects a misleading restart diagnostic at its source, preserves recovery behavior, and has no actionable findings; current-head CI is green. Reviewed head: Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe subagent registry settles restored execution records and sends their terminal outcomes through completion delivery to the parent conversation. flowchart LR
A[Gateway restart] --> B[Restored subagent records]
B --> C[Registry settlement]
C --> D[Completion delivery]
D --> E[Parent conversation]
E --> F[Inspect recorded and external work]
Technical reviewBest possible solution: Keep the existing settlement owner and accurately report uncertainty before operators repeat remote work. Do we have a high-confidence way to reproduce the issue? Current-main source emits a definitive loss claim without checking the external outcome; the body additionally reports surviving-worker trials, which this review did not independently execute. Is this the best way to solve the issue? The smallest complete diagnostic fix changes the existing producer and its consumers, preserves interruption delivery, and provides usable inspection guidance without adding recovery machinery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b83f43c1c086. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource 0, Tests 0, Docs +4. Total +4 across 5 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed November 28, 2026, 10:54 AM ET / 15:54 UTC (Revision 2). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
What Problem This Solves
After a restart, the Gateway can lose track of a subagent while a remote worker keeps running. The old error told the parent the run had ended. Repeating a task on that basis can duplicate work.
User Impact
The error says the Gateway could not confirm the result. The guide shows how to check the recorded run in the parent chat and reminds operators to check the remote worker and its effects before trying again.
Why This Change Was Made
This corrects the diagnostic at its source. The registry still records an interruption and uses the existing delivery and cleanup paths. There is no change to execution, permissions, retention or automatic goal continuation.
Evidence
In an isolated development build I stopped the Gateway after a managed worker read a file. A separate Codex app-server finished the turn with the expected answer. After restart, the local registry reported the old interruption error. In a second trial the worker remained active after the replacement Gateway was ready. Both used scripted inference. They demonstrate why the old wording is misleading. This PR contains no experimental recovery code.
Against the original implementation, the revised registry assertion failed on the old notice. With the fix, all 23 registry and Gateway custody cases passed. I ran both suites with
pnpm testand--maxWorkers=1in isolated scratch on main at2837e846with the same source for these five files. The two shards took 190.16 seconds including startup. Formatting, type-aware lint andgit diff --checkpassed. I updated the SIGKILL matcher in the separate end-to-end suite and kept its exactly-once assertions. I did not run the full suite locally.Hosted results at
a5818ee8The restart suite passed the two timer-child cases. The SIGKILL case took 27.64 seconds and the SIGTERM case took 25.81 seconds. Both required one parent notice and one child call.
A separate shell-checkpoint case in the same file failed on the first
agentRPC, before shutdown. The Gateway logged a SQLite admission failure. The request returnedUNAVAILABLE. This PR leaves the shell case and database admission unchanged. I tested the case in isolation on the same local source described above with the pinned Bun fork and scripted inference. It passed in 32.35 seconds, with ten other cases excluded by the name filter. The hosted failure remains unexplained.Core lint found a duplicate case for
src/shared/assistant-display-content.ts. The same duplicate is present in the main revision I checked. This PR leaves that file unchanged.