Repository navigation
fix(update): fence readiness credentials at transport send - #182343
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 888f314cfc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const request: UpdateReadinessRequest = { | ||
| gatewayPort: params.gatewayPort, | ||
| timeoutMs: Math.max(1, remainingMs()), |
There was a problem hiding this comment.
Preserve startup observations when delegated readiness times out
When a restarted Gateway remains in startup until the readiness budget expires, the child receives the parent's entire remaining budget but starts its own timer only after subprocess startup and imports. The parent deadline therefore expires before the child can return its final startup observation. Unlike the legacy path, this branch never updates the parent's health with intermediate observations, so the timeout handler returns the initial runtime.status: "unknown" snapshot without the running PID or startup phase. Consequently, gatewayReadinessPending() returns false and verification reports a hard failure instead of preserving the live Gateway as readiness-pending. Reserve time for child settlement and retain structured startup observations across the process boundary so slow startup preserves the existing best-effort update behavior.
AGENTS.md reference: AGENTS.md:L78-L78
Useful? React with 👍 / 👎.
|
Codex review: needs maintainer review before merge. What this changesThis PR checks updater ownership immediately before Gateway transport I/O and restores generated panel validators to their existing schema contract. Example: An updater lease is reassigned while its readiness socket awaits the Gateway challenge.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored repair addresses a verified ownership gap, with no actionable findings on the reviewed head; exact-head CI remains pending. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherUpdate readiness passes its executor assertion through restart inspection and the Gateway client to WebSocket construction and frame sends. flowchart LR
A[Update executor lease] --> B[Readiness observer]
B --> C[Restart health probe]
C --> D[Gateway call client]
D --> E[Transport authority check]
E --> F[Gateway WebSocket]
Technical reviewBest possible solution: Retain the existing executor as authority owner and enforce its assertion at the shared transport boundary while keeping generated validators aligned with their schema. Do we have a high-confidence way to reproduce the issue? Source and supplied base/head wire evidence establish that lease reassignment during challenge waiting previously allowed a credential frame and now rejects before sending it. Is this the best way to solve the issue? The repair uses the existing executor, transport, and request-settlement owners without adding updater policy to the protocol engine. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 76403c3b3a6f. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +26, Tests +521, Docs +4. Total +551 across 18 files. Added test files: 2. View PR surface stats
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 HistoryReview history (4 earlier review cycles)
Reviewed October 24, 2026, 10:40 AM ET / 14:40 UTC (Revision 5). |
Carry the original readiness deadline into the target runtime and retain the existing pending-recovery owner for incomplete or invalid observations. Keep untouched predecessor readiness advisory, including when its older CLI lacks the delegated observer, without restoring rollback authority. Bound parent-owned recovery with the canonical deadline and retain completed observation facts. Cover the no-original-service finalization boundary and adapt legacy fixtures without weakening current target dispatch proof. Derive the synthetic unsupported operator dialect from the current minimum; CI's merge target restored protocol 4 while the branch base used protocol 5.
Keep the live executor assertion at socket construction and every authenticated frame, including deferred startup retries. Reuse canonical request settlement and record connect timing only after an actual send. Refresh main and retire the private verifier handoff: #182399 already owns protocol-mismatch HTTP identity verification. Final focused proof: consumer 3/3 and package authority/timing/close siblings 11/11; independent P0/P1 review scoped-clean.
Capture bounded sanitized question/composer/Details facts only after the existing assertion fails, reuse the canonical artifact owner, and rethrow the original error. Successful taps and assertions are unchanged. The Linux CI failure remains unexplained; isolated and original-order replays passed, and a synthetic failure proved diagnostic capture.
Use canonical error coercion and phase admission, and share the private immutable default close decision. Preserve transport authority and onSent semantics while removing duplicate policy. Exact CI-merge paired bundle proof passes at 1275549 bytes against the 1275713-byte chat cap; 25 focused semantic tests and canonical package types pass. No budget raised.
|
@clawsweeper re-review The current head also synchronizes stale precompiled panel validators with the already-existing optional boolean The requested current/reassigned executor final-effect evidence is in the PR body: both controls enter the real readiness probe with the actual executor fence, and the captured sanitized output accompanies the assertions. Final independent review found no actionable P0/P1 defects; exact-head CI is running. |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…182343) * fix(update): verify Gateway upgrades across protocol changes * fix(update): retain pending recovery when readiness cannot settle Carry the original readiness deadline into the target runtime and retain the existing pending-recovery owner for incomplete or invalid observations. Keep untouched predecessor readiness advisory, including when its older CLI lacks the delegated observer, without restoring rollback authority. Bound parent-owned recovery with the canonical deadline and retain completed observation facts. Cover the no-original-service finalization boundary and adapt legacy fixtures without weakening current target dispatch proof. Derive the synthetic unsupported operator dialect from the current minimum; CI's merge target restored protocol 4 while the branch base used protocol 5. * fix(update): preserve serving ownership and fence readiness credentials * test(gateway): align scheduler canary with mock model policy Use the configured mock model and matching synthetic credential profile, retaining the disabled manager and offline scheduler assertions. The previous explicit OpenAI override failed its mock-only allowlist in CI. * test(update): prove current and reassigned executor transport effects Exercise both authority outcomes through the real readiness probe and executor fence. Assert connect/health and returned identity for current ownership, and zero frames after lease reassignment. Both focused cases passed; production is unchanged. * test(ui): retain question footer expansion failure diagnostics Capture bounded sanitized question/composer/Details facts only after the existing assertion fails, reuse the canonical artifact owner, and rethrow the original error. Successful taps and assertions are unchanged. The Linux CI failure remains unexplained; isolated and original-order replays passed, and a synthetic failure proved diagnostic capture. * refactor(gateway): reuse error and connection failure policy Use canonical error coercion and phase admission, and share the private immutable default close decision. Preserve transport authority and onSent semantics while removing duplicate policy. Exact CI-merge paired bundle proof passes at 1275549 bytes against the 1275713-byte chat cap; 25 focused semantic tests and canonical package types pass. No budget raised.
* test(release): track pinned Codex version in hook pressure Adapt main #184817 to the release fixture. Co-authored-by: RomneyDa <[email protected]> * test(release): give scheduler canary explicit auth Adapt main #182343 to the release fixture. Co-authored-by: RomneyDa <[email protected]> * test(gateway): align scheduler canary fixture auth Co-authored-by: RomneyDa <[email protected]> --------- Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: RomneyDa <[email protected]> Co-authored-by: roboclaw-bot <[email protected]>
What Problem This Solves
An update can lose its executor lease while a readiness connection waits for authentication or a deferred request retry. The surrounding ownership checks reject the eventual result, but credentials or an authenticated request can already have been sent by then.
User Impact
Readiness probes stop sending when their update loses ownership. The transport checks the live owner immediately before socket creation and each RPC frame, including asynchronous authentication and startup retries. A refused send is not recorded as a successful connect send.
Why This Change Was Made
The existing probe passes its current owner assertion through the shared Gateway client. The check belongs at socket construction and
socket.send, where no awaited work or host callback can invalidate it before transport I/O. Existing request retirement, connection errors, and proxy cleanup remain the lifecycle owners; no updater-specific policy is added to the shared client.Post-hello dispatch preparation keeps its existing contract. Protocol-version changes continue to use the HTTP identity verification introduced in #182399, and authentication, pairing, configuration, and database schemas are unchanged.
Evidence
A real socket reproduction reassigned an isolated updater lease before releasing the Gateway challenge. Before the repair, a synthetic credential-bearing connect frame was sent; after the repair, the connection rejected with no credential frame.
The regression now enters through the real readiness probe, with the actual executor fence, to cover observer propagation and the transport boundary together. Allowed token/auth-none wire controls are retained, and the fixture exposes truthful startup identity for main's protocol-mismatch HTTP verification.
Package tests cover ownership loss during asynchronous token loading, revocation by the transport-registration callback with cleanup, and revocation between a correlated startup refusal and its retry.
Exact-main red→green: the consumer revoked-lease case sent a credential frame before the repair and no frame after it. Initial real-wire suite: 3/3 passed; the strengthened current/reassigned executor table then passed 2/2. Package authority and existing timing/close/reentrancy siblings: 11/11 passed, including synchronous refusal.
The final production delta is +54/-34 (net +20), reusing existing transport, request settlement and observer contracts. Duplicate error coercion and default-close policy are consolidated through their existing owners. Independent P0/P1 review found no actionable defects in the narrowed guard; the final owner simplification also passed independent P0/P1 review; Exact-head CI passed for
6b187d9c6b1885dd16080ef43430ef2e8bfb2aa6, including the authoritative PR gate.Exact-CI-merge paired bundle proof passed without raising limits: chat boot gzip 1,275,549 bytes versus the 1,275,713-byte cap, down 59 bytes from its measured base. The final owner simplification passed 25 focused semantic tests plus canonical package type checking and owned declarations.
A bounded test-only correction also makes the scheduler-disabled multi-instance fixture use its already-allowed mock model and matching synthetic auth profile. CI exposed its previous explicit OpenAI override being rejected by the mock-only allowlist; scheduler assertions and the offline runner remain unchanged. The focused local E2E command could not prepare its runtime because this sparse checkout omits plugin asset sources, the corrected case then passed in exact 46f9 CI (19.119s; multi-instance file 3/3). Final-head CI passed on
6b187d9c6b1885dd16080ef43430ef2e8bfb2aa6.An unchanged landscape question-footer case failed in Linux CI on 603c. An isolated replay and the original portrait→landscape pair passed locally, including a CI-matching Node worker, so the cause remains unresolved. Failure-only diagnostics now use the existing sanitized artifact owner around that exact assertion; successful interactions, taps, assertions and timeouts are unchanged. A temporary synthetic assertion failure exercised the new failure branch: it retained the original error and emitted only the intended fixed numeric/boolean scenario facts; the isolated proof checkout was restored byte-exact. This is diagnostic coverage, not a claimed UI repair.
The refreshed main baseline also exposed stale precompiled Gateway predicates: the existing optional
expandedboolean was missing from six panel command variants. Canonical regeneration synchronizes that artifact with its unchanged schema (+12/−6 generated lines, separate from production LOC). Generation is byte-stable, its check passes, and 96 direct before/after assertions verify booleans become accepted while malformed values remain rejected. No protocol/schema/version change was made.The socket fixture uses real protocol admission and authentication predicates with synthetic responses. It does not claim a full managed-service deployment or live-provider test.
Captured real-executor positive and negative proof
The following is actual canonical test output with only the local checkout path redacted. The current-lease case asserts exactly
connectthenhealth, a synthetic credential on the connect frame, and returned readiness/version/build. The reassigned-lease case asserts no received connect or health frames and the owner-loss error. Both enterconfirmGatewayReachablewith the actual executor assertion. The runner truncates long case names.