Skip to content

fix(gateway): hot config reloads no longer cancel accepted runs - #160909

Merged
steipete merged 6 commits into
mainfrom
steipete/reload-keeps-runs
Sep 29, 2026
Merged

steipete merged 6 commits into
mainfrom
steipete/reload-keeps-runs

Conversation

@steipete

@steipete steipete commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: every in-flight agent run on a Gateway is cancelled (authority-revoked) when a committed hot reload changes authentication transport policy, even though no connected owner's access changed. Observed on the Team Gateway on 2026-09-28: a file edit of gateway.auth.trustedProxy.cloudflareAccessOidc closed every client with 4001 "gateway policy changed" and aborted every running turn, queued input, and subagent follow-up within one second, with no visible notice in the chat.

Related: #154461, #154792

User Impact

Operators can update proxy headers, OIDC mapping, trusted proxy addresses, IP fallback, or device auto-approval without losing accepted runs, queued inputs, or delegated work whose original grant remains valid. Existing connections may close with code 4001 and must reauthenticate before sending new requests. Removing the owner's identity-scope grant, proxy allowlist membership, or admitted browser origin, or disabling its admission method, still cancels accepted work; restoring the grant does not revive it.

Why This Change Was Made

Connection policy now carries separate transport and principal-grant fingerprints. Admission fences stale transports, while retained source authority follows committed grant changes, including after disconnect. Shared-generation publication receives the previous and next runtime configurations so proxy policy changes do not masquerade as credential rotation; allowlist revocations reach only affected retained principals.

Roles decision: gateway.roles stays outside the connection grant because each accepted run already enforces its assigned source-role policy and model ceiling through the existing run-authority owner.

Fence choice: preserve the existing broad transport fingerprint and proxy generation hash so policy changes require a new handshake without reconstructing admission from incomplete request facts; unrelated identity-scope edits and reordered grants keep the connection open.

Credential-rotation exception: changing the effective shared token/password still revokes sources and publishes generation invalidation exactly as before, cancelling work admitted with the old credential. Explicit all-source revocation is also unchanged. Trusted-proxy local password fallback carries its own hashed credential grant because the proxy transport hash omits that password; rotation revokes fallback-authenticated work without revoking proxy identities.

Origin-grant decision: browser-origin admission is part of the principal grant. The handshake captures immutable requestHost, origin, and isLocalClient facts; the grant fingerprints the existing origin check's result under current configuration. This includes inherited publicOrigin and host-header fallback policy. Committed config publication already rechecks retained source authority after socket and RPC retirement, so no new hook or store is needed. Removing an unrelated origin leaves the grant unchanged, and origin-specific close responses are preserved.

Evidence

Current initial-turn validation head: 2db5b714c829239d155993162942d206e6694c85 (fourth commit; pushed by the coordinator, CI on that head pending at the time of writing).

Current initial-turn follow-up: 23 suites, 300 tests passed, zero failures (271.14 s command wall), all four tsgo lanes passed, and one independent P2 autoreview ended scoped-clean. No CI workflow was dispatched for this local validation; the pushed head's PR CI runs normally.

Prior CI-repair validation head: e5171afa7811069fd3c0f7f67bbeb38558fd0b5d (third commit; pushed by the coordinator).

Prior origin-grant follow-up validation head: d13d79b82a81631e70eaf83528043c2ee3751365.

The pre-fix managed-reload regression failed in both grant-removal cases immediately after the OIDC reload: the accepted authority signal was aborted. The repaired regression uses a real operator authority and exec effect, removes the closed socket from the live-client set, survives OIDC followed by required-header reloads, and then proves irreversible revocation on scope or allowlist removal.

Independent review identified the local password fallback edge case. Its added regression failed before the repair (11 passed, 1 failed), then passed after the grant-owner repair (12 passed). Validation results and measured test costs follow below. No live Gateway was modified. No CI workflow was dispatched for this follow-up; CI seconds for the new unpushed head are unavailable.

Current CI-repair validation covers the five reported failing files and the earlier 13 suites: 18 suites, 238 tests passed, zero failures (207.58 s command wall time). The commands below are the per-file equivalents of the combined node scripts/run-vitest.mjs <all 18 listed files> --maxWorkers=2 invocation:

Command Result
node scripts/run-vitest.mjs src/gateway/server/ws-origin-policy.test.ts --maxWorkers=2 39 passed (39)
node scripts/run-vitest.mjs src/gateway/server-reload-handlers.identity-scopes.test.ts --maxWorkers=2 3 passed (3)
node scripts/run-vitest.mjs src/gateway/server/ws-connection/authenticated-request-dispatch.mutation-authority.test.ts --maxWorkers=2 16 passed (16)
node scripts/run-vitest.mjs src/gateway/server-shared-auth-generation.test.ts --maxWorkers=2 12 passed (12)
node scripts/run-vitest.mjs src/gateway/server-methods/config.shared-auth.test.ts --maxWorkers=2 23 passed (23)
node scripts/run-vitest.mjs src/gateway/server-methods/chat-send-auth-policy.test.ts --maxWorkers=2 2 passed (2)
node scripts/run-vitest.mjs src/gateway/server-reload-handlers.operator-model-policy.test.ts --maxWorkers=2 1 passed (1)
node scripts/run-vitest.mjs src/gateway/server/ws-connection/message-handler.post-connect-health.test.ts --maxWorkers=2 63 passed (63)
node scripts/run-vitest.mjs src/gateway/server/ws-shared-generation.test.ts --maxWorkers=2 2 passed (2)
node scripts/run-vitest.mjs src/gateway/server.shared-token-hot-reload.test.ts --maxWorkers=2 2 passed (2)
node scripts/run-vitest.mjs src/gateway/server-reload-managed-secrets.test.ts --maxWorkers=2 18 passed (18)
node scripts/run-vitest.mjs src/gateway/server/ws-connection/authenticated-request-dispatch.policy-close.test.ts --maxWorkers=2 14 passed (14)
node scripts/run-vitest.mjs src/gateway/server-aux-handlers.test.ts --maxWorkers=2 19 passed (19)
node scripts/run-vitest.mjs src/gateway/server-startup-secret-owner-isolation.test.ts --maxWorkers=2 12 passed (12)
node scripts/run-vitest.mjs src/gateway/server.health-store-scheduling.test.ts --maxWorkers=2 4 passed (4)
node scripts/run-vitest.mjs src/gateway/server.channels-start-outcomes.test.ts --maxWorkers=2 2 passed (2)
node scripts/run-vitest.mjs src/gateway/server.approval-request-lifetime.test.ts --maxWorkers=2 4 passed (4)
node scripts/run-vitest.mjs src/gateway/server.worker-placement-startup-context.test.ts --maxWorkers=2 2 passed (2)

Changed-test cost, measured serially with the required single-worker command (origin-policy and worker-placement costs refreshed for the CI repair; identity-scopes retains its origin-follow-up measurement and the other files retain their first-commit measurements):

Command Wall time Result
pnpm test src/gateway/server/ws-origin-policy.test.ts --maxWorkers=1 19.51 s 39 passed (39)
pnpm test src/gateway/server-reload-handlers.identity-scopes.test.ts --maxWorkers=1 66.33 s 3 passed (3)
pnpm test src/gateway/server/ws-connection/authenticated-request-dispatch.mutation-authority.test.ts --maxWorkers=1 13.42 s 16 passed (16)
pnpm test src/gateway/server-shared-auth-generation.test.ts --maxWorkers=1 10.55 s 12 passed (12)
pnpm test src/gateway/server-methods/config.shared-auth.test.ts --maxWorkers=1 11.30 s 23 passed (23)
pnpm test src/gateway/server-methods/chat-send-auth-policy.test.ts --maxWorkers=1 22.47 s 2 passed (2)
pnpm test src/gateway/server.worker-placement-startup-context.test.ts --maxWorkers=1 47.29 s 2 passed (2)

The managed-reload integration measured 66.33 s command wall time, including 7.742 s of test execution. It exercises the production dispatcher, committed reload publication, retained operator authority, native child launch, and filesystem effect held at the asynchronous prelaunch boundary; a cheaper mocked authority cannot prove this composition. That observable effect distinguishes preserved authority from a mock that merely remains un-aborted. Its refreshed 66.33 s command wall time includes compilation and fixture startup; no full Gateway boots, sleeps, or timer polling were added. Original baseline single-worker wall times were 52.56 s for ws-origin-policy and 77.03 s for identity-scopes; compilation/cache conditions differ, so these are cost measurements rather than a performance claim.

Typechecks passed (exit 0):

  • node scripts/run-tsgo.mjs -p tsconfig.core.json
  • node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.core.test.gateway-root.json
  • node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.core.test.gateway-server.json
  • node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.core.test.gateway-methods.json

Preparation: node scripts/worktree-setup.mjs gateway passed. The gateway preparation excludes UI dependencies reached by two test type graphs; pnpm --filter openclaw-control-ui... install --frozen-lockfile restored those existing dependencies, and all typechecks then passed without manifest or lockfile changes.

Scoped oxlint, node_modules/.bin/oxfmt <all changed files>, the corresponding oxfmt --check, and git diff --check passed. The origin-grant follow-up received one independent Codex autoreview pass with --max-priority P2, which finished scoped-clean with no actionable P0–P2 findings. An old queued-chat expectation that IP-fallback edits cancel accepted work was updated to require transport fencing with the queue and authority preserved.

No production Gateway replay or live deployment was performed; the incident proof uses the isolated managed-reloader and dispatcher with a real retained operator authority and real exec effect.

The following accounting remains unchanged for the original commit 08918a8b364dc; the follow-up is listed separately.

Production line delta: +224/−54 across the gateway auth, reload, and dispatch owners (tests +474/−51, docs +20/−14). This is a security-boundary correctness fix; no unrelated cleanup was bundled to keep the auth change reviewable on its own.

Origin-grant regression on the prior head: 35 passed, 5 failed, including the retained exec authority remaining active after its origin was removed. The repaired regression removes an unrelated origin while the socket and RPC are absent from the client index and proves the real effect succeeds; it then removes the admitted origin, observes synchronous authority abort, restores the config, and proves the held effect is still denied.

Redacted excerpt from the passing regression (test-owned marker paths only):

[origin-grant] marker=<test-state>/transport.txt outcome=accepted (exitCode=0, marker written)
[origin-grant] marker=<test-state>/revoked.txt outcome=denied (authority revoked, marker absent)

Review disposition: installed-update/published-driver × candidate proof does not apply because this PR changes only running-Gateway hot-reload policy reconciliation, not openclaw update, Doctor, service lifecycle, config shape, or migrations.

Review disposition: additional live-production behavior proof is not required under the maintainer-authored exemption; this regression drives the production managed reloader and dispatcher, retains real operator authority, and checks a real exec/file effect, as shown above.

Origin follow-up line delta: production +41/−32 across six existing owners, tests +101/−4, docs +2/−0. No unrelated cleanup, new store, or new publication hook was added.

CI repair: exact-head run 36516232884 exposed lost startup auth-mode provenance in server-startup-secret-owner-isolation.test.ts, server.health-store-scheduling.test.ts, server.channels-start-outcomes.test.ts, server.approval-request-lifetime.test.ts, and server.worker-placement-startup-context.test.ts (all under src/gateway/). The failures reproduced locally: 11 failed, 12 passed. The Gateways admitted clients under a fixed auth.mode: "none" startup override, while the RPC fixture republished a token-mode source snapshot. The transport fingerprint was unchanged and committed authority remained current, but grant reconstruction omitted the resolver's fixed override and changed methodEnabled from true to false. The handshake now retains the resolver-attested override mode, and grant reconstruction applies it through the existing auth resolver. File-selected modes still revoke when disabled. No existing failing test or fixture-publication behavior was changed.

The CI repair adds a real-Gateway token-client control that reads, writes an unrelated messages.ackReactionScope key through the real config IO owner, verifies the write through config.get, and keeps issuing requests on the same connection. The new override-vs-file-mode unit case was red before the repair: 38 passed, 1 failed.

The new real-Gateway control initially reached the fixture's stubbed write path, which reported an unclaimed config.patch; it now calls the actual config-write owner with production startup enabled. Existing failure cases and fixture helpers remain unchanged. The final independent autoreview pass (--max-priority P2) was scoped-clean. The worker-placement file cost includes the existing production-startup worker test and the new real-Gateway/config-write case; that integration cannot be replaced by a mocked policy predicate without losing the admission-to-request boundary proof.

CI-repair line delta: production +15/−2 across three existing owners; tests +62/−2 across two files. No new config option, manager, store, or compatibility path was added.

Exact final CI-repair test command:

node scripts/run-vitest.mjs src/gateway/server.approval-request-lifetime.test.ts src/gateway/server.channels-start-outcomes.test.ts src/gateway/server.worker-placement-startup-context.test.ts src/gateway/server.health-store-scheduling.test.ts src/gateway/server-startup-secret-owner-isolation.test.ts src/gateway/server/ws-origin-policy.test.ts src/gateway/server-reload-handlers.identity-scopes.test.ts src/gateway/server/ws-connection/authenticated-request-dispatch.mutation-authority.test.ts src/gateway/server-shared-auth-generation.test.ts src/gateway/server-methods/config.shared-auth.test.ts src/gateway/server-methods/chat-send-auth-policy.test.ts src/gateway/server-reload-handlers.operator-model-policy.test.ts src/gateway/server/ws-connection/message-handler.post-connect-health.test.ts src/gateway/server/ws-shared-generation.test.ts src/gateway/server.shared-token-hot-reload.test.ts src/gateway/server-reload-managed-secrets.test.ts src/gateway/server/ws-connection/authenticated-request-dispatch.policy-close.test.ts src/gateway/server-aux-handlers.test.ts --maxWorkers=2

All four tsgo lanes passed; the gateway-server lane was also rerun after the new fixture selected real config IO. Scoped oxlint, oxfmt/check, git diff --check, and one P2 autoreview pass were clean. No CI workflow was dispatched for that local validation.

Initial-turn follow-up: sessions.create committed its new row but carried transport-bound mutation guards into the requested initial turn. A transport-only reload could therefore strand that turn after session creation. The existing request source owner now records a one-way acceptance at the new-row commit, so the original callback and mutation guards follow retained source authority for that continuation. The turn receives the existing transport-independent principal snapshot; profile, role, session target, device, explicit cancellation, and hosted-child custody checks remain intact. Only a live, retained source can enter this phase, and releasing its final holder ends that authority even while the socket remains open. No new store, manager, config option, or hook was added.

The finalized real-Gateway regression admits two explicit non-main sessions.create requests before one committed transport fence. Both initial turns reach dispatch; one persists its real user transcript and reaches the provider boundary, while rotating the shared token before the other's persistence attempt denies that final write and leaves its transcript absent. The fixture waits for the production config-write application receipt, not merely file persistence, before checking either outcome. On the previous head the finalized regression fails with initial turn retired before dispatch (1 failed, 0 passed; pnpm test src/gateway/server.sessions.create.auth-policy.test.ts --maxWorkers=1, 54.72 s wall); with the owner repair the focused regression passes (1 passed, 0 failed). Earlier fixture iterations incorrectly used an asynchronous synchronous-hook callback and did not await runtime application; those fixture issues were corrected without weakening the grant assertions.

[initial-turn-grant] session=agent:main:dashboard:initial-source-retained outcome=accepted (transcript written)
[initial-turn-grant] session=agent:main:dashboard:initial-source-revoked outcome=denied (transcript absent)

The original, origin-grant, and CI-repair production LOC statements above remain unchanged. Initial-turn follow-up delta: production +62/−6 across three existing owners, tests +283/−0 across two files, docs +2/−1. The production growth carries the commit-to-initial-turn phase through existing guards; it does not change ordinary request fencing or hosted child admission.

The final follow-up reran every earlier suite at the same counts shown above, plus:

Suite Result
src/gateway/device-revocation.test.ts 10 passed
src/gateway/server.sessions.create.auth-policy.test.ts 1 passed (retained and revoked scenarios)
src/gateway/server-methods/sessions-create.child-custody.test.ts 23 passed
src/gateway/server.sessions.create.dispatch.test.ts 16 passed
src/gateway/server.sessions.create.authority.test.ts 12 passed

Exact final test invocation (wrapped with /usr/bin/time -p):

node scripts/run-vitest.mjs src/gateway/server.approval-request-lifetime.test.ts src/gateway/server.channels-start-outcomes.test.ts src/gateway/server.worker-placement-startup-context.test.ts src/gateway/server.health-store-scheduling.test.ts src/gateway/server-startup-secret-owner-isolation.test.ts src/gateway/server/ws-origin-policy.test.ts src/gateway/server-reload-handlers.identity-scopes.test.ts src/gateway/server/ws-connection/authenticated-request-dispatch.mutation-authority.test.ts src/gateway/server-shared-auth-generation.test.ts src/gateway/server-methods/config.shared-auth.test.ts src/gateway/server-methods/chat-send-auth-policy.test.ts src/gateway/server-reload-handlers.operator-model-policy.test.ts src/gateway/server/ws-connection/message-handler.post-connect-health.test.ts src/gateway/server/ws-shared-generation.test.ts src/gateway/server.shared-token-hot-reload.test.ts src/gateway/server-reload-managed-secrets.test.ts src/gateway/server/ws-connection/authenticated-request-dispatch.policy-close.test.ts src/gateway/server-aux-handlers.test.ts src/gateway/device-revocation.test.ts src/gateway/server.sessions.create.auth-policy.test.ts src/gateway/server-methods/sessions-create.child-custody.test.ts src/gateway/server.sessions.create.dispatch.test.ts src/gateway/server.sessions.create.authority.test.ts --maxWorkers=2

The four typecheck commands listed above all passed on the repair. Scoped oxlint, node_modules/.bin/oxfmt and oxfmt --check on the six changed files, and git diff --check passed. The independent review command was .agents/skills/autoreview/scripts/autoreview --mode local --engine codex --max-priority P2 --dataset .local/initial-turn-review-context.md; its machine result was scoped-clean, exit 0, with no actionable P0–P2 findings. The ignored review context supplied the relevant unchanged authority, dispatch, creation, and config-application owners.

This regression boots one isolated Gateway for two accepted initial turns and verifies real transcript writes; inference is mocked. No production Gateway or live model call was exercised; CI seconds for the fourth commit follow from its PR run.

Changed-test cost for the initial-turn follow-up:

Exact command Wall time Result
pnpm test src/gateway/server.sessions.create.auth-policy.test.ts --maxWorkers=1 78.72 s 1 passed, 0 failed; 23.222 s test execution
pnpm test src/gateway/device-revocation.test.ts --maxWorkers=1 4.20 s 10 passed, 0 failed

The integration shares one Gateway and two admitted initial turns. Its real WebSocket/session commit, managed config application, source handoff, and durable transcript boundary are the contract under test; a direct predicate test cannot establish that composition. No sleeps, polling, per-case Gateway boots, or worker pin were added. Wall time includes fixture startup and compilation, varies with host load, and is recorded as cost rather than a performance claim.

Separate transport policy fencing from each admitted principal's access grant.
Keep accepted runs, queued inputs, and delegated effects alive across proxy
policy reloads; revoke them when identity grants, allowlist membership, admission
methods, or their shared credential end. Preserve proxy handshake generations
and ordinary token/password rotation, including the local proxy password fallback.

Keep role-policy enforcement with run authority and document reconnect behavior.
@clawsweeper

clawsweeper Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime size: L labels Sep 29, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 29, 2026
@clawsweeper

clawsweeper Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 29, 2026, 3:36 AM ET / 07:36 UTC (Revision 7).

ClawSweeper review

What this changes

The branch changes Gateway hot reloads so clients reconnect after transport-policy edits while accepted runs continue under their original live grants, with regression tests and operator documentation.

Merge readiness

✅ Ready for maintainer review

Keep open. Current main still revokes accepted work when certain Gateway transport settings change, and this branch addresses that distinct problem. The reviewed authority paths and recorded final-effect proof support the fix; I found no discrete introduced defect.

Priority: P1
Reviewed head: c00fb77051b5ccc967a886faba19c2c54fb13d29

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Strong red/green boundary evidence, focused owner-level changes, and explicit revoked-principal checks support an above-average review rating.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The changed Gateway reload and authority owners are exercised through an isolated managed reloader and production dispatcher: a retained operator's native exec writes its marker after proxy edits, while scope, allowlist, or origin removal denies a held effect before launch. A real WebSocket sessions.create test observes transcript persistence after a transport fence and its absence after token rotation. The PR body records the after-fix terminal outcomes; the reviewer did not rerun them. No stored-data format changes.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The changed Gateway reload and authority owners are exercised through an isolated managed reloader and production dispatcher: a retained operator's native exec writes its marker after proxy edits, while scope, allowlist, or origin removal denies a held effect before launch. A real WebSocket sessions.create test observes transcript persistence after a transport fence and its absence after token rotation. The PR body records the after-fix terminal outcomes; the reviewer did not rerun them. No stored-data format changes.
Evidence reviewed 9 items Current main still has the reported coupling: The current-main policy reconciliation invalidates a client when its authentication policy changes without distinguishing transport fencing from source revocation.
Introduced grant separation: The pinned introduced diff adds a per-principal grant generation and compares it independently of the transport generation.
Committed reload publication: Proxy-to-proxy transitions publish principal-specific invalidation when an allowlist or fallback credential changes; retained sources receive the event even after their socket leaves the client set.
Findings None None.
Security None None.

How this fits together

The Gateway authenticates WebSocket clients and applies configuration changes to live connections. Accepted requests then pass to session and run owners, which must either continue the work or cancel it when its access grant ends.

flowchart LR
  A[Client request] --> B[Gateway authentication]
  C[Committed config edit] --> D[Reload policy]
  B --> E[Captured access grant]
  D --> F[Reconnect decision]
  D --> G[Grant recheck]
  E --> G
  G --> H[Continue or cancel accepted work]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +248, Tests +863, Docs +9. Total +1120 across 28 files.

View PR surface stats
Area Files Added Removed Net
Source 17 334 86 +248
Tests 9 917 54 +863
Docs 2 23 14 +9
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 28 1274 154 +1120

Review metrics

Metric Value Why it matters
Production and test growth production +334/−86 lines; tests +917/−54 lines The production growth is tied to grant-aware reload and request owners, with boundary regressions for preserved and revoked work.

Technical review

Best possible solution:

Keep reconnect fencing with the Gateway transport owner and grant revocation with the retained-authority owner, including checks before disconnected and initial-turn effects.

Do we have a high-confidence way to reproduce the issue?

Yes. Current main's reconciliation path shows the transport-to-source coupling, and the PR records a pre-fix failure and after-fix result at the managed reload boundary; this read-only review did not execute it.

Is this the best way to solve the issue?

Yes. The branch uses existing Gateway admission, reload-publication, and retained-source owners while preserving revocation before final effects.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against b4ae783fbfd2.

Labels

Label changes:

No label changes.

Label justifications:

  • P1: The reported hot reload cancels active agent runs, queued input, and delegated work for connected users.
  • merge-risk: 🚨 message-delivery: Changing which accepted turns survive a reconnect can affect whether queued and in-flight chat work completes.
  • merge-risk: 🚨 security-boundary: The branch lets accepted authority outlive its socket and therefore depends on the verified final-effect checks when grants are revoked.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The changed Gateway reload and authority owners are exercised through an isolated managed reloader and production dispatcher: a retained operator's native exec writes its marker after proxy edits, while scope, allowlist, or origin removal denies a held effect before launch. A real WebSocket sessions.create test observes transcript persistence after a transport fence and its absence after token rotation. The PR body records the after-fix terminal outcomes; the reviewer did not rerun them. No stored-data format changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed Gateway reload and authority owners are exercised through an isolated managed reloader and production dispatcher: a retained operator's native exec writes its marker after proxy edits, while scope, allowlist, or origin removal denies a held effect before launch. A real WebSocket sessions.create test observes transcript persistence after a transport fence and its absence after token rotation. The PR body records the after-fix terminal outcomes; the reviewer did not rerun them. No stored-data format changes.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Shakker: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (6 earlier review cycles)
  • reviewed 2026-09-29T02:51:38.977Z sha 08918a8 :: needs real behavior proof before merge. :: [P1] Revoke retained work when a disconnected browser origin is removed
  • reviewed 2026-09-29T02:58:42.957Z sha 08918a8 :: needs real behavior proof before merge. :: [P1] Revoke detached runs when their browser origin is removed
  • reviewed 2026-09-29T03:21:41.362Z sha d13d79b :: needs maintainer review before merge. :: none
  • reviewed 2026-09-29T04:43:20.589Z sha e5171af :: needs changes before merge. :: [P1] Carry the retained grant through initial-turn mutation guards
  • reviewed 2026-09-29T06:05:04.197Z sha 2db5b71 :: blocked before merge. :: none
  • reviewed 2026-09-29T06:18:51.630Z sha 8027f52 :: needs maintainer review before merge. :: none

@steipete
steipete marked this pull request as ready for review September 29, 2026 02:53
@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components. This comment is informational because the PR author has repository Maintain or Admin access.

  • Current SHA: c00fb77051b5ccc967a886faba19c2c54fb13d29
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/gateway/auth-policy.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/auth-policy.types.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/device-revocation.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/origin-check.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/server-reload-managed-secrets.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/gateway/server-secrets-reload.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/gateway/server-shared-auth-generation.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/server/ws-connection/authenticated-request-dispatch.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/server/ws-connection/connect-admission.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/server/ws-connection/connect-auth.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/server/ws-origin-policy.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.

Carefully review these changes before merging.

Retain handshake origin facts in the principal grant and recheck their current
admission through the existing committed config publication. Origin revocation
now cancels accepted execution after its socket and RPC have retired, while
unrelated origin edits preserve the run. Keep origin-specific close responses.

Prove the fenced-socket sequence with the managed reloader, dispatcher, and a
real exec/file effect, including irreversible revocation after config restore.
Follow-up to #160909.
Retain the auth resolver's fixed startup mode in the admitted principal and
reapply it when reconstructing the access grant. A raw config snapshot no
longer falsely fences connections whose effective startup auth mode is unchanged.
Configured mode disablement and the existing source revocation checks remain.

Repair the five real-Gateway CI suites and cover ordinary token requests across
an unrelated config write through the real config IO owner.
Follow-up to #160909.
@clawsweeper clawsweeper Bot added merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 29, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 29, 2026
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Sep 29, 2026
@steipete
steipete merged commit 32d3642 into main Sep 29, 2026
236 checks passed
@steipete
steipete deleted the steipete/reload-keeps-runs branch September 29, 2026 08:09
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Sep 29, 2026
…its its row cap

Since 32d3642 (#160909) the hybrid hourly Node plan needed 80 rows against its 79-row cap, failing keeps the hybrid hourly plan within the main-tier cap on main and in every PR's ci-gate. The new Gateway auth-policy test reshuffled four agent-chat stripes, and greedy initial packing then stranded three 140-second storage groups in separate rows. Hybrid initial packing now places exclusive serial Gateway groups before flexible parallel groups so parallel work fills the remaining space. The plan returns to 77 rows (75 Node + 2 dist); caps, budgets, timing baselines, and worker policies are unchanged.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 30, 2026
…claw#160909)

* fix(gateway): keep accepted runs alive across auth policy reloads

Separate transport policy fencing from each admitted principal's access grant.
Keep accepted runs, queued inputs, and delegated effects alive across proxy
policy reloads; revoke them when identity grants, allowlist membership, admission
methods, or their shared credential end. Preserve proxy handshake generations
and ordinary token/password rotation, including the local proxy password fallback.

Keep role-policy enforcement with run authority and document reconnect behavior.

* fix(gateway): revoke detached runs when their browser origin is removed

Retain handshake origin facts in the principal grant and recheck their current
admission through the existing committed config publication. Origin revocation
now cancels accepted execution after its socket and RPC have retired, while
unrelated origin edits preserve the run. Keep origin-specific close responses.

Prove the fenced-socket sequence with the managed reloader, dispatcher, and a
real exec/file effect, including irreversible revocation after config restore.
Follow-up to openclaw#160909.

* fix(gateway): keep startup auth mode stable across config reads

Retain the auth resolver's fixed startup mode in the admitted principal and
reapply it when reconstructing the access grant. A raw config snapshot no
longer falsely fences connections whose effective startup auth mode is unchanged.
Configured mode disablement and the existing source revocation checks remain.

Repair the five real-Gateway CI suites and cover ordinary token requests across
an unrelated config write through the real config IO owner.
Follow-up to openclaw#160909.

* fix(gateway): retain grants for committed initial turns
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 30, 2026
…its its row cap

Since 730285d (openclaw#160909) the hybrid hourly Node plan needed 80 rows against its 79-row cap, failing keeps the hybrid hourly plan within the main-tier cap on main and in every PR's ci-gate. The new Gateway auth-policy test reshuffled four agent-chat stripes, and greedy initial packing then stranded three 140-second storage groups in separate rows. Hybrid initial packing now places exclusive serial Gateway groups before flexible parallel groups so parallel work fills the remaining space. The plan returns to 77 rows (75 Node + 2 dist); caps, budgets, timing baselines, and worker policies are unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation gateway Gateway runtime merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. security-sensitive-changed size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant