Skip to content

perf(plugins): list from installed metadata on all forms - #117900

Merged
steipete merged 1 commit into
mainfrom
codex/refactor-plugins-list-index
Aug 2, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/refactor-plugins-list-index

Conversation

@steipete

@steipete steipete commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

openclaw plugins list took ~9.7 s in production (48 cores, ~150 plugins) — it executed ~150 plugin modules to render an inventory whose facts are already persisted in the installed-plugin index. Real-inventory measurement on this branch: 4.7–5.8 s before → 1.21–1.29 s after on a 151-plugin host.

Why This Change Was Made

The listing projector was already metadata-only, but only plugins list --json dispatched route-first (the cold path). The default, --enabled, and --verbose forms fell through to generic CLI/config startup, which triggered the plugin-module load storm. Two changes:

  • parsePluginsListRouteArgs no longer gates on --json, so every listing form dispatches route-first through the single exact ["plugins","list"] catalog entry — which carries configGuard: "skip" from the config-guard unification (refactor(cli): unify config-guard policy across dispatch paths #117880), so no form pays the doctor/plugin preflight.
  • The command reads config with the pre-existing skipPluginValidation: true option, letting the installed-index projector own plugin metadata validation instead of re-validating plugin schemas up front.

Fact-source audit (all listing facts come from the installed index or manifest snapshot — none require module execution): name/id/description/version/format/kind, enabled status, source/root/origin, declared providers/channels/aliases/tools, dependency status, and registry diagnostics all read prepared metadata. Facts that genuinely need module execution (runtime imports, hooks, services, live failures, harness registrations) were already excluded from the listing and remain available via plugins inspect --runtime. The Control UI does not consume this CLI output (it uses the Gateway plugins.list protocol), and docs already describe this command as cold inventory.

User Impact

All openclaw plugins list forms — not just --json — return in ~1.2 s instead of ~5–10 s, rendering the same fields, with runtime inspection still reserved for the explicit plugins inspect --runtime path.

Evidence

  • Focused Vitest: 5 files / 93 tests, plus a cold-route guard test (plugins-list-route-cold-imports.test.ts) asserting zero plugin-module loads on the default listing path; final-head rerun 2 files / 47 tests.
  • pnpm tsgo:core, pnpm build (no [INEFFECTIVE_DYNAMIC_IMPORT]): passed.
  • Autoreview (Codex gpt-5.6-sol, high): clean, "patch is correct" (0.98).
  • Synthetic 150-plugin benchmark: 1,853 ms → 1,384 ms median (25%) with zero runtime executions on both; real 151-plugin inventory 4.7–5.8 s → 1.21–1.29 s.
  • Production LOC net −2; tests +110. Rebased onto refactor(cli): unify config-guard policy across dispatch paths #117880's unified configGuard field (no stale routeConfigGuard/bypassConfigGuard anywhere).

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: S maintainer Maintainer-authored PR labels Aug 2, 2026
@steipete
steipete marked this pull request as ready for review August 2, 2026 08:06
@steipete steipete self-assigned this Aug 2, 2026
@clawsweeper

clawsweeper Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 2, 2026, 4:11 AM ET / 08:11 UTC.

ClawSweeper review

What this changes

Routes default, enabled-only, verbose, and JSON openclaw plugins list invocations through the metadata-only inventory path and skips redundant plugin-aware configuration validation.

Merge readiness

⛔ Blocked until stronger real behavior proof is added - 5 items remain

This PR addresses a real current-main performance gap: only JSON plugin listing currently takes the metadata-only route, while the documented default listing remains cold inventory. The patch is mechanically coherent, but the maintainer label and the intentional change to plugin-schema validation behavior require maintainer confirmation; the PR body also needs inspectable after-fix terminal or log proof before merge.

Priority: P2
Reviewed head: 5c7a38ecaa2839950dd95a3e9b0e88e5acc1a12b
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused route and cold-import coverage make the patch strong, but independently inspectable real-host proof and a confirmed validation-boundary decision are still needed before merge.
Proof confidence 🦐 gold shrimp (3/6) Needs stronger real behavior proof before merge: The PR body reports real-host timings, but it does not include inspectable after-fix terminal output, redacted logs, a recording, or a linked artifact that demonstrates the command on the claimed inventory; attach one and redact private paths, endpoints, and credentials. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: The PR body reports real-host timings, but it does not include inspectable after-fix terminal output, redacted logs, a recording, or a linked artifact that demonstrates the command on the claimed inventory; attach one and redact private paths, endpoints, and credentials. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 6 items Current-main behavior: Current main still limits parsePluginsListRouteArgs to --json, so bare, enabled, and verbose listing forms fall through instead of using the routed metadata inventory path.
Existing cold-inventory contract: The user documentation states that plain plugins list is a cold inventory check based on config, manifests, and the persisted plugin registry, while inspect --runtime is the explicit runtime-loading path.
Patch route coverage: The proposed parser removes the JSON-only gate and preserves the supported --json, --enabled, and --verbose option shape; the expanded route test covers all four listing forms without loading the full plugins CLI.
Findings None None.
Security None None.

How this fits together

The CLI receives a plugin-list command, applies route-first startup policy, then builds an installed-plugin inventory from configuration, manifests, and the persisted registry. The resulting records feed JSON or terminal formatting, while runtime module inspection remains an explicit plugins inspect --runtime operation.

flowchart LR
  A[CLI invocation] --> B[Route-first command matching]
  B --> C[Cold startup policy]
  C --> D[Runtime configuration read]
  D --> E[Installed plugin metadata snapshot]
  E --> F[Plugin inventory report]
  F --> G[JSON or terminal output]
  H[Explicit runtime inspection] --> I[Plugin module execution]
Loading

Decision needed

Question Recommendation
Should openclaw plugins list intentionally bypass plugin-owned configuration-schema validation so a cold inventory remains available even when a plugin's configuration is invalid? Approve cold inventory behavior: Keep the skip for plugin-aware validation, add a regression test showing the intended invalid-plugin-config outcome, and document it if users could otherwise expect validation failure.

Why: The patch deliberately changes an existing configuration-validation boundary, and the repository policy treats config and fallback behavior as compatibility-sensitive; the protected maintainer label requires explicit human handling.

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: The PR body reports real-host timings, but it does not include inspectable after-fix terminal output, redacted logs, a recording, or a linked artifact that demonstrates the command on the claimed inventory; attach one and redact private paths, endpoints, and credentials. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - The command will no longer make plugin-owned configuration-schema errors block inventory output; confirm that this compatibility change is intentional and retain a focused regression test for the chosen behavior.
  • Resolve merge risk (P1) - The PR body reports real-host timing improvements, but no inspectable terminal transcript, redacted log, recording, or linked artifact demonstrates the after-fix command on a real plugin inventory.
  • Resolve merge risk (P1) - The prior ClawSweeper comment’s rank-up moves could not be retrieved because the GitHub API connection was unavailable during this read-only review.
Agent review details

Security

None.

PR surface

Source -2, Tests +110. Total +108 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 4 6 -2
Tests 2 130 20 +110
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 134 26 +108

Review metrics

Metric Value Why it matters
Plugin validation mode 1 changed, 0 added, 0 removed The list command now skips plugin-aware schema validation, so maintainers need to confirm the changed behavior for existing invalid plugin configuration.

Stored data model

Persistent data-model change detected: vector/embedding metadata: src/cli/plugins-list-route-cold-imports.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Confirm and test the validation boundary (recommended)
    Before merge, confirm that listing invalid plugin-owned config is intended and add a focused test that locks down the selected upgrade behavior.
  2. Preserve the old validation behavior
    Remove the skip if plugin-schema errors must continue to block inventory output, accepting the additional startup work for this command.

Technical review

Best possible solution:

Keep every supported list form on the metadata-only path, explicitly confirm that inventory should remain available when only plugin-owned schema validation fails, add focused coverage for that boundary, and attach redacted real-host command timing/output proof.

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

Yes, from source: current main only parses the route when --json is present, while the default documented plugins list form falls back to the full CLI. The read-only review did not execute the benchmark, so the reported timing magnitude remains unverified here.

Is this the best way to solve the issue?

Yes, conditionally: routing all existing list forms through the established metadata projector matches the documented cold-inventory contract. The plugin-validation skip needs explicit compatibility confirmation and focused coverage before it is the best complete fix.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This fixes a bounded CLI performance regression on the documented plugin inventory path without evidence of data loss, security impact, or runtime unavailability.
  • add merge-risk: 🚨 compatibility: Skipping plugin-aware validation can change what existing users see when their plugin-specific configuration is invalid.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦞 diamond lobster.

Label justifications:

  • P2: This fixes a bounded CLI performance regression on the documented plugin inventory path without evidence of data loss, security impact, or runtime unavailability.
  • merge-risk: 🚨 compatibility: Skipping plugin-aware validation can change what existing users see when their plugin-specific configuration is invalid.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦞 diamond lobster.

Evidence

What I checked:

  • Current-main behavior: Current main still limits parsePluginsListRouteArgs to --json, so bare, enabled, and verbose listing forms fall through instead of using the routed metadata inventory path. (src/cli/program/route-args.ts:453, 86a95b459c94)
  • Existing cold-inventory contract: The user documentation states that plain plugins list is a cold inventory check based on config, manifests, and the persisted plugin registry, while inspect --runtime is the explicit runtime-loading path. Public docs: docs/plugins/manage-plugins.md. (docs/plugins/manage-plugins.md:81, 86a95b459c94)
  • Patch route coverage: The proposed parser removes the JSON-only gate and preserves the supported --json, --enabled, and --verbose option shape; the expanded route test covers all four listing forms without loading the full plugins CLI. (src/cli/program/route-args.ts:453, 5c7a38ecaa28)
  • Validation-boundary change: getRuntimeConfig({ skipPluginValidation: true }) changes plugin-aware schema validation to the configuration loader's skip mode; core configuration validation still runs, but plugin-specific schema checks and their warnings no longer gate this command. (src/config/io.load.ts:112, 86a95b459c94)
  • Related merged provenance: The merged config-guard unification established the shared route-first startup policy that this PR builds upon, but it did not remove the current parser's JSON-only condition. (src/cli/program/routed-command-definitions.ts:196, a9bbf45d4bb8)
  • Feature history: The current parser and list command originate from the recent CLI loader work, and the same contributor also authored the merged config-guard refactor immediately adjacent to this route. (src/cli/plugins-list-command.ts:41, 57c6f7622133)

Likely related people:

  • steipete: Peter Steinberger introduced the current route/list implementation in the recent CLI loader work and authored the merged config-guard refactor that this patch extends. (role: recent CLI and plugin-inventory contributor; confidence: high; commits: 57c6f7622133, a9bbf45d4bb8; files: src/cli/plugins-list-command.ts, src/cli/program/route-args.ts, src/cli/program/routed-command-definitions.ts)

Rank-up moves

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

  • Attach a redacted terminal transcript or linked artifact showing before/after plugins list timing on a real inventory.
  • Add focused coverage for the intended behavior when plugin-owned schema validation would otherwise fail.
  • Resolve the maintainer decision on whether cold inventory may bypass plugin-specific validation.

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.

@steipete

steipete commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

Maintainer landing decision: approve the cold-inventory behavior. Plugin listing is intentionally allowed to bypass plugin-owned schema validation so the installed metadata inventory remains available without executing plugin modules.

The optional terminal-transcript and additional invalid-plugin-config test rank-up moves are intentionally skipped for this already-reviewed landing. The accepted proof is the focused cold-route regression coverage, the real-inventory timing evidence already recorded in the PR body, and exact-head hosted CI on 5c7a38e. This landing task is explicitly scoped to Git/GitHub mechanics with no code changes or PR-body polish.

@steipete
steipete merged commit 76ec395 into main Aug 2, 2026
180 of 185 checks passed
@steipete
steipete deleted the codex/refactor-plugins-list-index branch August 2, 2026 08:18
@steipete

steipete commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit to yetval/openclaw that referenced this pull request Aug 2, 2026
…r-117788-empty-startup-race

* commit '9517b10778ba69b94471cb1f122a5f1e19aa22a4':
  fix(hooks): show eventless status consistently (openclaw#116127)
  refactor(cli): consolidate security-sensitive regression fixtures (openclaw#114411)
  perf(plugins): list from installed metadata (openclaw#117900)
  fix(memory): remove interrupted Dreaming sessions after Gateway restart (openclaw#117885)
  test(gateway): reuse startup plugin metadata snapshot (openclaw#117897)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant