Repository navigation
perf(gateway): separate startup maintenance timing - #117577
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 3:55 PM ET / 19:55 UTC. ClawSweeper reviewWhat this changesSeparates channel, session, and pairing startup maintenance from plugin bootstrap so Gateway startup traces report Merge readinessThis PR is still necessary: current Priority: P3 Review scores
Verification
How this fits togetherGateway startup imports worker state, performs channel/session/pairing maintenance, then builds plugin runtime state and the Gateway method list before the server binds. Startup tracing measures these phases so performance work is assigned to the owner that actually consumes the time. flowchart LR
Config[Startup configuration] --> Bootstrap[Gateway bootstrap]
Bootstrap --> Maintenance[Channel session and pairing maintenance]
Maintenance --> TraceA[startup maintenance trace]
Maintenance --> Plugins[Plugin runtime bootstrap]
Plugins --> TraceB[plugin bootstrap trace]
Plugins --> Server[Gateway server ready]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +14, Tests +99. Total +113 across 3 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Land the focused owner-boundary split, retaining the dedicated maintenance span and its regression tests for ordering, recovered channel configuration, and minimal-Gateway behavior. Do we have a high-confidence way to reproduce the issue? Not applicable: this is an internal trace-attribution change, and the supplied exact-head hosted run directly reports the two resulting timing spans. Is this the best way to solve the issue? Yes. Extracting the existing maintenance block to a dedicated startup owner is the narrowest maintainable solution: measuring only around plugin bootstrap would retain the wrong attribution, while moving the work later would alter lifecycle behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 37e7307b0147. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles) |
|
Exact-head merge proof for
There is no persistent data-model change. The heuristic was triggered by migration references in the focused test; the patch changes no schema, storage shape, migration behavior, or persisted data. This resolves the remaining CI and merge-risk checklist item. The ordinary maintainer landing decision is accepted. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Current-main merge preparation is complete for exact head
This resolves the remaining current-base merge-risk and maintainer-decision items. @clawsweeper re-review |
|
Current-main merge preparation is complete again for exact head
This resolves the durable review's current-main merge-risk and maintainer-decision items. @clawsweeper re-review |
|
The stale review publisher has completed. Exact head remains @clawsweeper re-review |
|
The owning review workflow and publisher are complete, but the PR still has an orphaned active lease marker that blocks fresh durable publication. @clawsweeper stop |
|
🦞✅ I added |
|
The stale automation lease is now cleared. Please perform a fresh exact-head review of Current-main prepare and hosted gates pass, repository-native review artifacts have zero findings, the stored-data heuristic is confirmed false, and the maintainer merge decision is approved. @clawsweeper re-review |
|
The PR-scoped human-review pause is cleared. Please publish a fresh durable exact-head review for Current-main prepare and hosted gates pass, review artifacts contain zero findings, the stored-data heuristic is confirmed false, and the maintainer merge decision is approved. @clawsweeper re-review |
|
Exact-head merge proof for
There is no persistent data-model change. The heuristic was triggered by migration references in the focused test; the patch changes no schema, storage shape, migration behavior, or persisted data. This resolves the remaining CI and merge-risk checklist item. The ordinary maintainer landing decision is accepted. @clawsweeper re-review |
|
Merged via squash.
|
* commit '81e392b7ff43bcdb7a3be50a99adf65c3b0141b5': fix(channels): preserve filters in offline status diagnostics (#117570) perf(gateway): separate startup maintenance timing (#117577) refactor(tests): deduplicate database-first guard fixtures (#117594) fix(cli): align sessions cleanup label summary by visible width (#117459) perf(gateway): skip empty session reconciliation (#117589)
* commit '81e392b7ff43bcdb7a3be50a99adf65c3b0141b5': fix(channels): preserve filters in offline status diagnostics (#117570) perf(gateway): separate startup maintenance timing (#117577) refactor(tests): deduplicate database-first guard fixtures (#117594) fix(cli): align sessions cleanup label summary by visible width (#117459) perf(gateway): skip empty session reconciliation (#117589) refactor(ui): consolidate cron form control rendering (#117576) fix(memory): recover restored session freshness (#117548) fix(ui): preserve Talk transcript surrogate bounds fix(ui): harden Talk transcript marker bounds test(ui): cover bounded realtime Talk entries fix(ui): bound realtime Talk conversation text
* commit '81e392b7ff43bcdb7a3be50a99adf65c3b0141b5': fix(channels): preserve filters in offline status diagnostics (#117570) perf(gateway): separate startup maintenance timing (#117577) refactor(tests): deduplicate database-first guard fixtures (#117594) fix(cli): align sessions cleanup label summary by visible width (#117459) perf(gateway): skip empty session reconciliation (#117589)
* commit '58213dd5389737ff100c6286d110921defeb76e8': fix(channels): preserve filters in offline status diagnostics (openclaw#117570) perf(gateway): separate startup maintenance timing (openclaw#117577) refactor(tests): deduplicate database-first guard fixtures (openclaw#117594) fix(cli): align sessions cleanup label summary by visible width (openclaw#117459) perf(gateway): skip empty session reconciliation (openclaw#117589)
* origin/main: perf(gateway): separate startup maintenance timing (openclaw#117577) refactor(tests): deduplicate database-first guard fixtures (openclaw#117594) fix(cli): align sessions cleanup label summary by visible width (openclaw#117459) perf(gateway): skip empty session reconciliation (openclaw#117589)
* commit '58213dd5389737ff100c6286d110921defeb76e8': fix(channels): preserve filters in offline status diagnostics (openclaw#117570) perf(gateway): separate startup maintenance timing (openclaw#117577) refactor(tests): deduplicate database-first guard fixtures (openclaw#117594) fix(cli): align sessions cleanup label summary by visible width (openclaw#117459) perf(gateway): skip empty session reconciliation (openclaw#117589)
* commit '58213dd5389737ff100c6286d110921defeb76e8': fix(channels): preserve filters in offline status diagnostics (openclaw#117570) perf(gateway): separate startup maintenance timing (openclaw#117577) refactor(tests): deduplicate database-first guard fixtures (openclaw#117594) fix(cli): align sessions cleanup label summary by visible width (openclaw#117459) perf(gateway): skip empty session reconciliation (openclaw#117589) refactor(ui): consolidate cron form control rendering (openclaw#117576) fix(memory): recover restored session freshness (openclaw#117548) fix(ui): preserve Talk transcript surrogate bounds fix(ui): harden Talk transcript marker bounds test(ui): cover bounded realtime Talk entries fix(ui): bound realtime Talk conversation text
What Problem This Solves
The source-performance startup trace reports the full Gateway startup-maintenance interval as
plugins.bootstrap/plugins.load. Session, channel, and pairing maintenance therefore appears to be plugin-loading cost, which sends Kova follow-up work to the wrong owner.Why This Change Was Made
Run startup maintenance through its own exported owner and measure it as
startup.maintenancebefore the plugin-onlyplugins.bootstrapspan. The existing maintenance concurrency, minimal-Gateway behavior, and device-before-node migration order remain unchanged.User Impact
No product runtime behavior changes. Maintainers get accurate startup attribution, so future performance work can distinguish migration/maintenance cost from plugin loading.
Evidence
plugins.bootstrapat roughly281-301ms, while source inspection found the span also contained channel, session, and pairing maintenance.preparedRuntimeScaleMany:startup.maintenance=263.3ms, plugin-onlyplugins.bootstrap=33.8msfiftyStartupLazyPlugins:startup.maintenance=141.4ms, plugin-onlyplugins.bootstrap=52.7msnode scripts/run-vitest.mjs src/gateway/server-startup-plugins.test.ts src/gateway/server-startup-bootstrap.test.ts: 28/28 passed.oxfmt --check,oxlint, andgit diff --check: passed.