Repository navigation
improve: stress packaged SQLite upgrade migration - #125571
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
106436c to
0a71ec9
Compare
0a71ec9 to
67542de
Compare
|
Codex review: needs maintainer review before merge. Reviewed August 18, 2026, 12:16 AM ET / 04:16 UTC. ClawSweeper reviewWhat this changesAdds an opt-in high-volume packaged-upgrade scenario that verifies SQLite migration, archival, a second Doctor pass, and Gateway startup. Merge readinessKeep open: this maintainer-owned, protected PR adds a distinct current-main validation gap. No blocking defect was found; merge should wait for exact-head automation to finish. Priority: P2 Review scores
Verification
How this fits togetherThe published-upgrade survivor installs a released package, upgrades it to a candidate package in Docker, then verifies migrated state and Gateway readiness. The new scenario feeds large legacy session, transcript, cron, and configured-plugin datasets through that existing path. flowchart LR
A[Released package] --> B[Docker upgrade survivor]
B --> C[Seed legacy state]
C --> D[Doctor SQLite migration]
D --> E[SQLite and archive checks]
E --> F[Second Doctor pass]
F --> G[Gateway readiness and status]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +107, Docs +17, Other +668. Total +792 across 11 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the stress scenario opt-in under Do we have a high-confidence way to reproduce the issue? Not applicable as a bug report; the PR body supplies a concrete packaged Docker upgrade result for the new validation scenario. Is this the best way to solve the issue? Yes. It extends the existing published-upgrade survivor and keeps the costly case out of the regular release soak. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 90526f3a9c87. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Land-ready proof for reviewed head
No live provider/channel traffic, package publication, tag, or release was performed. |
|
Merged via squash.
|
Doctor lint loaded the broad Memory Core API barrel only to register health checks and read isolated check IDs. That synchronously pulled the full memory public graph into the first lint run, consuming most of the 120-second test budget. Load a dedicated doctor-health public artifact instead and verify it is packaged. The bisect boundary was 9de3ca5 (#125571); because that commit only adds upgrade-test assets, it exposed a pre-existing runner-sensitive cost rather than introducing the expensive import path.
Doctor lint loaded the broad Memory Core API barrel only to register health checks and read isolated check IDs. That synchronously pulled the full memory public graph into the first lint run, consuming most of the 120-second test budget. Load a dedicated doctor-health public artifact instead and verify it is packaged. The bisect boundary was 9de3ca5 (#125571); because that commit only adds upgrade-test assets, it exposed a pre-existing runner-sensitive cost rather than introducing the expensive import path.
Doctor lint loaded the broad Memory Core API barrel only to register health checks and read isolated check IDs. That synchronously pulled the full memory public graph into the first lint run, consuming most of the 120-second test budget. Load a dedicated doctor-health public artifact instead and verify it is packaged. The bisect boundary was 9de3ca5 (#125571); because that commit only adds upgrade-test assets, it exposed a pre-existing runner-sensitive cost rather than introducing the expensive import path.
Doctor lint loaded the broad Memory Core API barrel only to register health checks and read isolated check IDs. That synchronously pulled the full memory public graph into the first lint run, consuming most of the 120-second test budget. Load a dedicated doctor-health public artifact instead and verify it is packaged. The bisect boundary was 9de3ca5 (#125571); because that commit only adds upgrade-test assets, it exposed a pre-existing runner-sensitive cost rather than introducing the expensive import path.
…ors (#125492) * test(control-ui): add --operator-scopes flag to the mock dev server * feat(control-ui): simplified settings experience for non-admin operators Non-admin browsers previously saw every settings page, many of which dead-ended or rendered enabled controls whose RPCs fail with 'missing scope: operator.admin'. - config.schema drops from operator.admin to operator.read: the schema is a static document describing options whose values are already readable via read-scoped config.get; admin-only schema only broke read-only settings rendering (Automation/Infrastructure/AI Agents/Communications showed 'Schema unavailable. Use Raw.'). - Settings sidebar and settings search hide admin-only routes (custodian, labs, updates, automation, infrastructure, mcp, security, secrets, cloud-workers, communications, ai-agents, model-setup) for non-admin viewers; legacy gateways without advertised scopes keep the full UI. - Channels, Devices, Worktrees, Memory Import, Profile gate their mutation controls on actual scopes with 'Browsing only…' notices instead of enabled-but-failing buttons; Devices no longer fires device.pair.list / exec.approvals.get without the scopes to call them (kills the two red error callouts on page load). - Scope-upgrade banner: dismissing it in the guidance phase (no in-app upgrade path) now hides it fully instead of leaving a permanent chip. - Config write coordinator surfaces scope refusals as a visible admin-required error instead of silently resolving false. * test(control-ui): advertise config.schema in the mock dev gateway ensureSchemaLoaded now checks method advertisement + scope before loading the schema; the mock harness must advertise config.schema like a real gateway does or schema-driven settings pages render empty in the mock. * fix(control-ui): close the worktree create draft on scope downgrade * perf(doctor): isolate memory health artifact Doctor lint loaded the broad Memory Core API barrel only to register health checks and read isolated check IDs. That synchronously pulled the full memory public graph into the first lint run, consuming most of the 120-second test budget. Load a dedicated doctor-health public artifact instead and verify it is packaged. The bisect boundary was 9de3ca5 (#125571); because that commit only adds upgrade-test assets, it exposed a pre-existing runner-sensitive cost rather than introducing the expensive import path. * test(control-ui): restore device lifecycle test boundary * perf(control-ui): lazy-load settings sidebar * fix(ui): recheck access after confirmations * fix(control-ui): gate presence-driven device reloads on pairing access The presence connectivity-change path still called device.pair.list without operator.pairing, the same invariant the pair-event and poller paths already guard; a limited browser got a doomed RPC on every connectivity change. * fix(control-ui): fail open on schema loads for legacy scope-less gateways canCallGatewayMethod hardened to strict advertisement+scope checks (#125478), which made the new ensureSchemaLoaded gate silently skip config.schema for legacy hellos without advertised scopes or a method list. Schema loads now skip only on a definitive denial (method advertised absent, or advertised scopes without operator.read), reusing the fail-open hasOperatorReadAccess semantics the rest of the non-admin UI uses; regression test pins the legacy snapshot path. * test(control-ui): split schema-access coverage into its own file runtime-config-capability.test.ts crossed the max-lines cap; the legacy fail-open regression and its denial counterpart move to a colocated schema-access test file. * fix(scripts): keep mapped Vitest lanes at their measured no-output floor The codex extension shard legitimately works in silence beyond 300s under the default reporter (measured 61s import + 293s testing at ~95% CPU); the CI-wide OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=300000 env override shrank the lane below that and the watchdog killed healthy runs, flipping with incidental flake output (#125825). Per-config entries in VITEST_CONFIG_NO_OUTPUT_TIMEOUT_MS now act as measured silence floors: a global env value may widen a mapped lane's window but no longer shrinks it; unmapped configs and the explicit '0' disable keep env verbatim. Adds the codex extension lane to the map at the extra-long tier (same class as the discord entry from #123025).
…ors (openclaw#125492) * test(control-ui): add --operator-scopes flag to the mock dev server * feat(control-ui): simplified settings experience for non-admin operators Non-admin browsers previously saw every settings page, many of which dead-ended or rendered enabled controls whose RPCs fail with 'missing scope: operator.admin'. - config.schema drops from operator.admin to operator.read: the schema is a static document describing options whose values are already readable via read-scoped config.get; admin-only schema only broke read-only settings rendering (Automation/Infrastructure/AI Agents/Communications showed 'Schema unavailable. Use Raw.'). - Settings sidebar and settings search hide admin-only routes (custodian, labs, updates, automation, infrastructure, mcp, security, secrets, cloud-workers, communications, ai-agents, model-setup) for non-admin viewers; legacy gateways without advertised scopes keep the full UI. - Channels, Devices, Worktrees, Memory Import, Profile gate their mutation controls on actual scopes with 'Browsing only…' notices instead of enabled-but-failing buttons; Devices no longer fires device.pair.list / exec.approvals.get without the scopes to call them (kills the two red error callouts on page load). - Scope-upgrade banner: dismissing it in the guidance phase (no in-app upgrade path) now hides it fully instead of leaving a permanent chip. - Config write coordinator surfaces scope refusals as a visible admin-required error instead of silently resolving false. * test(control-ui): advertise config.schema in the mock dev gateway ensureSchemaLoaded now checks method advertisement + scope before loading the schema; the mock harness must advertise config.schema like a real gateway does or schema-driven settings pages render empty in the mock. * fix(control-ui): close the worktree create draft on scope downgrade * perf(doctor): isolate memory health artifact Doctor lint loaded the broad Memory Core API barrel only to register health checks and read isolated check IDs. That synchronously pulled the full memory public graph into the first lint run, consuming most of the 120-second test budget. Load a dedicated doctor-health public artifact instead and verify it is packaged. The bisect boundary was 76e459a (openclaw#125571); because that commit only adds upgrade-test assets, it exposed a pre-existing runner-sensitive cost rather than introducing the expensive import path. * test(control-ui): restore device lifecycle test boundary * perf(control-ui): lazy-load settings sidebar * fix(ui): recheck access after confirmations * fix(control-ui): gate presence-driven device reloads on pairing access The presence connectivity-change path still called device.pair.list without operator.pairing, the same invariant the pair-event and poller paths already guard; a limited browser got a doomed RPC on every connectivity change. * fix(control-ui): fail open on schema loads for legacy scope-less gateways canCallGatewayMethod hardened to strict advertisement+scope checks (openclaw#125478), which made the new ensureSchemaLoaded gate silently skip config.schema for legacy hellos without advertised scopes or a method list. Schema loads now skip only on a definitive denial (method advertised absent, or advertised scopes without operator.read), reusing the fail-open hasOperatorReadAccess semantics the rest of the non-admin UI uses; regression test pins the legacy snapshot path. * test(control-ui): split schema-access coverage into its own file runtime-config-capability.test.ts crossed the max-lines cap; the legacy fail-open regression and its denial counterpart move to a colocated schema-access test file. * fix(scripts): keep mapped Vitest lanes at their measured no-output floor The codex extension shard legitimately works in silence beyond 300s under the default reporter (measured 61s import + 293s testing at ~95% CPU); the CI-wide OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=300000 env override shrank the lane below that and the watchdog killed healthy runs, flipping with incidental flake output (openclaw#125825). Per-config entries in VITEST_CONFIG_NO_OUTPUT_TIMEOUT_MS now act as measured silence floors: a global env value may widen a mapped lane's window but no longer shrinks it; unmapped configs and the explicit '0' disable keep env verbatim. Adds the codex extension lane to the map at the extra-long tier (same class as the discord entry from openclaw#123025).
What Problem This Solves
OpenClaw's packaged stable-to-current upgrade path did not have a repeatable stress lane proving that a realistically busy, heavily configured installation preserves large legacy session/transcript and cron datasets while moving them into SQLite. Small fixtures could miss data loss, archive mistakes, non-idempotent Doctor behavior, and performance regressions that emerge only with thousands of files and jobs.
Why This Change Was Made
This adds an opt-in
sqlite-volumepublished-upgrade survivor that composes the existing configured-plugin/channel setup with two agents, exotic session identifiers, configurable session/event/cron volume, exact SQLite and migration-archive assertions, a timed second Doctor pass, and normal Gateway readiness/status checks. It is included only infar-reaching, not the regularreported-issuesrelease soak. The harness also reserves a dedicated output descriptor so signal-trap summaries cannot corrupt command artifacts such asupdate.json.Runtime production LOC is unchanged. Harness/tooling: +701/-33; tests: +110/-3; docs: +20/-3.
AI-assisted: yes. I reviewed the implementation and its exercised migration/archive contracts.
User Impact
Maintainers can now reproduce and scale a sophisticated stable-to-current upgrade from one checked-in lane, with exact proof that sessions, transcript events, crawl jobs, configured plugins/channels, archives, and Gateway startup survive. Regular release soak cost is unchanged unless
far-reachingis explicitly selected.Evidence
3ee48ebe9786139140f8488027004f5118c73704ac4689078cabf8d8f44630f4.[email protected]to current2026.8.1: all 31 phases passed with 25,000 sessions, 298,644 imported transcript events, and 12,000 cron crawl jobs. Exact SQLite contents, WAL/integrity/FK/reopen checks, referenced and orphan transcript archives, archived legacy stores, and cron archive contents passed twice. Migration took 76s, idempotent Doctor 75s, Gateway startup 22s, readiness 21s, and status 3s. No survivor container remained.update.jsonparsed as valid JSON and contained no summary-marker contamination.node scripts/check-changed.mjspassed all selected formatting, script/test-root typecheck, Oxlint, Docker E2E boundary, dependency, and guard checks.published-upgrade-survivor-2026.7.1-2-sqlite-volumelane forfar-reaching.git diff --checkpassed.openclaw/ci-gate.