Repository navigation
fix(gateway): isolate wizard exits from shared process - #110382
TheAngryPit wants to merge 8 commits into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 28, 2026, 4:59 AM ET / 08:59 UTC. ClawSweeper reviewWhat this changesThe PR runs Gateway setup and channel wizards with a non-exiting runtime, keeps cancelled sessions owned until their runners settle, skips headless catalog loading, and adds optional Merge readiness⛔ Blocked until real behavior proof is added - 4 items remain This PR has a coherent, focused fix for the open Gateway wizard lifecycle report, but it is still necessary because current Priority: P1 Review scores
Verification
How this fits togetherGateway RPC lets remote clients drive setup or channel wizards inside a long-running shared Gateway process. The RPC handler validates the request, creates a wizard session, invokes CLI-oriented runners, and returns session progress and completion without allowing the embedded work to end the host process. flowchart LR
Client[Remote setup client] --> RPC[Gateway wizard RPC]
RPC --> Validate[Validate request and project options]
Validate --> Session[Wizard session ownership]
Session --> Runner[Setup or channel runner]
Runner --> Result[Wizard progress and result]
Result --> Client
Session --> Host[Shared Gateway stays alive]
Decision needed
Why: The implementation is mechanically small and preserves omission behavior, but it expands the generated Gateway request contract and commits the project to a client-visible lifecycle-control surface. Before merge
Agent review detailsSecurityNone. PR surfaceSource +42, Tests +356, Other +4. Total +402 across 10 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: 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: Keep the lifecycle repair at the Gateway RPC boundary, accept or reject the optional request-field contract explicitly, then land only after a redacted current-head live transcript proves cancellation, settlement cleanup, later restart, and uninterrupted Gateway hosting. Do we have a high-confidence way to reproduce the issue? No high-confidence current-head live reproduction is included. The source and focused tests make the prior failure mechanism reproducible in code, but the required process-level Gateway transcript remains absent. Is this the best way to solve the issue? Unclear. The non-exiting runtime and settlement-backed ownership are the narrow owner-boundary repair, but adding the public AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 4d105ebdd0ec. LabelsLabel changes:
Label 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 (13 earlier review cycles; latest 8 shown)
|
79fcd37 to
aedfa54
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Current-main landing validation for head
|
|
@clawsweeper re-review |
Fresh current-main merge-result validationRefreshed after
Exact merge-result proof
The disposable lease |
99b121c to
452aca1
Compare
6edc1e4 to
d317552
Compare
Exact-head CI repair
The existing process-level proof and maintainer API-contract gates remain explicit. No manual ClawSweeper command was added; this push/body update uses the normal review queue. Follow-up: test-type CI repair
No manual ClawSweeper command was added; the push/body activity uses the normal review queue. |
|
@clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix(gateway): isolate wizard exits from shared process This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
|
Thank you, @TheAngryPit — the exit-isolation core landed via #115671, and the settlement-ownership + |
Closes #110545
What Problem This Solves
Gateway RPC wizard sessions inherited CLI-owned behavior that does not belong inside a shared host process:
runtime.exit();In the Windows Companion path, this appeared as a lost Gateway connection during
run-wizard. The cancellation race could also allow overlapping setup work or retain a settled cancelled session indefinitely.This PR:
createNonExitingRuntime();ExitError(0)as normal completion and preserves nonzero exits as session errors;installDaemontoWizardStartParamsSchemaand forwardstrue,false, or omission unchanged;skipUi: trueandsuppressGatewayTokenOutput: trueexplicit at the RPC boundary.User impact: remote wizard flows remain inside the shared Gateway process. Cancellation preserves single-wizard ownership until in-flight work settles, then releases it so a later wizard can start.
Non-goals:
This consolidates and replaces #109412.
Change Type
Scope
Linked Issue / PR
Contract Decision
wizard.start.installDaemonis an optional generated Gateway request field. Omission preserves the existing onboarding default. An explicit boolean lets a trusted remote setup client choose whether that wizard invocation installs the daemon.This is intentional API ownership, not an accidental implementation detail. Maintainer acceptance of that public request field remains the only open design decision.
Evidence
Exact published head:
71ff15af52e76b129ff295334c7bfa8d9bc2713dnode scripts/build-all.mjs: passed in 5m27s.patch is correct, confidence0.97).The one-line change from the reviewed predecessor head to this head is test-only TypeScript mutability cleanup. Production behavior is unchanged.
Real Behavior Proof
Proof level:
runtime_provenfor the cancellation, settlement, replacement, and same-Gateway lifecycle on exact head71ff15af52e.Environment and boundary:
dist/index.js gateway callentrypoint;Observed sequence:
wizard.startreturned a running session.wizard.cancelreturnedcancelled.UNAVAILABLE: wizard already runningwhile the cancelled runner remained unsettled.wizard.startsucceeded.healthsucceeded after replacement.healthsucceeded again with the same child PID.Redacted terminal summary:
{ "proof": "gateway-separate-process-wizard-cancel-survival", "head": "71ff15af52e76b129ff295334c7bfa8d9bc2713d", "separateProcess": true, "authenticatedRpc": true, "replacementBlockedWhileUnsettled": true, "cancelledRunnerPurged": true, "replacementWizardStarted": true, "replacementAttempts": 1, "sameGatewayPid": true, "rpcHealthyAfterCancel": true }Redacted Gateway transcript:
Evidence integrity:
7FCB763241AA976C3C05CFB67A566C5B32029557D605747F10016456C43757F6E0889B73579DC2790B6C49AD30B853F63196452EA3ABD140402EE7EFE53C89F51205BF73CDFECB6FC32B8AF14805CE2FA8184AF6FCE9FFA779F0FA0FB628CCFE29DFA7B84F233D3663B8403E0A02784D056834FC0EDAFB998541FA329C133BE9This proves the requested process boundary. It does not claim official-package, Companion-update, or operator-runtime end-to-end proof.
Failed-First Evidence
Security Impact
The patch narrows lifecycle authority. An RPC wizard cannot terminate its shared Gateway, and cancellation cannot release single-flight ownership while the runner can still mutate setup state.
No secrets, credentials, permissions, dependencies, or network boundaries change. The optional
installDaemonfield is limited to the existing trusted Gateway RPC boundary and preserves existing behavior when omitted.Compatibility / Migration
installDaemon: preserves the current default.installDaemon: forwards the caller's boolean unchanged.Review Conversations
installDaemonexplicit as an intentional optional public request field.Agent Transcript
Redacted operator and agent timeline
installDaemonrequest contract.