Repository navigation
fix(doctor): wait for hosted child cleanup before settling cancellation - #204750
vincentkoc wants to merge 9 commits into
Conversation
Join the retained cleanup owner before Doctor classifies startup cancellation or releases async, command, and signal-exit lifetimes. Preserve genuine cleanup uncertainty and rejection. Add a held-birth real-child regression and cleanup failure controls. Runtime validation is pending; this does not attribute the observed CI cleanup failure to a proven execution branch.
|
🦞👀 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. What this changesThis PR makes hosted Doctor await attached process cleanup and improves supporting test fixtures and failure diagnostics. Example: On Linux, hosted Doctor is cancelled while process-start identity collection is still pending.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this maintainer-authored draft open: the cleanup fix addresses a current source-level lifetime gap, and review found no introduced defect, including in the observer diagnostics. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe System agent launches hosted Doctor through the process runner; child output returns to the caller while command, asynchronous-work, and signal-exit owners retain its cleanup lifetime. flowchart TD
A[System agent request] --> B[Hosted Doctor owner]
B --> C[Process runner]
C --> D[Doctor child]
C --> E[Attached cleanup promise]
E --> B
B --> F[Caller and lifetime settlement]
Technical reviewBest possible solution: Keep the existing Doctor owner responsible for joining the runner's attached cleanup before any dependent lifetime settles. Do we have a high-confidence way to reproduce the issue? Source establishes the Linux startup-cancellation path: the runner can return before attached cleanup settles, while current main immediately classifies that provisional result; no target code was executed during this review. Is this the best way to solve the issue? The patch repairs the existing lifetime owner with a direct cleanup join, preserves rejection causes and genuine uncertainty, and adds no competing state or cleanup mechanism. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5e5ecba4ed8c. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +19, Tests +264, Other +6. Total +289 across 8 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. Review metrics
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 HistoryReviewed November 24, 2026, 2:50 PM ET / 19:50 UTC (Revision 3). |
(cherry picked from commit 66d67d0)
Keep the real source driver and foreign command directory while resolving this checkout's TypeScript package aliases. This fixes the raw tsx bootstrap failing before launch with normalization-core missing; argv, private output, descriptor lineage and both runtimes stay covered. (cherry picked from commit 63d1647)
The receiver adds federated export provenance to shared catalog rows. Include it in the existing exact row assertion while retaining the unchanged peer fixture and latency, coalescing, and failure checks. Related: #204558 Validated: original focused case reproduces the scheduled CI failure; all 15 catalog Gateway tests pass with the updated expectation. Targeted lint, format, and Gateway-method test typecheck pass. (cherry picked from commit 4c68c0b)
(cherry picked from commit 55053e8)
|
@clawsweeper re-review Please review current head |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Please perform a read-only review of exact current head ee8ad40. Review the diagnostic-only labeling of the two existing chat-event waits. Original rejection causes, timeout budgets, ordering, payloads and cleanup are preserved. Current-head ordinary CI is pending; prior session failure, missing RPC coverage and baseline-red gap remain explicit. This requests review only; do not repair, merge, change labels or gates, deploy, or reinterpret protected findings as waived. |
|
🦞👀 Re-review progress:
|
Summary
Join the process runner's attached cleanup owner before Doctor classifies a provisional result or releases its caller, command scope, async-work scope and signal-exit registrations. Genuine cleanup uncertainty and original rejection causes remain visible.
The real-child regression returns its outer command callback while nested Doctor cleanup is held, verifies that the outer scope stays pending, then releases the child and joins both outcomes. The existing fixture corrections retain canonical attribution, original behavior assertions and timeouts.
This successor adds fixed labels and monotonic elapsed time to the two existing chat-delivery observer rejections, retaining the original error as the cause. It adds no timer, request, payload or assertion and preserves observer order and cleanup. This is diagnostic only: the observed delivery failure remains unresolved; an unlabelled earlier failure remains unlocalized.
Current evidence and limits
ee8ad4087cfdb9cf58eda5b6bfbb2965f2e86e53, tree600ac3121b53390173a167e4c856357db43cdff5, source base115e7114dea5c58669b78c3c405c191e085d5874. Eight files: Doctor production +40/-21, tests +270/-6, tooling +6/-0. The 19 net production lines implement one shared cleanup-lifetime boundary.6ab055fc, then one complete whole-session view from6ab055fcthroughee8ad408. Both completed with zero findings; unchanged earlier views retain their historical attribution.Earlier-head failures and measurements remain historical. Current source review and component results do not waive broader CI failures, Linux-only gaps, baseline sensitivity, actual-product cancellation, or protected investigation stops. The native assessment remains NEEDS WORK; this PR remains a draft.