Repository navigation
Conversation
Bind recovery to its captured session without broadening persisted operator scopes. Record definitive authorization loss with the existing guarded interruption notice, preserving pending delivery and other recovery custody.
7901aa2 to
c1331a7
Compare
|
🦞👀 Pull request received. I will update this pull request when review starts. |
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. |
|
Landed under the authorized inherited-failure exception. On head The focused recovery/authority proof passes, and the final independent review is clean. The one-second cancelled security-review job was superseded by concurrency before executing; it is distinct from the passing required security statuses. A real-model sandbox restart and production acceptance remain unverified; the next production restart must use the existing operator coordination. No production grants, configuration, or lifecycle were changed. Final CI run |
…#179579) * fix(gateway): resume session-scoped operators after restart Bind recovery to its captured session without broadening persisted operator scopes. Record definitive authorization loss with the existing guarded interruption notice, preserving pending delivery and other recovery custody. * fix(agents): settle definitive recovery denials in child cohorts * fix(gateway): preserve recovery revocation error context
|
Could this be backported to 2026.10.10 before the stable cut? On 2026.10.10-beta.2 (unchanged in v2026.10.10-beta.3 and on
Repro (stock, no plugins): Expected: her next message runs. Actual: "Restart recovery failed" on every message. This PR fixes both on main; without it, 2026.10.10 stable strands the conversation of every session-only operator whose turn meets a Gateway restart. I didn't find it in the open PRs against |
When main-session restart recovery found that its recorded operator source no longer matched the session or interrupted input, it threw a generic error that bypassed the rejected-recovery settlement owner. The recovery stayed retryable, so every later user message re-ran it and failed with 'Restart recovery failed' until sessions.reset. Ownership loss is now a typed GatewayOperatorRecoveryOwnershipError handled by the existing guarded settlement (pre-admission rejection with an applied reservation rollback): one interruption notice, the stale recovery is retired, and new messages run normally. Pending replies, harness completions and independent runs keep their recovery protection. Fixes #180802 (cherry picked from commit 50f795a) Release adaptation: stable lacks the rejected-recovery settlement owner from #179579 and restart-recovery-errors.ts, so this adds a minimal settleRejectedRestartRecovery (ownership errors only, applied rollback, no accepted dispatch) that retires the stale recovery through the existing finishDelegatedRestartRecovery path, plus the typed GatewayOperatorRecoveryOwnershipError. The gateway runtime test is main-only; an equivalent case was added to main-session-restart-recovery.test.ts.
Supersedes #179564, whose PR head did not advance after its branch was updated and which GitHub refused to reopen. This PR uses the same branch; the earlier CI findings are repaired and recorded below.
What Problem This Solves
Fixes interrupted turns repeatedly failing restart recovery with
missing scope: operator.writewhen their original caller was admitted withoperator.sessions.write.User Impact
Session-only operators, including trusted-proxy users and delegated parent continuations, can resume their own interrupted work without receiving broader permissions. Confirmed revocation records a visible interruption instead of repeatedly deferring the same input. Saved final replies and other unfinished recovery obligations remain preserved.
Why This Change Was Made
Recovery already persists the original operator authority and revalidates its current profile, role, device, and access grant. Its internal
agentdispatch omitted the existing exact-session binding used by other session continuations. Bind the captured session/run/lifecycle before dispatch, retaining the original scopes and normal own-session checks.Classify definitive authorization loss separately from storage, lifecycle, and temporarily unavailable policy failures. Route denied pre-admission recovery through the existing guarded notice/settlement owner. No schema, permission, or configuration changes.
Evidence
operator-run-recovery.test.ts,server-instance-runtime.operator-recovery.test.ts, andserver-instance-runtime.native-restart-recovery.test.ts. Coverage includes cold authority restoration, retained scopes, revocation, cron-owned interruption, exact claims, repeated recovery without duplicate turns/notices, and saved-final preservation. The recovery/router and persistence boundaries are real; the model/turn executor is stubbed.subagent-registry.completion-authority.test.tsat “revalidates revoked grant for a cold-loaded interrupted child batch without widening the parent”; local replay reproduced 91 passing / 1 failing. The restoration owner now recognizes the typed definitive denial as well as a live access denial. The unchanged 92-test file passes after the fix (88.74 s including compilation). Changed-file lint/format and an additional independent P0/P1 review passed.A full isolated Gateway/model restart is not yet verified. Production acceptance remains the next operator-coordinated restart. Production grants and configuration were not changed; incident logs alone do not identify each original caller's authentication method.
Inherited CI failure
On head
c1331a7695ee36567da649011b27ea2420f65edf, CI run39620783593, job119294018629(checks-node-changed-compact-small-4) fails both cases insrc/gateway/server-methods/chat.reset-visible-yield.test.tsbefore Gateway startup:agents.defaults: Unrecognized key: "heartbeat". The same single file on unchanged main parent5d2d946899a8a1e2160758487a0ceb34118a9329fails both cases with the identical configuration error (57.55 s including compilation). The fixture still sets the field removed by #179387; this PR changes neither that fixture nor the agent-default schema. CI tested merge717e03d7a32b68832fbce02cfd90bf8eed3c0eaa, whose parents are that baseline and this exact PR head. No CI rerun was requested.The cancelled one-second security-review job was superseded by GitHub concurrency before any steps ran; the required
openclaw/security-sensitive-reviewand dependency-review statuses passed.Final CI run
39620783593completed with only the inherited test-shard failure and its aggregate gate failure. The gate log (job 119303715083) confirms all other selected job groups passed, including build, production/test types, lint, docs, UI e2e, security-fast, and PostgreSQL conformance. CodeQL run39620783387completed successfully. GitHub retained stale pending rows for some jobs despite the completed workflow results; no rerun was requested. GitHub's independent code review also completed on the exact head with no findings.