Skip to content

fix(ui): keep usage helpers out of chat startup - #132140

Merged
steipete merged 2 commits into
mainfrom
codex/qa-ui-startup-budget-20260828
Aug 28, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/qa-ui-startup-budget-20260828

Conversation

@steipete

@steipete steipete commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Related: #121497. Investigated from the shared build failure observed in #132102, #132105 and #132115; does not change those fixes.

What Problem This Solves

Fixes an issue where developers cannot complete the normal CI/build workflow because Control UI startup JavaScript exceeds its existing gzip limit. The optional Usage request helpers are eagerly included even when the operator opens Chat.

Why This Change Was Made

Keep Usage request assembly behind the Usage route's existing asynchronous loader, following the Model Providers route's established pattern. Capture Gateway and query provenance before the import, retain the disconnected short circuit and existing error handling, and import request helpers directly from their owner in the three off-default consumers. Remove the obsolete eager sessions-barrel reexports.

Both eager edges must be removed: changing only the barrel leaves the route's static snapshot import in the startup graph. The old boot manifest also needs regeneration without its own grouping, or its stale entries pull the newly lazy modules back into Chat's downloaded chunks. The generator now builds a temporary capture bundle with only that old boot group omitted, records actual Chat readiness, writes the generated manifest, and closes/removes its owned resources. Final production grouping and execution-order settings are unchanged.

The fix preserves all usage RPC shapes, lifecycle ownership, request/error results, and page rendering. No new loader abstraction, fallback, configuration option, dependency or storage change. No budget, baseline, chunk-size setting, tolerance or retry is changed. Runtime production LOC +7/-12 (net -5); tooling +58/-25 (net +33) owns fresh isolated capture and cleanup; generated manifest +46/-29; two comment lines and one guide paragraph updated. No test-only production seam.

Source attribution: the eager usage barrel predates this regression (65e1232, 2026-07-04, code author Shakker). #132064 expanded the reachable helpers for on-demand context details (code author, PR author and merger @steipete, d9f3d88, 2026-08-28). The observed overrun is cumulative startup growth, not a claim that this one feature alone caused it. Removing functionality or byte-golfing feedback is unnecessary when the optional owner can remain lazy.

User Impact

Chat startup no longer downloads Usage-only RPC assembly. Usage and Model Providers retain their existing behavior when opened. There is no visual/layout change. This is the release-note context.

Evidence

CI recovery: the first hosted run passed the build/UI lanes but failed one pre-cancellation checkpoint in bash-tools.exec-host-node.cancellation.test.ts. That fixture polled for its second policy call under Vitest's default one-second wait, although real preparation may still be loading the local Bash parser. The canonical repair independently landed in #132038: wait on the owned policy-entry deferred, raced against the original result so early errors surface, preserving the cancellation reason, no-dispatch checks, cleanup, test deadline and production policy. This PR refreshes onto that fix and does not duplicate its test edit.

A temporary 1.2-second delay around the real parser initializer reproduced the original failure (one failed, three passed); equivalent repaired synchronization passed all four cases with the same modeled delay and normally. The temporary diagnostic and duplicate local repair were discarded in favor of #132038. This proves susceptibility to slow initialization; the original CI log cannot identify its exact delayed phase or swallowed preparation error. The fixture uses mocked node discovery/Gateway transport and local filesystem/WASM analysis, not native command execution. Provenance: #131717 introduced real preparation into this test while retaining the polling checkpoint.

Actual canonical production build on unchanged main 04f6630 failed at 347,454 startup gzip bytes against the unchanged 347,037-byte enforcement limit. With this patch it passes at 346,847 bytes (607 bytes lower), still eight startup JS requests. Source maps confirm all three optional owners are absent from initial chunks. Finalized asset sidecars and the remaining size limits pass.

During verification, #132020 independently landed a 347,255-byte baseline on main. This PR does not edit that baseline or claim its CI recovery: the measured reduction above is an exact same-base comparison against the earlier, stricter limit. It removes unnecessary startup work rather than making another ratchet change.

The existing performance gate is executable RED/GREEN regression proof; no implementation-coupled source-grep test is added. All 54 existing tests across seven Usage route/provenance, request, detail/export, and Model Providers files pass. All 12 Chromium/mock-Gateway browser cases across Usage cost analysis and Model Providers usage outcomes pass, with the test wrapper exiting successfully. Isolated Codex review reports no accepted/actionable findings.

The original five-path changed-file gate passes, including test/UI typechecking, lint, export checks and the default architecture guards. A separate canonical-production-bundle recorder passes four observable flows: default Chat boot/send/final, opening Usage with canonical RPC parameters and visible results, visible Usage request failure, and Model Providers entry/error. Its original filename-only network inference was insufficient: the named lazy entry chunks arrived later, but their implementations remained in shared boot chunks. The stronger source-map proof and complete correction are below. Browser and preview cleanup verified; no page errors.

Recorder-only recovery: the first attempt used a mismatched synthetic build identity and Playwright's unavailable remote-video path() API. The fixture was corrected to the actual built artifact identity and the documented saveAs() API; one corrected run passed all assertions. No product change, timeout increase or assertion relaxation was needed.

Dependency contract inspected: @openclaw/uirouter 0.1.1 starts async loaders and components together and fences stale publication; the preserved pre-await snapshot is covered by the existing route-provenance test. Browser proof uses synthetic fixtures, not authenticated provider/Gateway traffic. Exact-head hosted CI and the native prepare/merge workflow remain required before landing.

The full canonical build also passes after commit (346,850 startup gzip bytes against the original 347,037-byte limit; the three-byte metadata/hash variation does not affect the result).

Refreshed head 7d48fe29b63649d5f52c5d9fa46c99888b987677 incorporates canonical main through #132038; range-diff confirms the five-file UI patch is unchanged. All 58 focused tests pass (54 Usage/Model Providers plus the canonical four-case cancellation fixture). The refreshed production UI build passes at 344,757 startup gzip bytes; that total includes other main changes and is not attributed entirely to this PR. The same-base 607-byte comparison remains the isolated measurement above.

All 12 bundled Chromium browser cases passed again on that refreshed head. CI33215504527 succeeded, but does not cover the subsequent accepted review correction below.

Accepted boot-manifest review correction

ClawSweeper's boot-manifest finding and Rank-up move are addressed. On the refreshed production bundle, joining every Chat-ready JS request to its source-map modules fails for all three Usage owners inside shared boot chunks. That is stronger evidence than either the initial-byte gate or chunk filenames. The generator itself caused a feedback loop by recording already-grouped dist; this dates to #128514 (8fe2c1b, 2026-08-24; code author, PR author and merger @steipete).

The repaired canonical generator measures a temporary bundle with the old boot group omitted. It directly replaces the group list through the documented output-options hook, avoiding Vite array merging and preserving ordinary dynamic splitting. Two complete generator runs yield byte-identical output, remove all three Usage owners, and clean up their temporary builds. No hand-edited manifest membership.

After a normal grouped rebuild, the same browser/source-map assertion passes: all three modules are absent from every Chat-fetched chunk and present after Usage entry. The four real Chromium/mock-Gateway flows pass, with zero page errors and verified process/preview cleanup. The normal production build passes at 344,910 startup gzip bytes against the unchanged inherited 349,025-byte limit. That total includes independent main changes; it does not replace the original same-base 607-byte initial-bundle comparison.

All 12 bundled browser cases pass with the regenerated manifest. Isolated Codex review of the generator correction reports no actionable findings. The nine-path changed-file gate passed every stage except a shadowed callback name in the new cleanup code; that callback was renamed, then the complete scripts lint stage, script typecheck, formatting and generator were rerun successfully. The generator still produces identical output. Final isolated review is clean. New exact-head hosted CI and native prepare/merge remain required before landing. Existing executable generation/build/browser proof covers the actual defect; no source-grep test or production test seam is added.

Final published source: 06d283e6383. The three review-requested route/provenance/chunking files pass on this commit (14 tests). Exact-head CI33216943737 completed successfully. Native review artifacts validated and preparation passed without changing the tested head. The latest ClawSweeper review at 22:38 UTC reviewed this exact commit, confirmed the prior finding resolved, and reported no actionable findings. Its missing installed dependency source was a reviewer limitation; the lead directly inspected the installed Rolldown output-options/group contracts and executed the generator/build/browser proofs above.

Recorded flow on the original five-file patched production bundle, before opening Usage and after entry. These show preserved behavior, not a visual before/after redesign; the actual before/after size comparison is above. The stronger final manifest/source-map proof described above was recorded separately.

Chat before opening Usage, with a completed synthetic turn

Usage after entry, displaying the synthetic result

@clawsweeper

clawsweeper Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: XS maintainer Maintainer-authored PR labels Aug 28, 2026
@steipete steipete self-assigned this Aug 28, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 Aug 28, 2026
@clawsweeper

clawsweeper Bot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 28, 2026, 6:38 PM ET / 22:38 UTC.

ClawSweeper review

What this changes

The PR lazily loads Usage-page request assembly and regenerates the Control UI boot manifest from an isolated build that omits the prior boot grouping.

Regression provenance

Possible regression — probable (reviewed change; known regression link). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

No blocking defect found in the introduced patch. The previous manifest-feedback finding is addressed; this maintainer-owned PR remains open for normal exact-head CI and merge handling.

Priority: P2
Reviewed head: 06d283e6383dbaa3e1a2b10300e94dd652ab58d0

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is a focused, net-negative runtime repair that addresses the prior manifest finding and preserves the existing route result paths.
Proof confidence 🌊 off-meta tidepool Not applicable: The PR is maintainer-owned, so the external-contributor proof gate does not apply; its body nevertheless records source-map-aware Chromium and production-build evidence for the changed Chat and Usage paths.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The PR is maintainer-owned, so the external-contributor proof gate does not apply; its body nevertheless records source-map-aware Chromium and production-build evidence for the changed Chat and Usage paths.
Evidence reviewed 6 items Current-main behavior: Current main statically imports the Usage request snapshot, placing its helper closure in the route module before the PR's lazy boundary.
Introduced lazy boundary: The PR preserves the connected/disconnected and error-result paths, but imports request assembly only after the Usage route loader starts.
Manifest correction: The generated manifest retains the route module but no longer lists the Usage request snapshot, matching the intended separation between route availability and request assembly.
Findings None None.
Security None None.

How this fits together

Control UI Chat is the default startup route, while Usage is an optional route that requests session and provider data only when opened. The boot manifest records Chat-fetched modules so production chunking can consolidate startup code without pulling optional Usage helpers back into Chat.

flowchart LR
  A[Chat startup] --> B[Usage route module]
  B --> C{Usage opened}
  C -->|Yes| D[Usage request helpers]
  C -->|No| E[Chat remains ready]
  F[Isolated boot capture] --> G[Boot module manifest]
  G --> H[Production chunk grouping]
Loading

Before merge

  • Resolve merge risk (P1) - The exact-head CI run is still in progress, and the local checkout lacks installed dependency source for an independent Vite hook-contract check; this is a reviewer limitation, not missing contributor proof.
  • Complete next step (P2) - No repair lane is needed; the prior blocker is resolved and the remaining gate is ordinary exact-head CI and maintainer merge handling.
Agent review details

Security

None.

PR surface

Source +12, Docs 0, Other +33. Total +45 across 9 files.

View PR surface stats
Area Files Added Removed Net
Source 7 55 43 +12
Tests 0 0 0 0
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 58 25 +33
Total 9 114 69 +45

Review metrics

Metric Value Why it matters
Production versus generated delta UI production +7/-12; tooling +58/-25; generated manifest +46/-29; tests 0 The runtime change is net-negative; most added lines make the generated startup-module measurement independent of its previous grouping.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Retain the direct owner imports and isolated manifest capture, then land only after the exact-head build verifies the generated manifest and normal grouped output.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Retain the direct owner imports and isolated manifest capture, then land only after the exact-head build verifies the generated manifest and normal grouped output.

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

Yes—current main’s static request-snapshot import and the PR’s loader-local dynamic import establish the startup reachability change from source; the submitted build/browser evidence supplies the recorded runtime scenario.

Is this the best way to solve the issue?

Yes—the direct owner imports remove the eager barrel edge, and the loader-local dynamic import is the narrow canonical boundary; the regenerated manifest corrects the separate grouping feedback path.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The PR is maintainer-owned, so the external-contributor proof gate does not apply; its body nevertheless records source-map-aware Chromium and production-build evidence for the changed Chat and Usage paths.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This is a bounded Control UI startup-budget repair without evidence of an active operator outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The PR is maintainer-owned, so the external-contributor proof gate does not apply; its body nevertheless records source-map-aware Chromium and production-build evidence for the changed Chat and Usage paths.

Evidence

What I checked:

  • Current-main behavior: Current main statically imports the Usage request snapshot, placing its helper closure in the route module before the PR's lazy boundary. (ui/src/pages/usage/route.ts:8, a920626fc6d4)
  • Introduced lazy boundary: The PR preserves the connected/disconnected and error-result paths, but imports request assembly only after the Usage route loader starts. (ui/src/pages/usage/route.ts:50, 7d48fe29b636)
  • Manifest correction: The generated manifest retains the route module but no longer lists the Usage request snapshot, matching the intended separation between route availability and request assembly. (ui/config/control-ui-boot-modules.json:1764, 06d283e6383d)
  • Generator owner boundary: The new generator builds to an OS temporary directory, removes only the boot group for measurement, closes its local server, and deletes that owned directory afterward. (scripts/control-ui-boot-manifest.mts:120, 06d283e6383d)
  • Existing route coverage: The existing route tests exercise provider-usage failure preservation and redacted loader errors through the exported page loader. (ui/src/pages/usage/route.test.ts:8, 06d283e6383d)
  • Current-main-only status: The PR head is not contained by a local release tag or main branch; it is an open, unshipped change rather than work already implemented on main. (06d283e6383d)

Likely related people:

  • steipete: Authored the merged Usage performance work and the introduced lazy-boundary and manifest-generator commits. (role: recent feature and chunking owner; confidence: high; commits: d9f3d8840935, 7d48fe29b636, 06d283e6383d; files: ui/src/pages/usage/route.ts, scripts/control-ui-boot-manifest.mts, ui/config/control-ui-boot-modules.json)
  • vyctorbrzezowski: Current-main blame attributes the preexisting Usage loader flow around the new import boundary to this contributor. (role: adjacent route owner; confidence: medium; commits: a1782855a25a; files: ui/src/pages/usage/route.ts)

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 (2 earlier review cycles)
  • reviewed 2026-08-28T21:51:07.833Z sha effc014 :: found issues before merge. :: [P1] Regenerate the boot manifest for the new lazy Usage module
  • reviewed 2026-08-28T22:18:37.979Z sha 7d48fe2 :: needs changes before merge. :: [P1] Regenerate the boot manifest for the lazy Usage module

@steipete
steipete force-pushed the codex/qa-ui-startup-budget-20260828 branch from effc014 to 7d48fe2 Compare August 28, 2026 22:07
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 28, 2026
@steipete

steipete commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor Author

Accepted the boot-manifest finding and its Rank-up move. The earlier evidence proved that the static initial bundle shrank, but checking only the names of later network requests did not prove that Usage code was absent from shared boot chunks. I strengthened the canonical-dist browser probe to join every Chat-ready JavaScript request to its source-map modules. On head 7d48fe2 it fails for all three Usage owners inside two downloaded boot chunks. The four visible Chat/Usage/Model Providers flows still pass, so this is specifically an incomplete lazy boundary.

Regenerating from the already-grouped bundle would feed those stale modules straight back into the manifest. The correction now makes the generator build a private temporary capture bundle with only the previous boot group omitted, preserving the other groups and execution-order settings. It captures real Chat readiness, generates the manifest, closes its browser/server and removes its temporary output. Normal production builds retain the canonical recursive boot grouping. There is no new configuration option, budget increase or hand-edited generated membership.

Two generator runs produce byte-identical output and remove all three Usage owners. After a normal grouped rebuild, the exact same stronger browser assertion passes: none of those modules is in any Chat-fetched chunk, and all appear after Usage entry. Chat send/final, Usage data/error, and Model Providers error flows pass with zero page errors. The production build passes at 344,910 startup gzip bytes against the unchanged inherited 349,025-byte limit. This replaces the earlier filename-only boot claim; the original same-base 607-byte static-initial reduction remains a separate valid measurement.

The generator flaw dates to #128514 (8fe2c1b, 2026-08-24; code author, PR author and merger @steipete). Its old capture consumed already-grouped dist. The complete correction is now published as 06d283e6383. All 12 browser cases pass. The full changed-file gate passed all stages except a callback-shadowing lint error; the callback was renamed and the full scripts lint stage, scripts typecheck, format check and generator rerun successfully. Final isolated review is clean. The three review-requested route/provenance/chunking test files also pass on the committed head (14 tests).

Current main through 855346b was directly inspected; the repaired owners were not superseded. The latest review's generated-manifest correction, preserved exact-source behavior evidence and Rank-up request are all addressed. CI33216943737 is running for exact source 06d283e; native review artifacts are refreshed and validated. The earlier green run on 7d48fe2 is not being used as landing evidence for this correction.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: S and removed size: XS labels Aug 28, 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: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 28, 2026
@steipete
steipete merged commit 486d075 into main Aug 28, 2026
182 checks passed
@steipete
steipete deleted the codex/qa-ui-startup-budget-20260828 branch August 28, 2026 22:43
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Aug 28, 2026
* fix(ui): keep usage helpers out of chat startup

* fix(ui): measure boot manifest without stale grouping
steipete added a commit that referenced this pull request Aug 29, 2026
Preserve main's canonical lazy Usage loading and check the router, transport epoch, and selected agent after the deferred import. Carry the existing route signal to all aggregate requests so obsolete navigation does not start new RPCs or retain client waits. Keep independent preload lifetime intact.

Consolidate pending results to absorb the ownership checks with a net reduction of one production line. Real router/Gateway/selection regressions fail before the fix and pass afterward. Browser Back during a held service-worker fetch starts three obsolete Usage requests before the fix and none afterward; a fresh Usage visit still loads normally. This does not claim cancellation of server work already sent.

Refs: #131503 (CLI startup preparation and integration repair)
Related: #132140 (canonical Usage startup loading)
steipete added a commit that referenced this pull request Aug 29, 2026
Preserve main's canonical lazy Usage loading and check the router, transport epoch, and selected agent after the deferred import. Carry the existing route signal to all aggregate requests so obsolete navigation does not start new RPCs or retain client waits. Keep independent preload lifetime intact.

Consolidate pending results to absorb the ownership checks with a net reduction of one production line. Real router/Gateway/selection regressions fail before the fix and pass afterward. Browser Back during a held service-worker fetch starts three obsolete Usage requests before the fix and none afterward; a fresh Usage visit still loads normally. This does not claim cancellation of server work already sent.

Refs: #131503 (CLI startup preparation and integration repair)
Related: #132140 (canonical Usage startup loading)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 29, 2026
* fix(ui): keep usage helpers out of chat startup

* fix(ui): measure boot manifest without stale grouping
steipete added a commit that referenced this pull request Aug 29, 2026
* fix(cli): retain invocation-owned plugin startup facts

Bind non-Gateway CLI work to one operation PluginCache while closing preparation authority before actions. Preserve selected-workspace execution and config-wide validation.

Defer the config writer, broad runtime state, and complete SDK aliases until demanded; keep late CJS and ESM actions in their creating cache. Rebuild the startup-only fix on the canonical progressive plugin cache without restoring superseded metadata and cache layers.

Startup split from the standalone relay investigation in #128379; updates #131503.

* fix(doctor): preserve registry scope across metadata refreshes

Give explicit post-lease and post-mutation reads a fresh metadata generation without retiring the invoking CLI or Gateway owner. Persist the original workspace index while retaining the complete config-wide validation view.

Bind rebased snapshots to their creating cache so later consumers cannot borrow a stale or foreign generation. Replace mocked persistence assertions with real scoped-index, lease, checkpoint, schema and provenance regressions.

Follow-up to the installed startup verification for #131503.

* fix(cli): defer MCP serving and stabilize startup checks

Load the existing channel MCP server only for the serve action, and use the already-eager client-runtime import for reload. Registration and probes no longer evaluate the unused serving owner.

Initialize the config CLI runtime capture before hoisted mocks. Give the real Doctor checkpoint fixture explicit build provenance and verify durable rows for successful, interrupted, and unidentified builds without changing runtime checkpoint policy. Remove duplicate fixture initialization and avoid dumping captured environments on rejection failures.

Refs: #131503 (CLI startup preparation)

* test(plugins): follow runtime load context module split

Import the canonical runtime context resolver from its new owning module in the CLI lifetime regression. Preserve the existing behavior assertions; the original CI TS2724 reproduces before the import correction and the same type program and 16 lifetime cases pass afterward.

Refs: #131503 (CLI startup preparation)

* test(plugins): drop duplicate alias memoization assertion

Remove the case that compares the same cached alias object with itself. Keep the stronger identity/no-repeated-filesystem-read test, context-isolation cases, and real source/native loader coverage. No production API or behavior changes.

Refs: #131503 (CLI startup preparation)

* fix(ui): stop retired usage loads before requests

Preserve main's canonical lazy Usage loading and check the router, transport epoch, and selected agent after the deferred import. Carry the existing route signal to all aggregate requests so obsolete navigation does not start new RPCs or retain client waits. Keep independent preload lifetime intact.

Consolidate pending results to absorb the ownership checks with a net reduction of one production line. Real router/Gateway/selection regressions fail before the fix and pass afterward. Browser Back during a held service-worker fetch starts three obsolete Usage requests before the fix and none afterward; a fresh Usage visit still loads normally. This does not claim cancellation of server work already sent.

Refs: #131503 (CLI startup preparation and integration repair)
Related: #132140 (canonical Usage startup loading)

* test(ui): assert fresh usage data after epoch changes

Keep the waited fresh-result identity and stale-result rejection checks. Remove two redundant assertions that required the old two-argument request shape and rejected the newly forwarded cancellation signal.

The same failure appeared in both Control UI and Node CI lanes. Both test entrypoints now pass, along with adjacent Usage/controller coverage, UI test types, lint, and formatting. No production code, mock response, timeout, or stale/fresh data assertion changes.

Refs: #131503 (CLI startup and Usage lifecycle integration)
CI: https://github.com/openclaw/openclaw/actions/runs/33224402718
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 30, 2026
* fix(cli): retain invocation-owned plugin startup facts

Bind non-Gateway CLI work to one operation PluginCache while closing preparation authority before actions. Preserve selected-workspace execution and config-wide validation.

Defer the config writer, broad runtime state, and complete SDK aliases until demanded; keep late CJS and ESM actions in their creating cache. Rebuild the startup-only fix on the canonical progressive plugin cache without restoring superseded metadata and cache layers.

Startup split from the standalone relay investigation in openclaw#128379; updates openclaw#131503.

* fix(doctor): preserve registry scope across metadata refreshes

Give explicit post-lease and post-mutation reads a fresh metadata generation without retiring the invoking CLI or Gateway owner. Persist the original workspace index while retaining the complete config-wide validation view.

Bind rebased snapshots to their creating cache so later consumers cannot borrow a stale or foreign generation. Replace mocked persistence assertions with real scoped-index, lease, checkpoint, schema and provenance regressions.

Follow-up to the installed startup verification for openclaw#131503.

* fix(cli): defer MCP serving and stabilize startup checks

Load the existing channel MCP server only for the serve action, and use the already-eager client-runtime import for reload. Registration and probes no longer evaluate the unused serving owner.

Initialize the config CLI runtime capture before hoisted mocks. Give the real Doctor checkpoint fixture explicit build provenance and verify durable rows for successful, interrupted, and unidentified builds without changing runtime checkpoint policy. Remove duplicate fixture initialization and avoid dumping captured environments on rejection failures.

Refs: openclaw#131503 (CLI startup preparation)

* test(plugins): follow runtime load context module split

Import the canonical runtime context resolver from its new owning module in the CLI lifetime regression. Preserve the existing behavior assertions; the original CI TS2724 reproduces before the import correction and the same type program and 16 lifetime cases pass afterward.

Refs: openclaw#131503 (CLI startup preparation)

* test(plugins): drop duplicate alias memoization assertion

Remove the case that compares the same cached alias object with itself. Keep the stronger identity/no-repeated-filesystem-read test, context-isolation cases, and real source/native loader coverage. No production API or behavior changes.

Refs: openclaw#131503 (CLI startup preparation)

* fix(ui): stop retired usage loads before requests

Preserve main's canonical lazy Usage loading and check the router, transport epoch, and selected agent after the deferred import. Carry the existing route signal to all aggregate requests so obsolete navigation does not start new RPCs or retain client waits. Keep independent preload lifetime intact.

Consolidate pending results to absorb the ownership checks with a net reduction of one production line. Real router/Gateway/selection regressions fail before the fix and pass afterward. Browser Back during a held service-worker fetch starts three obsolete Usage requests before the fix and none afterward; a fresh Usage visit still loads normally. This does not claim cancellation of server work already sent.

Refs: openclaw#131503 (CLI startup preparation and integration repair)
Related: openclaw#132140 (canonical Usage startup loading)

* test(ui): assert fresh usage data after epoch changes

Keep the waited fresh-result identity and stale-result rejection checks. Remove two redundant assertions that required the old two-argument request shape and rejected the newly forwarded cancellation signal.

The same failure appeared in both Control UI and Node CI lanes. Both test entrypoints now pass, along with adjacent Usage/controller coverage, UI test types, lint, and formatting. No production code, mock response, timeout, or stale/fresh data assertion changes.

Refs: openclaw#131503 (CLI startup and Usage lifecycle integration)
CI: https://github.com/openclaw/openclaw/actions/runs/33224402718
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: S 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