Repository navigation
fix(gateway): safely defer agent-approved Gateway restarts - #117530
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed August 1, 2026, 10:21 PM ET / August 2, 2026, 02:21 UTC. ClawSweeper reviewWhat this changesThe PR routes approved Gateway-hosted system-agent restarts through the cooperative local restart coordinator, retains delayed approval work under tracked Gateway admission, and updates restart guidance and coverage. Merge readiness⛔ Blocked until real behavior proof is added - 4 items remain Keep this PR open. The source change is a coherent repair for the released-root restart race, but the PR body still supplies no after-fix runtime artifact for the native Windows Scheduled Task path and the protected Priority: P2 Review scores
Verification
How this fits togetherA system-agent conversation can propose a persistent Gateway action that an operator approves later through the Gateway approval registry. The delayed decision must re-enter tracked Gateway work before it performs the audited restart, so the restart coordinator can defer safely until active work drains. flowchart LR
A[Operator approval] --> B[Approval registry]
B --> C[Independent Gateway work root]
C --> D[System-agent command lane]
D --> E[Local restart coordinator]
E --> F[Audit and visible scheduled result]
F --> G[Gateway drain and restart]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +17, Tests +75, Config +1. Total +93 across 10 files. View PR surface stats
Review metricsNone. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Obtain a redacted real Windows Scheduled Task transcript or recording that shows approval, the scheduled completion result, Gateway recovery, and the persisted audit outcome, then land only after maintainers accept the restart-availability behavior on the exact head. Do we have a high-confidence way to reproduce the issue? Yes, from source: the added focused test drives a delayed operator approval after its original Gateway request has finished and observes the command-lane and restart-preflight state. This read-only review did not execute that test or the native Windows scenario. Is this the best way to solve the issue? Yes, provisionally: the patch repairs the lifecycle issue at the Gateway admission and local restart-owner boundaries rather than retrying downstream. Its claimed real-world behavior still needs direct runtime proof. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 90a377470fbf. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
…117530) * fix(gateway): safely defer agent-approved Gateway restarts * fix(gateway): pin approved restarts to the local owner * test(gateway): keep approved restart lifecycle coverage focused * fix(gateway): clear Windows probe lint --------- Co-authored-by: Peter Steinberger <[email protected]>
Bug
An approved agent-triggered Gateway restart can terminate its own host before the operator sees completion, or be silently rejected after the original request root is released.
Fix
Route Gateway-hosted approved restarts through the existing cooperative safe-restart RPC. Admit delayed approval work under an independent live root and keep it in the tracked command lane until actual execution, durable SQLite audit, visible completion, and restart drain complete. Preserve explicit operator approval, sandbox capability gating, and standalone CLI behavior. No new config, product surface, or schema version.
Review and verification status
service.restartdirectly; the full hosted human-approval path is covered by focused Gateway tests, not a live native approval session.Fixes #115475