Repository navigation
refactor(gateway): schedule auth pruning with the runtime owner - #159455
Merged
Merged
Conversation
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Contributor
|
steipete
enabled auto-merge (squash)
September 27, 2026 05:44
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Sep 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
Authentication rate-limit pruning previously owned separate periodic timers for each limiter.
Require an explicit scheduler and stable id for internal limiters. The Gateway supplies its kernel scheduler; the shipped public SDK factory borrows the bound host, or explicitly creates and closes a standalone scheduler through dispose. Preserve failed-attempt policy, penalties and request-scoped waits.
The invariant is one scheduler instance per Gateway process: kernel composition supplies it, and required internal scheduler dependencies prevent silently creating private owners. Shipped SDK facades resolve the bound host; standalone entry points visibly own creation and stop.
Deleted: Private pruning intervals and direct timer-based fixtures are removed.
User Impact and Update Behavior
Update behavior: Existing authentication, signatures, proxy attribution, ports, and configuration remain unchanged. No store or schema migration. Public SDK factory parameters remain source-compatible; internal construction requires the scheduler. Disposed resources close their pruning job with their existing dispose operation.
LOC: production +124/−36/net +88; tests +645/−519/net +126; docs +0/−0/net +0. These atomic constructor/caller closures include test migrations; growth is reported directly, without splitting off unused intermediate wiring.
Evidence
Historical focused proof: provider
blacksmith-testbox, leasetbx_01m3fqja9r983kwbphpb3v3g5g, run 36270738491; 34 passing file executions / 682 case executions / 522.116 s wall. These source-pinned receipts cover the reviewed composition; they are not claims that the refreshed publication head ran remotely. Each row usedpnpm test <file> --maxWorkers=1, after frozen install.Focused test cost and source identity
src/gateway/auth-rate-limit.test.ts4989a9c05916src/gateway/auth.test.ts4989a9c05916src/gateway/control-ui.http.test.ts536c02d99c4fsrc/gateway/node-reapproval-coordinator.test.ts536c02d99c4fsrc/gateway/rate-limit-attempt-serialization.test.ts536c02d99c4fsrc/gateway/server-http.device-pairing-ingress.test.ts536c02d99c4fsrc/gateway/server-http.hooks-delivery.test.ts536c02d99c4fsrc/gateway/server-http.node-workspace-transfer.test.ts536c02d99c4fsrc/gateway/server-runtime-state.tailscale.test.ts536c02d99c4fsrc/gateway/server.plugin-node-capability-auth.test.ts536c02d99c4fsrc/gateway/server.public-worker-ingress.test.ts536c02d99c4fsrc/gateway/server/hooks-request-handler.fanout.test.ts536c02d99c4fsrc/gateway/server/hooks.agent-trust.test.ts536c02d99c4fsrc/gateway/server/hooks.background-admission.test.ts536c02d99c4fsrc/gateway/server/hooks.early-failure.test.ts536c02d99c4fsrc/gateway/server/hooks.terminal-target.test.ts536c02d99c4fsrc/gateway/server/ws-connection.startup.test.ts536c02d99c4fsrc/gateway/server/ws-connection/auth-context.state.test.ts536c02d99c4fsrc/gateway/server/ws-connection/auth-context.test.ts536c02d99c4fsrc/gateway/user-profiles-http.auth.test.ts536c02d99c4fsrc/gateway/watch-node-http.test.ts536c02d99c4fsrc/gateway/worker-environments/worker-bootstrap-artifact-transfer.test.ts536c02d99c4fsrc/plugin-sdk/webhook-ingress.test.ts536c02d99c4fsrc/gateway/server-http.hooks-request-timeout.test.ts536c02d99c4fsrc/gateway/server.plugin-http-auth.test.ts536c02d99c4fsrc/gateway/server-close.test.ts536c02d99c4fsrc/gateway/server-close.cleanup-scope.test.ts536c02d99c4fsrc/gateway/test-helpers.listener.test.ts536c02d99c4fextensions/diffs/src/http.test.ts536c02d99c4fextensions/nextcloud-talk/src/monitor.limiter-lifecycle.test.ts536c02d99c4fextensions/nextcloud-talk/src/monitor.preauth-inflight.test.ts536c02d99c4fextensions/nextcloud-talk/src/monitor-runtime.abort.test.ts536c02d99c4fextensions/nextcloud-talk/src/monitor.durable-ack.test.ts536c02d99c4fextensions/nextcloud-talk/src/monitor.replay.test.ts536c02d99c4fCurrent-composition refresh: provider
blacksmith-testbox, leasetbx_01m3fz4ar9ygxxkxh5y2qjc40x, run 36278033418. Changed source remains byte-identical except preservation of main’s proxy-capture finalizer. Refreshed focused results:src/gateway/control-ui.http.test.tssrc/plugin-sdk/webhook-ingress.test.tsThe same current composition passed full
pnpm build(326.589 s),pnpm plugin-sdk:api:diff --base 0e27650f8e89afa47a839182e8018e5fb9382ce3 --head e06a34e17bceaaca9f04c5af68f4a52f7f84defe(130.200 s), export/surface/import guards, scoped docs sanity, and the existing MCP UI fixture (2 cases, 64.325 s). The isolated import profiler covered 19 packaged SDK consumers (6.229 s) plus three source-only QA consumers (0.918 s). The initial profiler command incorrectly selected private, non-packagedqa-laband was rejected before import; the corrected routes preserve coverage. All source was verified, and no suite/build ran locally.SDK API acknowledgement: digest
5e457d84reports 125 affected exports (124 reachable, one signature-text change), with no added or removed entrypoints.startDiagnosticHeartbeatkeeps the same optional config/options types throughParameters<...>[1]/[2]; its internal scheduler parameter is not part of the public call. PubliccreateAuthRateLimiterretains its name, parameters and return contract; its declaration now belongs to the wrapper instead of the aliased internal constructor. The remaining reachable diff addsreadonlyto three synthesizedreason?: undefinedfields in recovery unions whose source is byte-identical. This is a nonempty declaration/reachability diff, with no public contract migration required.Deslop and independent Codex review completed with no accepted/actionable findings. Rejected hypothetical findings retain source-backed dispositions. Required GitHub
openclaw/ci-gatevalidates the exact published head; final Gateway/cron/SIGSTOP/SIGCONT/restart/SIGTERM proof follows the final stack slice.Stack
Earlier slices include kernel scheduler #158423, session delivery #159275, update watcher #159291, and update campaign #159306. This slice follows diagnostic/CLI/SDK lifetime #159389. MCP fixtures #159372 and CLI settlement #159421 landed independently. Next: MCP scheduler cutover, then final timer census and docs. Earlier full stack links appear in predecessor PRs.
Merged scheduler slices
Publication head
28b8ad301754382beb3392756de6d12a07d656bd, based on fresh main3b9ca80b7309b40117a9d95abcbc8ccd4c1ac3c3after diagnostics merged. The exact reviewed/proved patch ID is unchanged. Complete-tree signature searches found no new internal callers requiring adaptation; newer main cleanup context is preserved.