Repository navigation
fix(cli): reduce plugins list startup memory - #103132
Conversation
|
Land-ready proof for exact PR head
Migration compatibility remains explicit: the doctor preflight still runs for the legacy plugin install index, existing shared state database, SQLite sidecars, legacy channel/state markers, and configured session stores. No proof gaps known. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ebd9ec90f1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| path.join(stateDir, "agents"), | ||
| path.join(stateDir, "plugins", "installs.json"), | ||
| path.join(stateDir, "sessions"), | ||
| path.join(stateDir, "state", "openclaw.sqlite"), |
There was a problem hiding this comment.
Narrow the shared-state migration trigger
When a user already has a normal, current state/openclaw.sqlite but no legacy sidecars or custom session store, this existence check makes plugins list --json run the full doctor state-migration preflight anyway. That reintroduces the doctor/channel runtime imports for already-migrated installs, so the cold-start memory reduction only applies to completely empty homes; this should gate on an actual pending shared-DB schema migration instead of any shared DB file.
Useful? React with 👍 / 👎.
|
Merged via squash.
|
(cherry picked from commit a1ce77d)
(cherry picked from commit a1ce77d)
Closes #103131
What Problem This Solves
Fixes an issue where users listing plugins from a fresh packaged install would load the doctor and bundled-channel state-migration runtime graph, increasing peak memory from about 376.5 MiB in v2026.6.11 to 636-638 MiB in the reproduced current release artifact.
Why This Change Was Made
plugins listnow uses the existing lightweight migration-input detector before running the state-migration preflight. The preflight still runs for legacy plugin indexes, an existing shared state database, legacy channel sidecars and state roots, or configured session stores, so shipped upgrades retain the same migration behavior. The packaged CLI startup-memory gate now covers plugin listing directly.User Impact
Fresh and already-migrated installs can list plugin metadata with substantially lower cold-start memory. Existing installs that still need a state migration continue to migrate before the command reads config or plugin metadata.
Evidence
HOME, normal npm postinstall,NODE_DISABLE_COMPILE_CACHE=1,OPENCLAW_NO_RESPAWN=1:corepack pnpm build: passed on Blacksmith Testbox.corepack pnpm check:changed: passed on Blacksmith Testbox.plugins list --jsonmeasured 275.4 MiB against the new 350 MiB Linux ceiling; the existing help/status/gateway cases also passed.AI-assisted implementation and review; all cited tests and package measurements were run against the branch artifacts.