Repository navigation
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 SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…ement Keep new request entry fenced while aborted in-process turns finish their pending-input and finalizer cleanup. Retire the instance after received execution has drained, preserving restart recovery ordering.
Carry the environment shutdown signal through provisioning recovery admission while retaining FIFO ordering and provider settlement. Prove shutdown releases a recovery queued behind session mutation, and cover SIGTERM with active a2a and lifecycle-wake turns.
e4931d8 to
32f3b5e
Compare
|
Codex review: needs changes before merge. What this changesThis PR retains Gateway bindings through interrupted-turn settlement and cancels provisioning recovery waiting for session admission. Example: Gateway shutdown begins while recovery for environment-shutdown-queued-recovery waits behind a session mutation.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 2 items remain Keep this PR open: both shutdown repairs address current defects, but forwarding service shutdown cancellation into provider request cancellation introduces a blocking worker-destruction regression. Priority: P1 Before merge
Findings
Provenance
Tests
Agent review detailsHow this fits togetherGateway shutdown fences request entry, cancels admitted execution, and joins cleanup; worker reconciliation enters the placement coordinator and session-admission owner before invoking provider recovery. flowchart TD
A[Gateway shutdown] --> B[Request entry fence]
A --> C[Received execution drain]
C --> D[Gateway binding retirement]
A --> E[Worker reconciliation guard]
E --> F[Placement coordinator]
F --> G[Session admission]
G --> H[Provider recovery]
Technical reviewBest possible solution: Keep the binding-lifetime repair and cancel queued admission without treating service shutdown as an explicit provider destruction request. Do we have a high-confidence way to reproduce the issue? Source inspection establishes both original shutdown paths and the introduced cancellation-to-destruction chain; no target code was executed during this review. Is this the best way to solve the issue? The existing owners are appropriate and the binding repair is focused, but admission-wait cancellation must remain separate from provider request cancellation. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 16f1ef80f9d5. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource +10, Tests +149, Docs +6. Total +165 across 7 files. Added test files: 0. View PR surface stats
LabelsLabel 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 Reviewed October 19, 2026, 6:32 AM ET / 10:32 UTC. |
Align the shutdown fixture with #177223 (3825c6a), which keeps the in-process Gateway binding until accepted execution and finalizers join. Its contract states: "Keep that binding until received execution and finalizers join; the existing entry fence continues rejecting new requests." During Gateway stop or restart, the admitted Board read can return its snapshot before worker retirement. Require the expected session, revision, and status widget instead of an error from the formerly premature binding retirement. Let unexpected request errors reject directly. Preserve the new request refusal, held-read join, open database, and final database-close assertions. The original fixture reproduces the hourly failure on main 55bc065. The complete repaired file passes under pinned Bun with maxWorkers=1. Gateway-server test types, type-aware core lint, formatting, whitespace, and independent P2 autoreview pass. No production behavior or timeout changes.
…overy (openclaw#177223) * fix(gateway): preserve instance binding through interrupted run settlement Keep new request entry fenced while aborted in-process turns finish their pending-input and finalizer cleanup. Retire the instance after received execution has drained, preserving restart recovery ordering. * fix(gateway): cancel queued worker recovery during shutdown Carry the environment shutdown signal through provisioning recovery admission while retaining FIFO ordering and provider settlement. Prove shutdown releases a recovery queued behind session mutation, and cover SIGTERM with active a2a and lifecycle-wake turns.
Align the shutdown fixture with openclaw#177223 (deb7430), which keeps the in-process Gateway binding until accepted execution and finalizers join. Its contract states: "Keep that binding until received execution and finalizers join; the existing entry fence continues rejecting new requests." During Gateway stop or restart, the admitted Board read can return its snapshot before worker retirement. Require the expected session, revision, and status widget instead of an error from the formerly premature binding retirement. Let unexpected request errors reject directly. Preserve the new request refusal, held-read join, open database, and final database-close assertions. The original fixture reproduces the hourly failure on main b53d602. The complete repaired file passes under pinned Bun with maxWorkers=1. Gateway-server test types, type-aware core lint, formatting, whitespace, and independent P2 autoreview pass. No production behavior or timeout changes.
What Problem This Solves
Gateway shutdown could retire its in-process instance binding before admitted turns finished pending-input settlement. Keep that binding until received execution and finalizers join; the existing entry fence continues rejecting new requests.
Worker reconciliation had a separate shutdown hang: provisioning recovery lost the service cancellation signal before waiting for session admission. A recovery queued behind another session mutation could therefore keep
shutdown.worker-environments.reconcile-guardpending indefinitely. Carry the existing signal through the coordinator queue and session admission. Preserve FIFO ordering and the joins for provider operations and writes that already started.Both changes use the existing lifecycle owners. No new state, timeout, configuration, schema, or public API is introduced. Production LOC is +10, solely for the explicit coordinator cancellation contract and passing that signal through existing admission.
Evidence
Real-model comparison and limitations
Two concurrent real-model A/B pairs ran on isolated synthetic Linux Gateways under an exclusive measurement lock. Each side used 16 CPUs, separate state and ports, the same driver and start barrier; the second pair swapped CPU halves. At SIGTERM each had three admitted runs,
session:a2a-send,subagents:lifecycle-wake, three background sleep descendants, and an independent OpenAI stream interrupted immediately after its first assistant chunk.Every measured restart and subsequent recovery shutdown exited 0, without a deadline, binding failure, or surviving background child. The run registry cleared within 29ms after abort. The one-second target for every owner was not met: pair 2 retained a lifecycle-wake tail in both versions, longer on the candidate. Existing traces place that wait in session admission/received-work cleanup after the agent lanes aborted; they do not establish the cause of the variable tail. These results demonstrate shutdown within a few seconds, not a speedup or unconditional timing neutrality. CPU busy averages across the two halves were 8.46%/7.04% in pair 1 and 7.85%/7.86% in pair 2, retained as context only.
All four next boots reported
started=2 settled=1 failed=0 skipped=0. The interrupted peer and streaming turns completed successfully. The lifecycle-wake owner settled asoperator_authority_unavailableunder the synthetic fixture's existing authority policy; a separate persisted synthetic-device pilot did not restore that authority. Parent-wake resumption remains a proof gap. Recovery records and policy are unchanged by this patch.The compiled baseline was
f2f019d60638d9813d2324e5126d7b1d2666fce5; the candidate was that source plus the exact three production-file changes in32f3b5e3ff6b48a5f354f178b9b2d43212fe9e2c, verified by file hashes. The final rebase was patch-identical and brought only unrelated UI/memory/test changes. Final-head PR CI covers the rebased tree. Both sandbox builds passed; no Testbox lease or local build/suite ran.The original 85-second incident was not reproduced or conclusively attributed. Its printed work inventory was captured before abort, while the pending reconciliation close step was current; the missing-binding warning alone does not prove run admission leaked. The deterministic integration regressions above prove the two repaired defects.