Skip to content

fix(gateway): apply settings without unnecessary restarts - #154792

Merged
steipete merged 3 commits into
mainfrom
codex/settings-live-policy-integration
Sep 21, 2026
Merged

steipete merged 3 commits into
mainfrom
codex/settings-live-policy-integration

Conversation

@steipete

@steipete steipete commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Saving ordinary Settings could restart the Gateway, retain stale service policy, or leave an already authenticated request using permissions that had just been revoked.

User Impact

Desktop, Cloud Worker profiles and pools, ACP policy, meeting capture, Browser relay authentication, audit collection, worktree acceleration, and Gateway access policies apply without a Gateway restart. Changed capture sources drain accepted speech while unchanged sources continue; existing workers retain their admitted provisioning settings. A policy-changing configuration writer receives its result before affected clients reconnect.

Media, avatar/icon, bootstrap, and cancellation requests recheck authority after asynchronous preparation and before protected responses or effects. Policy changes invalidate plugin-frame cookies even when credentials stay the same; a bootstrap response rejected after policy revocation discards its staged grant cookie.

Listener bind/port, effective authentication mode, and TLS topology retain their restart requirement. Audit changes affect future collection rather than reconstructing past events. No new settings, schemas, dependencies, or retention changes.

Why This Change Was Made

Each existing service owns its live reconciliation. Desktop stream custody, secrets publication/cleanup, HTTP authority checks, and UI request ownership replace duplicate state and wrappers. Manual meeting captures retain their actual plugin owner after the initiating chat turn ends, and Gateway shutdown drains them before plugin retirement. Committed policy changes revoke retained authority while failed tentative updates preserve it.

Against main base 2d71ebc9426ecb14d0353e113265598959a45e07, production code decreases by 26 code lines (cloc) and 64 physical lines (+2,415 / −2,479) across 109 production paths. Tests, test support, documentation, and generated files are excluded. The production source seal remains unchanged (3554fc4149ef4b36968a0004448065c8d8dbd60e04ae02dcf793bcfb31c80148) and binds to current tree 1a2ab59aa8ffa7a06519900441c6ed0a371f2455.

Evidence

Final candidate: c54ef83dc51bde7047a6d47a158c1b196323b7c9, source tree 1a2ab59aa8ffa7a06519900441c6ed0a371f2455, based on main 2d71ebc9426ecb14d0353e113265598959a45e07. The only change from the live-tested 2dd4d6503689bfab31bf4417dd8f838bb5970a77 is src/gateway/server-methods/plugin-approval.test.ts; all Gateway production bytes and the production source seal are identical. Remote receipts remain labeled 2dd4d650 rather than being relabeled as this head. The candidate also inherits the landed CI-output repair and upstream directive-test repair 087ccde.

  • Earlier feature proof: isolated Crabbox/Testbox runs exercised authenticated config.patch, desktop replacement, worker-provider activation/catalog changes, worktree allocation, ACP admission/dispatch, audit enable/disable, and transcript drainage with unchanged sibling retention. The recorded desktop/transcript replay retained the original operator connection. On committed candidate 06b203337e502767109e3d317c6bd4db1903f449, all five role/proxy/identity cases and all three legacy-relay authentication states passed without a Gateway process restart; eight policy writes were acknowledged before revocation. The Browser replay closed obsolete relay connections, rejected disabled legacy authentication, retained v2, and preserved the operator connection.
  • Final Crabbox proof on 2dd4d650: 428/428 tests across 14 complete files passed with zero skips, todos, or snapshot updates (265.545 s combined standalone wrapper wall; 58.554 s native test-case span). The real Gateway auth replay passed all five scenarios and eight config writes, with every writer acknowledged before its own revocation and the same Gateway PID/instance throughout. Browser legacy authentication enabled → disabled → enabled passed: disabled legacy requests returned 401, v2 remained usable, obsolete relay connections drained, and the original operator socket survived. The Testbox run used carrier cf1d2d33b510dadf156443d244095f4c0a88bf09 for tree ed9251ed7023cc851811a6d81e7ab222f4c4c9d5; source stayed unchanged. Owned processes/listeners stopped, and lease cleanup completed with no active owned commands or leases.
  • Supplemental production HTTP proof on c54ef83d: complete executed harnesses and sanitized receipts close the admission-to-effect gap. Five media scenarios and two cancellation cases passed on Blacksmith Testbox, using the production HTTP router/authentication, canonical records, real client responses, and actual effect owners. Allowed media requests received the exact fixture bytes; credential or proxy-policy revocation after the real file-open barrier returned 401 without protected bytes or representation headers. Authorized cancellation sent SIGTERM to the owned child and persisted cancelled; revocation after the real lifecycle-queue barrier returned 401 with no abort, a responsive child, and task state still running before separate cleanup. Media/cancellation phases took 11.400 s / 8.561 s; source, input hashes, and cleanup were verified. The runtime handle is an owned fixture connected to a real child process, and only its unrelated agent.wait completion monitor returns a synthetic pending result. Policy is published through the canonical runtime snapshot owner; the CLI replay above proves config.patch continuity.
  • Boundary regressions: the preceding 14-file run additionally covers six revoked-media variants, 131 allowed-media/sibling cases, 17 HTTP cancellation handoff cases, and eight production cancellation-owner cases, including revocation before interruption, after interruption, and after abort. Their individual dependency injections remain disclosed in the recorded test scope.
  • Published updater: the actual [email protected] updater installed candidate 2026.9.5; the custom-plugin-siblings baseline, canary, and candidate runtime checks passed in 141.037 s. This used manual restart mode and does not establish managed-restart timing. Package/update proof belongs to source tree d8933e042d9b18eeb2069b3f24dd1f3d067a9230 at 06b203337e502767109e3d317c6bd4db1903f449, carried remotely by 46285c4c9c6b15406ce9d441e0dfaea1f944ecfc; source remained unchanged.
  • Package comparison: candidate unpacked size was 257,813,805 bytes, versus 257,929,696 bytes for exact base 1ccccb02788a6bbc8eb9448faa96f4842720ebe6: 115,891 bytes smaller, with 12,964 files each. Both exceed the unchanged 246,415,360-byte (235 MiB) release-size limit. The base comparison establishes that excess predates this branch; it does not make the size check pass. Candidate SHA-256: 2e1856e9afb8acc713e4fa8d7b98facd8964a468b97ebf7883ed7f66048ad896. Earlier plugin-version/locale release-preflight failures remain recorded; these results do not claim release readiness or completion of the separate installed bundled-channel smoke.
  • Test evidence: the earlier sealed Linux ledger remains 2,043/2,043 tests across 50 files, 1,026.139 s wrapper wall and 317.689 s native test-case span. Later HTTP, cookie, fixture, and import-cycle repairs have separate measured receipts below; their repeated and selected cases are not added to that total. The architecture check passed with zero import cycles (336.238 s) after moving provider-auth activation into the existing secrets state owner.
  • Failures and repairs: startup hoisting, obsolete restart expectations, an incomplete Google Meet runtime mock, config-publication fixtures, and transcript fixture discovery were repaired at their owners. The initial HTTP media run exposed worker-routing/fixture failures (six authority tests and five media tests failed); repaired full-file runs passed 6/6 and 131/131. Failed receipts remain preserved. Explicitly filtered tests are labeled below rather than counted as full-suite proof.
  • Final integration checks: 99 authentication/cookie tests passed across six standalone files (248.719 s combined wrapper wall), followed by 75 downstream HTTP/operator-run/WebSocket tests (146.309 s). The final subscriptions/history cleanup passed 148/148 grouped tests in 240.137 s, bound to tree 861b59985878c7bd3a40a287896cd8597d2577c9. All 25 core-test type graphs, core production, and root HTTP consumer types passed on integration tree ae3f087e0d12eb6c2f6ea87d67d5d5817b4290f9 (commit 567d696f93110689f4bc7202e4fe2a3369133d99); the small subsequent cleanup passed core types and the affected Gateway-server test graph. The full static run’s line-cap and lint findings were addressed in that cleanup; the full-PR line-cap recheck and scoped type-aware lint both passed.
  • Post-rebase proof: the full transcript lifecycle file passed 42/42 tests on 62433684098f8be17562d1f5a2f44423b51b4afa (103.020 s wrapper wall). Core production types (12.447 s), the affected agents/tools type graph (63.083 s), overlap formatting, and committed whitespace checks also passed with unchanged source and index. The fixture merge retains upstream clock bindings and summary-file assertions alongside the reviewed provider ownership cutover.
  • Review: all three independent integration review passes completed. Two initial reports were rejected after direct source verification: disabled ACPX startup probing does not install a health predicate, and the bootstrap cookie allegation did not establish unauthorized or revoked access. Passes two and three reported no actionable P0–P2 findings. The narrow cleanup review was independently scoped-clean through P2; deslop is complete.
  • CI output repair: the previous head’s CI run stopped because job outputs exceeded GitHub’s 1,048,576-byte limit. The two-line repair, now landed in main at 2d71ebc9426ecb14d0353e113265598959a45e07, removes unused Node matrix runtime/task fields. All 644 workflow guard tests passed (248.114 s), with 12 existing skipped cases; static workflow checks passed (11.662 s). Real planner/consumer comparison preserved all 133 rows and consumer plans for both release-gate modes while reducing each UTF-16 payload by 9,842 bytes (86.316 s). The repair’s independent review was scoped-clean through P2. The hosted preflight job on the prior 62433684 head passed. That full run was superseded after stale directive-test failures were fixed upstream in 087ccde, which this candidate inherits. This establishes the prior head’s hosted preflight only; the later 2dd4d650 run is recorded separately below.
  • Terminal CI on 2dd4d650: run 35629712958 finished with 152 successful, 12 skipped, and three failed jobs (167 total). Preflight passed in 91 s. Two unchanged-main tests failed; the third failed job was the aggregate gate. Session-history eviction observed 1,849,376 bytes against a 1,482,751-byte high-water assertion; a bounded local full-file replay passed 27 tests but retained a termination warning, and neither the failure nor warning cause is established. The PR-refresh fixture failed to spawn its executable with ETXTBSY before checkpoint logic; the writable holder remains unknown. Passing replays are not claimed as fixes, and no retry or timeout workaround was added.
  • Approval fixture follow-up: a separate test-only repair replaces one-second polling with observation of the response callback. The unchanged full file reproduced nine acceptance-wait failures out of 35 cases (341.72 s). All nine affected cases passed after repair, and independent review was scoped-clean through P2. The repaired full-file run passed 34/35 (462.81 s standalone wrapper wall with --maxWorkers=1), with the remaining case reporting a SQLite lock. An ordered two-case replay passed 2/2 with 33 deliberately filtered cases (77.50 s); this does not establish a fix for the lock. The repair landed on main as 703dc02bc3ea4a5d20ce5bfebddc856e46725285 and was cherry-picked into this PR as c54ef83dc51bde7047a6d47a158c1b196323b7c9. It changes only the test fixture.
  • Current-head CI: run 35634684122 passed for c54ef83dc51bde7047a6d47a158c1b196323b7c9: 153 successful jobs, 12 skipped, zero failures, including openclaw/ci-gate. The job containing the approval test passed in 560 s of whole-job wall time, not per-file timing. This changed-input run does not establish the causes of the earlier unrelated archive, SQLite-lock, or executable-spawn failures.
  • Landed: merged as 678cdf4246e7 through the native maintainer workflow after current-head CI and the requested supplemental HTTP proof passed. The completed Crabbox proof remains tied to 2dd4d650, whose Gateway production bytes are unchanged at this head; older feature/package/updater receipts retain their original source scope.

The runtime proof uses real CLI Gateways with synthetic loopback worker, model, transcript, proxy, and extension-protocol peers. It does not prove external cloud provisioning, Browser relay integration with real Chrome, a Tailscale network, or an external identity provider. The inspected before/after screenshots below use synthetic UI fixtures.

Final Crabbox boundary costs on 2dd4d65

Each command selected one complete file through the repository Vitest wrapper with --maxWorkers=1. Wrapper wall includes preparation and imports; native test-case span excludes setup before the first case and teardown after the last. Compiled-worker and filesystem module caches were reused sequentially where supported. These are standalone Testbox measurements, not PR CI job seconds, and are separate from earlier repeated-file ledgers.

Test file Passed Native test-case span (s) Wrapper wall (s)
src/gateway/managed-image-attachments.authority.test.ts 6 0.520 24.405
src/gateway/session-kill-http.test.ts 17 0.178 14.363
src/gateway/control-ui.response-authority.test.ts 4 0.319 12.253
src/gateway/control-ui-plugin-auth-cookie.test.ts 13 0.467 9.923
src/gateway/user-profiles-http.auth.test.ts 16 15.158 24.491
src/gateway/channel-avatar-http.test.ts 14 0.369 9.964
src/gateway/workspace-icon-http.test.ts 62 0.450 10.150
src/gateway/plugin-icon-http.test.ts 86 0.559 13.755
src/gateway/control-ui-plugin-assets.test.ts 24 0.753 11.298
src/gateway/server.plugin-frame-auth.test.ts 14 0.073 16.742
src/gateway/server/plugins-http.runtime-scopes.test.ts 28 6.573 19.281
test/plugins/team-reports-http.gateway.test.ts 5 14.114 40.216
src/gateway/managed-image-attachments.test.ts 131 8.858 19.459
src/agents/subagents/registry/subagent-control.concurrency.test.ts 8 10.163 39.246
Recorded integration test costs

Authentication and downstream rows ran through the repository wrapper with --maxWorkers=1; the four WebSocket files and the three cleanup files ran as the named groups. Authentication receipt hashes remained unchanged. Cleanup test and type receipts bind to their recorded pre-rebase inputs; the broader type graph result is reused only for unchanged inputs. These wall times are independent of the older 50-file ledger and PR CI job durations.

Test file / scope Observed result Wrapper wall (s)
src/gateway/control-ui.response-authority.test.ts 4 passed (4) 60.776
src/gateway/server/plugins-http.runtime-scopes.test.ts 28 passed (28) 44.880
src/gateway/control-ui-plugin-auth-cookie.test.ts 13 passed (13) 27.985
src/gateway/user-profiles-http.auth.test.ts 16 passed (16) 56.697
src/gateway/http-auth-utils.test.ts 21 passed (21) 37.313
src/gateway/http-utils.authorize-request.test.ts 17 passed (17) 21.068
src/gateway/http-endpoint-helpers.test.ts 8 passed (8) 6.304
src/gateway/openai-compatible-agent-run.test.ts 20 passed (20) 56.520
src/gateway/tools-invoke-http.abort.test.ts 8 passed (8) 51.760
src/gateway/server/ws-connection/authenticated-request-dispatch.abort.test.ts + src/gateway/server/ws-connection/authenticated-request-dispatch.lifetime.test.ts + src/gateway/server/ws-connection/authenticated-request-dispatch.mutation-authority.test.ts + src/gateway/server/ws-connection/authenticated-request-dispatch.policy-close.test.ts 39 passed (39) 31.725
server-runtime-subscriptions.test.ts + sessions-history-http.revocation.test.ts + sessions-history-http.test.ts 148 passed; grouped final cleanup 240.137
src/agents/tools/transcripts-tool.lifecycle.test.ts — post-rebase head 62433684 42 passed 103.020
Later repair and HTTP authority costs

These are working-tree repairs after 06b203337e502767109e3d317c6bd4db1903f449, not final-head receipts. Files ran individually through the repository wrapper with --maxWorkers=1 unless a combined scope is named. Times are measured wrapper wall; the topology and auth/config JSON receipts include the outer invocation, while the fixture/status logs report the wrapper's own wall. PR CI job durations remain separate and pending. The architecture receipt also verifies unchanged source hashes before/after its three focused test commands.

Test file / scope Observed result Wrapper wall (s)
src/secrets/runtime-state.clear.test.ts 2 passed 22.042
src/secrets/runtime-provider-and-media-surfaces.test.ts 22 passed 28.171
src/gateway/server-startup-config.secrets.test.ts 58 passed 31.515
src/gateway/server.auth.modes.test.ts 17 passed (17) 86.072
src/gateway/server-methods/config-write-flow.test.ts 10 passed (10) 31.665
src/gateway/server-methods/config.shared-auth.test.ts 23 passed (23) 34.159
src/gateway/server/ws-origin-policy.test.ts 11 passed (11) 42.122
extensions/google-meet/lazy-import.test.ts 4 passed 20.590
src/gateway/config-reload-plan.test.ts 26 passed 34.520
src/gateway/config-reload.operation-policy.test.ts 80 passed 16.980
src/transcripts/status.producer.test.ts 45 passed 69.480
src/transcripts/status.producer.shutdown.test.ts + status.occupancy.test.ts + status.provider-reload.test.ts 17 passed across 3 files 35.250

The HTTP table keeps passing full-file receipts and the later repaired media/response-authority receipts. It omits the superseded failing media rows from passing results. The two -t selections below deliberately excluded five and 156 cases respectively; those are filtered cases, not disabled tests or a claim that the full later file ran. Intermediate cookie receipts establish their measured revision only; the newer candidate completed its generation cutover before this final current-main integration. The completed local integration proof and remaining remote/CI checks are distinguished above.

Test file / scope Observed result Wrapper wall (s)
src/gateway/session-kill-http.test.ts — full file 17 passed (17) 16.489
src/agents/subagents/registry/subagent-control.concurrency.test.ts — selected caller-control cases 3 passed; 5 filtered (8 total) 25.543
src/gateway/http-byte-range.test.ts — full file 82 passed (82) 2.559
src/gateway/http-utils.authorize-request.test.ts — full file 17 passed (17) 17.672
src/gateway/control-ui.http.test.ts — full file 159 passed (159) 17.606
src/gateway/user-profiles-http.auth.test.ts — full file 16 passed (16) 23.485
src/gateway/user-profiles-http.test.ts — full file 22 passed (22) 12.761
src/gateway/user-profiles-http.gravatar.test.ts — full file 3 passed (3) 11.536
src/gateway/channel-avatar-http.test.ts — full file 14 passed (14) 23.684
src/gateway/workspace-icon-http.test.ts — full file 62 passed (62) 17.903
src/gateway/plugin-icon-http.test.ts — full file 86 passed (86) 15.504
src/gateway/managed-image-attachments.authority.test.ts — full file; later repair 6 passed (6) 67.985
src/gateway/managed-image-attachments.test.ts — full file; later repair 131 passed (131) 60.500
src/gateway/control-ui.response-authority.test.ts — full file; later repair 3 passed (3) 42.902
src/gateway/control-ui.http.test.ts — selected successful plugin-grant cases 3 passed; 156 filtered (159 total) 86.260
src/gateway/http-auth-utils.paired-device.test.ts — full file; later repair 2 passed (2) 49.721
src/gateway/control-ui-plugin-auth-cookie.test.ts — earlier cookie-policy revision 12 passed (12) 50.994
src/gateway/control-ui-plugin-assets.test.ts — earlier cookie-policy revision 24 passed (24) 28.857
src/gateway/server.plugin-frame-auth.test.ts — earlier cookie-policy revision 14 passed (14) 42.208
src/gateway/server/plugins-http.runtime-scopes.test.ts — earlier cookie-policy revision 25 passed (25) 37.410
src/gateway/control-ui.response-authority.test.ts — earlier cookie-policy revision 3 passed (3) 27.455
Standalone test costs and source provenance

Each row ran one file through the repository test wrapper with --maxWorkers=1; UI files used the owning UI configuration. Wrapper wall includes preparation and imports. Native test-case span measures from the first case start to the last case end, excluding setup before the first case and teardown afterward. Compiled-worker caches were reused sequentially where supported. These measurements are separate from PR CI job durations, which are pending.

The ledger combines 44 passing unchanged test inputs from source tree 606de21e2428dc522ca3422616116013445bb5b6 (carrier 163d8b7c29b23127ad6e1d7aa9cf6ecbb58f5455) with six repaired/current files measured on tree c97aa26ed92c8685986765630073ec14a7fe9fb9 (carrier 78b28ea81ea91ca10271ced17a68e48a8ae78b7b). Both runs recorded unchanged remote source. This is the measured test input history, not a claim that the final candidate is identical to those trees. The Testbox workflow identifies the remote environment; per-command exit codes and native reports determine the results.

Test file Passed / total Native test-case span (s) Wrapper wall (s)
extensions/acpx/register.runtime.test.ts 4 / 4 0.138 3.580
extensions/acpx/src/runtime-probe.test.ts 8 / 8 0.237 12.417
extensions/acpx/src/runtime.test.ts 79 / 79 0.604 38.145
extensions/acpx/src/service.test.ts 22 / 22 18.790 44.248
extensions/browser/src/browser/extension-relay/gateway-relay-route.test.ts 14 / 14 0.067 25.143
src/acp/control-plane/manager.runtime-handles.test.ts 22 / 22 0.097 22.511
src/agents/tools/transcripts-tool.account-ownership.test.ts 13 / 13 27.379 36.397
src/agents/tools/transcripts-tool.lifecycle.test.ts 42 / 42 21.707 68.510
src/agents/tools/transcripts-tool.selection.test.ts 21 / 21 14.047 24.288
src/agents/tools/transcripts-tool.session-id.test.ts 33 / 33 47.811 58.380
src/agents/tools/transcripts-tool.status.test.ts 3 / 3 3.429 14.283
src/agents/tools/transcripts-tool.test.ts 19 / 19 10.600 19.243
src/audit/audit-event-writer.test.ts 11 / 11 11.750 22.169
src/audit/audit-events.test.ts 50 / 50 6.466 14.756
src/gateway/config-reload.operation-policy.test.ts 80 / 80 0.485 15.242
src/gateway/config-reload.test.ts 485 / 485 13.484 34.828
src/gateway/config-reload.transcripts.test.ts 2 / 2 3.625 18.588
src/gateway/control-ui-assistant-media-policy.test.ts 43 / 43 1.587 24.991
src/gateway/desktop/attachment.test.ts 18 / 18 0.103 3.510
src/gateway/desktop/node-source.test.ts 12 / 12 0.166 3.642
src/gateway/embeddings-http.test.ts 43 / 43 7.890 66.602
src/gateway/http-endpoint-helpers.test.ts 8 / 8 0.104 4.428
src/gateway/openai-compatible-agent-run.test.ts 9 / 9 0.055 3.579
src/gateway/server-aux-handlers.test.ts 20 / 20 12.896 27.098
src/gateway/server-http.openai-compat.test.ts 34 / 34 2.995 13.200
src/gateway/server-plugin-in-process-dispatch.authorization.test.ts 39 / 39 3.847 15.841
src/gateway/server-plugin-in-process-dispatch.continuation.test.ts 8 / 8 3.575 23.801
src/gateway/server-plugin-reload.installed-package.test.ts 8 / 8 6.768 17.434
src/gateway/server-plugin-reload.recovery.test.ts 95 / 95 15.128 29.309
src/gateway/server-reload-handlers.test.ts 269 / 269 9.976 25.602
src/gateway/server-reload-managed-secrets.test.ts 4 / 4 0.038 11.473
src/gateway/server-runtime-subscriptions.test.ts 71 / 71 0.553 13.686
src/gateway/server-startup-post-attach.test.ts 116 / 116 6.146 19.704
src/gateway/server-startup-transcripts.test.ts 2 / 2 0.076 3.491
src/gateway/server.plugin-http-role-scopes.test.ts 9 / 9 1.032 13.374
src/gateway/server/ws-connection/authenticated-request-dispatch.mutation-authority.test.ts 12 / 12 0.858 10.514
src/gateway/server/ws-connection/connect-device-pairing.test.ts 11 / 11 25.717 43.017
src/gateway/server/ws-connection/message-handler.post-connect-health.test.ts 59 / 59 2.115 20.911
src/gateway/server/ws-origin-policy.test.ts 9 / 9 0.033 10.350
src/gateway/sessions-history-http.revocation.test.ts 31 / 31 1.108 11.662
src/gateway/tools-invoke-http.abort.test.ts 7 / 7 0.305 17.950
src/gateway/worker-environments/placement-idle-sweep.test.ts 19 / 19 1.257 14.220
src/meeting-bot/browser-act-lock.test.ts 4 / 4 0.101 4.193
src/meeting-bot/session-runtime.test.ts 16 / 16 3.729 13.582
src/secrets/runtime-state.clear.test.ts 2 / 2 0.036 7.718
src/secrets/runtime-state.test.ts 63 / 63 0.486 16.706
src/transcripts/capture-stop.test.ts 17 / 17 12.635 20.809
ui/src/e2e/cloud-workers-settings.e2e.test.ts 8 / 8 15.330 33.583
ui/src/pages/cloud-workers/cloud-worker-config.test.ts 62 / 62 0.015 3.550
ui/src/pages/cloud-workers/cloud-workers-page.test.ts 7 / 7 0.317 3.882
Cloud Worker settings before and after

Before:

Cloud Worker settings before

After:

Cloud Worker settings after

Meeting capture guidance before and after

Before:

Meeting capture guidance before

After:

Meeting capture guidance after

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime commands Command implementations agents Agent runtime and tooling extensions: acpx plugin: google-meet extensions: browser size: XL maintainer Maintainer-authored PR labels Sep 21, 2026
@steipete
steipete force-pushed the codex/settings-live-policy-integration branch from 8b48daf to 06b2033 Compare September 21, 2026 11:56
@steipete
steipete marked this pull request as ready for review September 21, 2026 11:56
@clawsweeper

clawsweeper Bot commented Sep 21, 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.

@github-actions

github-actions Bot commented Sep 21, 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: c54ef83dc51bde7047a6d47a158c1b196323b7c9
  • 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/http-auth-plugin-cookie.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/http-auth-utils.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/http-request-authority.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/http-utils.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/operator-role-policy.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/server-http.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-session.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.
  • src/secrets/runtime-provider-auth-activation.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/secrets/runtime-state.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/secrets/runtime.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.

Carefully review these changes before merging.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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 21, 2026
@clawsweeper

clawsweeper Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed September 21, 2026, 2:05 PM ET / 18:05 UTC (Revision 5).

ClawSweeper review

What this changes

Applies more Gateway settings live, preserves service and capture lifetimes, rechecks request authority before protected effects, and updates Settings guidance.

Merge readiness

⛔ Blocked before merge - 5 items remain

Keep open as useful, maintainer-owned work: current main’s Labs support covers only part of the requested behavior. The earlier code findings are repaired.

Priority: P2
Reviewed head: c54ef83dc51bde7047a6d47a158c1b196323b7c9

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful owner-level repairs and substantial validation remain limited by the unresolved authority composition proof.
Proof confidence 🦐 gold shrimp (3/6) Needs stronger real behavior proof before merge: Authority-chain proof required: the hash-matched body preserves useful real-Gateway policy and relay observations, and production bytes match the recorded 2dd4d65 run. The added media cases use mocked authorization/response boundaries, while HTTP cancellation mocks the effect owner and separate owner tests use synthetic run handles; allowed and revoked final effects remain unobserved through the composed production path. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: Authority-chain proof required: the hash-matched body preserves useful real-Gateway policy and relay observations, and production bytes match the recorded 2dd4d65 run. The added media cases use mocked authorization/response boundaries, while HTTP cancellation mocks the effect owner and separate owner tests use synthetic run handles; allowed and revoked final effects remain unobserved through the composed production path. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 11 items Pinned introduction and proof continuity: Inspected the merge-base-to-head production changes. The final commit changes only the plugin-approval test fixture, confirming that production evidence recorded for 2dd4d65 remains applicable to unchanged production bytes.
Complete captured body inspected: Fetched and read the complete 26,011 UTF-16-unit body; its SHA-256 matches captured source 27291665ff64a9205f627aa3d3b0573c74d5b8535b46046eb9dc4d4eb75fa218. It reports real Gateway policy and Browser relay replays, a published-updater test, and explicitly describes media/cancellation proof as separate compositional boundary tests.
Central work remains absent from main: Fetched main still limits desktop hot reload to desktop.host.enabled and cloudWorkers.desktop, and lacks this branch’s broader access-policy and transcript reload rules. The verified merged Labs change is partial overlap, not a replacement. The supplied latest-release object was unavailable locally, so no shipped-fix claim is made.
Findings None None.
Security None None.

How this fits together

The Gateway accepts configuration changes from Settings and CLI clients, then reconciles running services. Its request-authority checks determine whether authenticated clients may still receive protected data or perform actions after policy changes.

flowchart TD
  A[Settings and CLI] --> B[Configuration validation]
  B --> C{Reload policy}
  C --> D[Reconcile service owners]
  C --> E[Restart for listener changes]
  D --> F[Publish current access policy]
  F --> G[Recheck pending request authority]
  G --> H[Allow or reject protected effects]
Loading

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: Authority-chain proof required: the hash-matched body preserves useful real-Gateway policy and relay observations, and production bytes match the recorded 2dd4d65 run. The added media cases use mocked authorization/response boundaries, while HTTP cancellation mocks the effect owner and separate owner tests use synthetic run handles; allowed and revoked final effects remain unobserved through the composed production path. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - The composed HTTP authority handoff remains unproven for media disclosure and run cancellation when policy is revoked during preparation; separate mocked boundary tests do not establish rejection before those final effects.
  • Complete next step (P2) - Complete the existing media/cancellation authority proof with redacted terminal output, logs, or an artifact showing allowed effects and revocation before final I/O. Update the PR body to trigger review; if needed, ask a maintainer to comment @clawsweeper re-review.
  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

None.

Stored data model

Persistent data-model change detected: unknown-truncated-pull-files. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Complete the final-effect evidence (recommended)
    Provide source-bound observations through production HTTP admission and the real media/cancellation owners, showing allowed effects and rejection after revocation during preparation.

Technical review

Best possible solution:

Keep service-owned live reconciliation and request-bound revocation, with final-effect evidence covering both authorized requests and requests whose authority expires during preparation.

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

Yes, from source: current main’s reload rules still restart for several affected settings, and the prior authority gaps are visible in the introduced repairs. This read-only review did not execute a reproduction.

Is this the best way to solve the issue?

Yes, the existing reload and service owners are the appropriate repair boundary; the remaining concern is final-effect proof rather than a competing implementation or new configuration surface.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against b25f3d82963c.

Labels

Label justifications:

  • P2: This improves ordinary configuration changes and service continuity without evidence of a current emergency.
  • merge-risk: 🚨 security-boundary: Replacing restart-based policy retirement with live authority checks requires confidence that revoked requests cannot disclose media or cancel runs.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: Authority-chain proof required: the hash-matched body preserves useful real-Gateway policy and relay observations, and production bytes match the recorded 2dd4d65 run. The added media cases use mocked authorization/response boundaries, while HTTP cancellation mocks the effect owner and separate owner tests use synthetic run handles; allowed and revoked final effects remain unobserved through the composed production path. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

  • Pinned introduction and proof continuity: Inspected the merge-base-to-head production changes. The final commit changes only the plugin-approval test fixture, confirming that production evidence recorded for 2dd4d65 remains applicable to unchanged production bytes. (src/gateway/server-methods/plugin-approval.test.ts:153, c54ef83dc51b)
  • Complete captured body inspected: Fetched and read the complete 26,011 UTF-16-unit body; its SHA-256 matches captured source 27291665ff64a9205f627aa3d3b0573c74d5b8535b46046eb9dc4d4eb75fa218. It reports real Gateway policy and Browser relay replays, a published-updater test, and explicitly describes media/cancellation proof as separate compositional boundary tests. (c54ef83dc51b)
  • Central work remains absent from main: Fetched main still limits desktop hot reload to desktop.host.enabled and cloudWorkers.desktop, and lacks this branch’s broader access-policy and transcript reload rules. The verified merged Labs change is partial overlap, not a replacement. The supplied latest-release object was unavailable locally, so no shipped-fix claim is made. (src/gateway/config-reload-plan.ts:182, b25f3d82963c)
  • Earlier outgoing-media finding repaired: Managed outgoing media now checks captured request authority immediately before writing headers and streaming the verified descriptor; thumbnail and preparation responses also recheck authority after awaited work. (src/gateway/managed-image-attachments.ts:1803, c54ef83dc51b)
  • Earlier cancellation finding repaired: The HTTP kill handler passes requestAuth.assertCurrent into the production cancellation owner. That owner composes the guard with cancellation control and checks it before aborting the active run and clearing queues. (src/gateway/session-kill-http.ts:108, c54ef83dc51b)
  • Media proof has a remaining composition gap: The six revocation cases exercise the actual media handler, response guard, and filesystem descriptors, but replace HTTP authorization and transcript lookup. Their response is a PassThrough-based double from test-http-response.ts, rather than an authenticated client observing the production HTTP response. (src/gateway/managed-image-attachments.authority.test.ts:40, c54ef83dc51b)

Likely related people:

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

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add source-bound production observations showing authorized media delivery and cancellation, then rejection before those effects when authority is revoked during preparation; a bounded production-path harness is sufficient.

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 (4 earlier review cycles)
  • reviewed 2026-09-21T12:07:10.363Z sha 06b2033 :: needs real behavior proof before merge. :: [P1] [P1] Revalidate outgoing-media authority before serving bytes | [P1] [P1] Carry HTTP authority into subagent cancellation
  • reviewed 2026-09-21T14:34:27.948Z sha 16da3bf :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-21T16:11:23.288Z sha b91188f :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-21T16:46:50.627Z sha 6243368 :: needs real behavior proof before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Sep 21, 2026
@steipete
steipete force-pushed the codex/settings-live-policy-integration branch from 16da3bf to b91188f Compare September 21, 2026 15:15
@steipete steipete closed this Sep 21, 2026
@steipete steipete reopened this Sep 21, 2026
@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Sep 21, 2026
@openclaw-barnacle openclaw-barnacle Bot reopened this Sep 21, 2026
@steipete
steipete force-pushed the codex/settings-live-policy-integration branch from b91188f to 6243368 Compare September 21, 2026 16:38
@steipete
steipete merged commit 678cdf4 into main Sep 21, 2026
230 of 231 checks passed
@steipete
steipete deleted the codex/settings-live-policy-integration branch September 21, 2026 18:51
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 22, 2026
…54792)

* fix(gateway): apply settings without unnecessary restarts

Apply operation settings through their existing runtime owners, retire stale request authority, and retain accepted work through cleanup. Preserve current visitor grants and cancellation while consolidating desktop, secrets, transcript, and UI ownership.

* refactor(gateway): consolidate history and audit test wiring

* test(gateway): observe plugin approval response completion

Replace the plugin approval fixture's one-second polling deadline with
observation of the existing response callback. Keep acceptance, payload,
visibility, decision, and handler-settlement assertions intact. Worker-backed
registration can legitimately finish after the unrelated polling deadline.

The unchanged full file reproduced nine acceptance-wait failures out of 35
cases (341.72s). All nine affected cases passed with the repair. The repaired
full file passed 34/35 (462.81s); an untouched resolve case reported a SQLite
lock error without an operation stack. A bounded replay of that case and its
immediate predecessor passed 2/2 with 33 cases filtered (77.50s), so the lock
cause remains unestablished and is not claimed fixed.

The owning gateway-methods type graph (44.54s), typed lint (89.54s), formatting,
and diff checks passed. Independent review found no actionable P0-P2 findings.
No production code, retries, or timeout values changed.

Co-authored-by: Peter Steinberger <[email protected]>
@VACInc

VACInc commented Sep 27, 2026

Copy link
Copy Markdown
Member

Follow-up: #159939 has merged, fixing the overly broad identity-scope invalidation in this reload path. Verified WebSocket connections and accepted runs now survive changes to another login's grants, while changes to their own resolved grants still revoke authority. This is a focused follow-up to this PR's broader live-settings work, not a replacement for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui commands Command implementations docs Improvements or additions to documentation extensions: acpx extensions: browser gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. plugin: google-meet rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. security-sensitive-changed size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants