Skip to content

fix(cli): avoid repeated plugin preparation at startup - #131503

Merged
steipete merged 7 commits into
mainfrom
steipete/cli-startup-preparation-a0c9da
Aug 29, 2026
Merged

steipete merged 7 commits into
mainfrom
steipete/cli-startup-preparation-a0c9da

Conversation

@steipete

@steipete steipete commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Related: independent native relay work and the routed CLI metadata-reuse proposal. This is the generic CLI startup split. iMessage and Browser CLI import reductions stay separate; native relay landing does not depend on them. This uses invocation ownership, not process-global adoption of workspace-scoped snapshots, and does not claim to close the separate latency proposal.

What Problem This Solves

Plugin-backed CLI commands repeat metadata preparation and load writer/runtime/SDK code before the selected action needs it. Reusable package facts and executable registrations also have different lifetimes: a new preparation must not receive registrars captured by a retired generation. Execution must stay within the selected workspace, while config validation still covers every configured workspace.

Installed verification also exposed stale post-write metadata reads and lost snapshot creator-cache provenance, preventing Doctor from verifying a durable registry checkpoint. The repair consumes the original-scope persistence producer rather than a second lookup or a validation union stored under one workspace header.

Why This Change Was Made

One lightweight operation cache spans each non-Gateway CLI invocation through early reads, nested registration, actions and cleanup. Separate preparation records fence executable registrations by exact input/source/workspace identities and lifecycle revisions, then close before actions. Gateway keeps its boot/process owner. The prepared record owns its registry promise and opts out of the lower process-registry cache; other callers keep their existing policy.

The existing config writer, broad plugin runtime and complete SDK aliases load on demand. Late native/Jiti imports retain their creator's facts. The light state facade is adopted by the eventual runtime; only the registry proxy grants stores. MCP client registration no longer imports the serving-only module, which loads inside the selected, validated serving action and existing error boundary.

Current main's canonical owners remain authoritative:

  • Original-scope registry persistence: write registryIndex directly and remove A's redundant leaf lookup. Fresh management generations and snapshot creator binding remain necessary.
  • Invocation registration, inventory policy, public-artifact loading, and registry retirement: preserve their behavior and regressions. The native-selection internal export remains for A's actual producer caller; the old wrapper stays deleted.
  • Automatic startup config repair: state migrations consume retired locators before config repair removes them. Keep the fresh external guard, lease/refusal policy, post-write validation and centralized checkpoint refresh. A's fresh reads sit at those boundaries; the old pre-state write and duplicate checkpoint calculations are not restored.
  • Manifest-owned discovery precedence: runtime consumes manifest winners without a competing duplicate sort. Explicit selected-workspace registries, including empty registries, remain authoritative. Broad validation does not grant execution.

Main's Usage startup cleanup supersedes A's old module renames, import churn and generated manifest changes. Only the three-file lifecycle residual remains: after deferred import, recheck router cancellation, transport/hello and selected agent before starting requests, then forward the signal to all three requests. Consolidated pending-result construction makes that residual net -1 production line. Independent preloads retain their lifetime. This prevents obsolete RPC startup/client waits, not server work already dispatched; existing result guards already reject stale results.

A duplicate SDK self-comparison test is removed; stronger identity/no-repeated-filesystem-read, context, private-surface and real-load coverage remains. No parallel cache framework, Program entry cache, function-bearing manifest projection, global reset, new configuration/environment option, dependency override, SQLite schema/format, or protocol is introduced. In-memory cache generations are not persistent cache schemas.

User Impact

Plugin-backed commands avoid repeated preparation without broadening which workspace's commands may execute. Config reads avoid the write pipeline, state-only registration avoids the broad runtime, and MCP client commands avoid serving-only imports. Explicit management refreshes observe new facts while retained operations remain internally consistent. Leaving Usage during its deferred load no longer starts obsolete requests afterward.

This does not establish a five-second discovery guarantee or an isolated end-to-end latency improvement. Authenticated Chrome/native acceptance remains with the independent relay feature. No operator Gateway, Chrome profile, credentials or live state was changed. AI-assisted maintainer-requested extraction.

Evidence

Verified candidate: ae4eed872d797b17084b8b72d9a9c1058e5e7064; tree c6be20b07e987e64c10a84aca509c51509fb970f; base bd9eeaebf0836cc3ae840669d4831495953c46fe. The seven-commit rebase is complete and clean. Range-diff changes only Doctor fresh-read placement/comment; six other patches are equivalent. Reviewed Doctor bytes and queued MCP, resolver-import, Usage and final UI-assertion corrections were verified after replay.

Exact-head CI and source proof: CI run 33230319786 passed 185 jobs, with 12 skipped and the required openclaw/ci-gate green. A canceled ClawSweeper dispatch caused the rollup watcher to report failure; the CI run itself did not fail. Its CLI job explicitly passed the MCP process regression in 2.787 seconds.

The configured Linux Testbox run 33231458800, lease tbx_01m15ryhjj79wj4swtzdq3wpn0, verified the exact input head and clean tracked source, then passed 784 tests across the same 14 selected files, plugin test types and formatting. Test execution took 49.46 seconds; the full command took 160.590 seconds on Node 24.19.0. MCP process and real runtime initialization completed in 3.367 and 12.628 seconds with unchanged limits. The lease was stopped and verified completed. This explicit plugin selection covers the runtime suite that normal full-fallback PR CI treats as release-only.

The Doctor/discovery reconciliation separately passed 180 cases: 13 real persistence, 69 migration/automatic-repair, 95 metadata/discovery/checkpoint, and three selected-workspace cases. Core/commands test types and scoped lint/format passed. Those tested Doctor bytes remained unchanged through the final stack. Independent isolated Codex review of the staged integration was scoped-clean at P0, confidence 0.97; prior whole-A review at 40f70309e38e was P0-clean at 0.96. These are static reviews, not additional test runs.

Build and archive: canonical pnpm build passed in 2,201.206 seconds on Node 24.20.0, with all 147 SDK subpaths, no ineffective dynamic-import diagnostic, unchanged source, and UI gzip 344,785 / 345,947 bytes. Actual build ID: 2026.8.1-ae4eed872d79-2026-08-29T03-10-56.542Z.

The canonical packager produced and normalized the archive. Two full packaging attempts then timed out generating npm's final-archive receipt; neither failed command is called a pass. The same offline npm receipt command succeeded with a task-owned cache in 271.994 seconds under its original 300-second bound. Its SHA-1/SHA-512 and inventory matched the unchanged archive. The remaining canonical validator, check-openclaw-package-tarball.mjs --require-bundled-workspace-deps, passed in 59.419 seconds under its original bound. This resumes the remaining stages, omits no gate, and fabricates no receipt or build stamp.

Final archive: 61,549,152 bytes / 11,307 members, SHA-256 6ffb69469fea55a191d6f355054db03894159e8292bf144b9e3da745693ad6a3.

Normal installation and cold-first acceptance: a new isolated npm prefix/cache/HOME, with lifecycle scripts enabled, installed that archive successfully in 494.006 seconds. The unchanged eight-action driver then passed, in its original order and under its original 30,000 ms per-child bound:

Installed action Child wall time Observed result
First cold Browser relay metadata 17.322 s Correct non-default endpoints, auth v2, no secret-bearing headers
Plugin inventory 3.638 s Browser present
Config write 3.846 s Value persisted
Config reread 3.104 s Persisted value returned
Selected alpha command 12.327 s Alpha executes; beta does not register
Unselected beta command 7.060 s Visible rejection, exit 1; beta does not execute
Invalid secondary-workspace schema 11.175 s Visible rejection, exit 1
Beta after execution-owner change 22.380 s Beta executes with its own config

There was no native-first warmup. 17.322 seconds is not five-second acceptance. Every action's expected outcome, child quiescence, fixture/port cleanup and absence of synthetic-key output were verified. Source, archive, installed payload and Node identities remained unchanged. Eight-action receipt SHA-256: dc321801428d15b7c4751e563001ecbbe9cb9708ff98abee77d209820d6cc118.

The additional installed MCP failure flow then passed in 26.502 seconds: exact exit 1, empty successful-server map, one named diagnostic, useful stderr, no key output, no retained child or fixture. Receipt SHA-256: 06b2f68c05845cd702d6bb36a3b14c067d99dfb92a3999be5d127426080b5cec.

Only afterward, the normal built-Browser import profiler passed: 353.063 MiB peak RSS versus 43.203 MiB baseline. It verified unchanged source/build and cleaned its synthetic state. This is import RSS, not CLI latency or an isolated before/after improvement claim.

Retained failures and limits: the local source MCP test timed out at 30 seconds on its initial run and two unchanged retries; a real runtime-initialization test hit 120 seconds. No local deadline, assertion, mock, environment policy or skip was weakened. The same cases passed in the explicit Linux proof above. A diagnostic child localized most of its own time to imports, but does not establish the exact cause of the earlier timeouts. Packaging's two receipt timeouts remain recorded. A sample showed filesystem operations in npm's extraction cache; isolated-cache success does not prove corruption or a sole cause. The first isolated npm install hit 900 seconds, and its final Git inspection timed out; a separate check confirmed unchanged source. The successful installation used a new prefix/cache, not the partial failed install. No CLI acceptance action ran in the failed installation.

Earlier 5bb CI failed the same stale two-argument Usage assertion in two jobs, plus the aggregate gate. The retained B26 correction removes four redundant call-shape assertion lines while preserving waited fresh-result identity and stale-result rejection. Both original CI entrypoints passed afterward. Older build/install receipts remain bound to their original identities and are not relabeled as candidate proof.

Real-browser proof and media gap: before/after normal UI builds and actual Chromium with synthetic Gateway data preserve Usage totals, Models behavior and byte-identical JSON exports. Holding the normal service-worker-owned deferred module fetch, navigating Back to Chat and releasing it produces three obsolete RPCs before / zero after; revisiting Usage succeeds. The service worker stays enabled. All six successful screenshots and two partial-run captures were inspected, and contexts/servers/ports/temp state cleaned up. These retain their actual precommit bundle identities, not final-commit labels. Images remain local because device classification/external-upload approval is not established; no image was uploaded. This is real rendering with synthetic RPC data, not authenticated provider or native Chrome acceptance.

The ClawSweeper review for this exact head, reviewed 2026-08-29 03:23 UTC, has no actionable source finding. Its rank-up moves—exact-head installed cold/cleanup/replacement proof and green CI—are addressed above. The analogous Models cancellation gap and lightweight tool-metadata extraction are named separate follow-ups, not folded into this PR.

Representative executed commands (the Testbox selection used the same file arguments):

OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs src/cli/run-main.exit.test.ts src/cli/config-cli.test.ts src/plugins/loader.runtime-registry.test.ts src/plugins/loader.test.ts src/plugins/cli-metadata-lifetime.test.ts src/plugins/cli-registry-loader.register-once.test.ts src/cli/mcp-cli.import-boundary.test.ts src/cli/mcp-cli.probe-exit.process.test.ts src/cli/mcp-cli.test.ts src/cli/mcp-cli.oauth.test.ts src/mcp/channel-server.shutdown-unhandled-rejection.test.ts ui/src/pages/gateway-source-replacement.test.ts ui/src/pages/usage/route.test.ts ui/src/lit/gateway-page-controller.test.ts
pnpm build
node scripts/check-openclaw-package-tarball.mjs --require-bundled-workspace-deps .artifacts/startup-split-A/package-ae4eed872d79-retry1/openclaw-startup-A.tgz
OPENCLAW_LOCAL_CHECK=0 node --import tsx scripts/profile-extension-memory.mts --extension browser --skip-combined --concurrency 1 --json .artifacts/startup-split-A/profile-browser-ae4eed872d79.json

Production LOC: +847/-736 = +111 (28 files). Tests/support: +2,644/-283 = +2,361 (24 files). Docs: +14. Shrink-only assertion ratchet: +1/-2 = -1. Total 54 files, net +2,485; no generated-manifest delta. Remaining production growth expresses observed invocation/preparation/management and creator-provenance ownership on the canonical cache; superseded carriers, lookup paths and UI renames were removed rather than retained as another framework or fallback.

@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 docs Improvements or additions to documentation cli CLI command changes commands Command implementations size: XL maintainer Maintainer-authored PR labels Aug 28, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: needs maintainer proof decision A ClawSweeper-authored PR needs a maintainer proof capture or override decision. 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, 11:23 PM ET / August 29, 2026, 03:23 UTC.

ClawSweeper review

What this changes

The branch scopes plugin preparation to one non-Gateway CLI invocation, rebuilding it after lifecycle changes while adding related plugin, Doctor, and stale UI-load coverage.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open: the cache-lifetime repair remains absent from current main and no introduced correctness defect was established, but the refreshed head still needs its stated exact-head package/install cold-flow proof and CI before merge.

Priority: P2
Reviewed head: ae4eed872d797b17084b8b72d9a9c1058e5e7064

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch has coherent owner-boundary coverage, but the final refreshed-head cold-flow proof and CI are still pending.
Proof confidence 🦐 gold shrimp (3/6) Not applicable: This is a maintainer-authored PR; the supplied focused and standalone evidence is relevant, while exact-head package/install cold-flow verification remains a merge-readiness requirement.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This is a maintainer-authored PR; the supplied focused and standalone evidence is relevant, while exact-head package/install cold-flow verification remains a merge-readiness requirement.
Evidence reviewed 8 items Invocation cache owner: Non-Gateway CLI invocations enter a fresh plugin-cache scope, while Gateway invocation retains its existing process/boot cache.
Preparation-session boundary: The CLI load session binds preparation to an operation cache and tracks closure and metadata revision, rather than reusing a stale registrar after input changes.
Lazy command sibling: Primary registrations are prepared before the startup session closes; lazy non-primary groups create a fresh parsing-time session.
Findings None None.
Security None None.

How this fits together

The CLI reads configuration and plugin metadata to register commands before parsing an invocation, then executes the selected command. The changed cache boundary controls whether that startup preparation is reused or refreshed after plugin lifecycle changes.

flowchart LR
  A[CLI invocation] --> B[Config and plugin metadata]
  B --> C[Invocation cache]
  C --> D[Plugin command registration]
  D --> E[Command parsing]
  E --> F[Command action]
  C --> G[Plugin replacement or cleanup]
  G --> D
Loading

Before merge

  • Resolve merge risk (P1) - The branch changes existing CLI/plugin preparation lifetimes; its stated exact-head package/install cold-first-invocation proof and exact-head CI are still pending, so upgrade and startup behavior is not yet fully demonstrated on the refreshed head.
  • Complete next step (P2) - Maintainer-owned PR; wait for the pending refreshed-head package/install cold-flow evidence and exact-head CI rather than dispatching an automated repair.
Agent review details

Security

None.

PR surface

Source +111, Tests +2361, Docs +14, Other -1. Total +2485 across 54 files.

View PR surface stats
Area Files Added Removed Net
Source 28 847 736 +111
Tests 24 2644 283 +2361
Docs 1 14 0 +14
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 2 -1
Total 54 3506 1021 +2485

Review metrics

Metric Value Why it matters
Production versus test delta production +847/-736 (net +111); tests/support +2,645/-285 (net +2,360); docs +14 The production cache-lifetime change is accompanied by substantial targeted lifecycle coverage, but its installed cold-flow behavior still needs refreshed-head proof.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/commands/doctor-config-preflight-plugin-index.ts, persistent cache schema: src/cli/run-main.ts, persistent cache schema: src/commands/doctor-config-preflight-plugin-index.ts, persistent cache schema: src/commands/doctor/shared/plugin-metadata-snapshot-scope.ts, persistent cache schema: src/plugins/cli-registry-loader.ts, persistent cache schema: src/plugins/cli.ts, and 10 more. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Verify the refreshed head (recommended)
    Run the pending exact-head package/install cold-flow proof and exact-head CI before merge.

Technical review

Best possible solution:

Merge only after the refreshed head demonstrates a cold installed CLI invocation, cleanup/replacement refresh behavior, and green exact-head CI.

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

Unclear: the source and focused regression tests identify the stale-preparation path, but this read-only review did not establish a fresh exact-head installed cold-flow reproduction.

Is this the best way to solve the issue?

Yes for the reviewed cache boundary: invocation-owned caching with lifecycle invalidation matches the caller, loader, and lazy-command ownership paths; final installed-runtime proof remains needed before merge.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This is a bounded CLI/plugin startup reliability repair without evidence of an active widespread outage.
  • merge-risk: 🚨 compatibility: The PR changes reuse and invalidation rules for existing plugin metadata and command preparation during CLI startup.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is a maintainer-authored PR; the supplied focused and standalone evidence is relevant, while exact-head package/install cold-flow verification remains a merge-readiness requirement.

Evidence

Acceptance criteria:

  • [P1] Exact-head installed-package cold CLI invocation with plugin preparation.
  • [P1] Exact-head cleanup/replacement refresh behavior.
  • [P1] Exact-head focused CLI/plugin lifecycle tests.
  • [P1] Exact-head CI.

What I checked:

Likely related people:

  • steipete: Authored the active CLI cache change and the related UI lifecycle correction in this branch. (role: recent area contributor; confidence: high; commits: 3012d1a40581, 832a194a4da0; files: src/cli/run-main.ts, src/plugins/cli-registry-loader.ts, ui/src/pages/usage/route.ts)

Rank-up moves

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

  • Publish redacted exact-head installed-package proof for a cold CLI invocation and cleanup/replacement refresh path.
  • Complete exact-head CI.

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 (15 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-28T19:50:01.210Z sha 90c9804 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-28T20:59:17.783Z sha aaeabd3 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-28T21:18:44.592Z sha aaeabd3 :: needs changes before merge. :: [P2] Update the lifetime test for the load-context split
  • reviewed 2026-08-29T00:38:22.353Z sha 40f70309e38e8a3bc6a7e7b1921ac7e8bf8fd028 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-29T01:01:28.368Z sha 5bb3529 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-29T01:44:20.236Z sha b26cb84 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-29T01:59:05.130Z sha b26cb84 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-29T02:34:59.585Z sha b26cb84 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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: needs maintainer proof decision A ClawSweeper-authored PR needs a maintainer proof capture or override decision. labels Aug 28, 2026
@steipete
steipete force-pushed the steipete/cli-startup-preparation-a0c9da branch 2 times, most recently from d1dfada to ce70dfa Compare August 28, 2026 06:17
@steipete steipete self-assigned this Aug 28, 2026
@steipete
steipete marked this pull request as ready for review August 28, 2026 06:19
@steipete

steipete commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor Author

Completed source, build, package and installed acceptance for ae4eed872d797b17084b8b72d9a9c1058e5e7064, tree c6be20b07e987e64c10a84aca509c51509fb970f. The fix keeps reusable package facts in one invocation-owned cache while closing executable preparation before actions. Selected-workspace execution stays separate from config-wide validation. Doctor rereads cross lease/mutation boundaries in fresh generations while preserving current main's migration-before-write ordering, durable registry scope and creator provenance. Superseded cache/carrier/lookup and UI rename paths remain deleted. Production is net +111; tests/support net +2,361.

Exact-head CI passed 185 jobs / 12 skipped, including the required gate. Configured Linux Testbox proof passed 784 focused cases, plugin test types and formatting; the lease is stopped. Doctor/discovery reconciliation separately passed 180 cases and types/lint/format. Independent isolated review was scoped-clean at P0 for the full earlier implementation (0.96) and final Doctor integration (0.97); no source changed afterward except the reviewed rebase integration. The full candidate build passed with all 147 SDK subpaths, no ineffective dynamic import, and UI gzip 344,785 under 345,947 bytes.

The normalized candidate archive is 61,549,152 bytes / 11,307 members, SHA-256 6ffb69469fea55a191d6f355054db03894159e8292bf144b9e3da745693ad6a3. Two packaging commands timed out generating npm's final receipt; those failed runs remain failures. The same receipt command succeeded with an isolated cache within its original 300-second bound, its hashes/inventory matched the unchanged archive, and the remaining canonical validator passed. No gate was omitted, no stamp rewritten, and no earlier artifact relabeled.

Normal npm installation with lifecycle scripts enabled passed in a new isolated prefix/cache in 494.006 seconds. The first installation attempt had hit its 900-second limit and was not reused. All eight original installed actions then passed in order: cold metadata 17.322s, inventory 3.638s, config write 3.846s, reread 3.104s, selected alpha 12.327s, rejected unselected beta 7.060s, rejected invalid secondary schema 11.175s, and selected beta after owner change 22.380s. Every child retained its original 30-second bound. Output, isolation, child/port/fixture cleanup and source/archive/installed/Node identities were verified. Eight-action receipt SHA-256: dc321801428d15b7c4751e563001ecbbe9cb9708ff98abee77d209820d6cc118.

The additional installed MCP error flow passed in 26.502s, with exact exit 1, empty success map, one named diagnostic, useful stderr, no key output and complete cleanup. Receipt SHA-256: 06b2f68c05845cd702d6bb36a3b14c067d99dfb92a3999be5d127426080b5cec. Only afterward, the normal built-Browser import profile passed at 353.063 MiB RSS versus 43.203 MiB baseline. This is neither five-second acceptance nor an isolated latency/RSS improvement claim.

The PR body records exact commands, earlier CI corrections, local source timeouts, packaging/install retries, and the inspected real-browser cancellation proof. No deadline/assertion/mock/feature policy was relaxed. UI images remain local because external-upload approval is not established. No operator Gateway, Chrome profile or credentials were changed. The latest exact-head ClawSweeper rank-up requests—installed cold/cleanup/replacement proof and green CI—are now addressed. Native review/prepare/merge follows; this comment does not claim the PR is already merged.

@steipete
steipete force-pushed the steipete/cli-startup-preparation-a0c9da branch from ce70dfa to 3584f08 Compare August 28, 2026 13:55
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 28, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 29, 2026
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.
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)
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)
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)
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)
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
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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 cli CLI command changes commands Command implementations docs Improvements or additions to documentation maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL 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