Skip to content

fix: root help stays fast with inert plugin configuration - #147932

Closed
baisiqi6 wants to merge 10 commits into
openclaw:mainfrom
baisiqi6:fix/114067-root-help-inert-plugins
Closed

baisiqi6 wants to merge 10 commits into
openclaw:mainfrom
baisiqi6:fix/114067-root-help-inert-plugins

Conversation

@baisiqi6

@baisiqi6 baisiqi6 commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Closes #114067

Related: #114068, #85396 (closed and unmerged; prior problem and review context)

Agent provenance: UNVERIFIED / Codex · role=Worker · acting_for=OpenClaw dogfood Operator. Bounded alignment and independent source review used separately recorded OMP sessions with native deepseek/deepseek-v4-flash, thinking=max; this is not a Codex native-autoreview claim.

What Problem This Solves

Fixes: bare openclaw --help waits for the full config and plugin startup path when configuration contains an inert plugins: {} block.

User Impact

User impact: root help stays fast for provably inert strict-JSON plugin configuration. Ambiguous or help-affecting configuration retains the existing live-config behavior.

Why This Change Was Made

A config-owned preflight checks the real process environment and selected config before using precomputed root help. Canonical dotenv files, plugin-sensitive environment values, JSON5, includes, substitutions, config-owned env, unknown plugin shapes, and meaningful plugin settings retain the live snapshot path. Dotenv path selection is shared with the normal loader.

The ordinary upstream alignment preserves the new fs-safe fallback-clear/native-normalization owners and sync/async/provider-auth/workspace isolation semantics. Tests follow upstream's intentional retirement of automatic legacy-path discovery: in the legacy-only fixture, implicit selection targets the absent canonical config and uses the live fallback; explicitly selecting that strict-JSON legacy file with inert plugins: {} is eligible for static help. Unknown, dynamic, or non-inert content still falls back. The synthetic config-import test has a precise adjacent mock-isolation reason; only its single stale baseline row is removed, without widening exceptions or changing checkers, assertions, timeouts, or workflows.

The startup benchmark adds helpInertPlugins, writes { "plugins": {} }, and exercises the real --help entry with 500 ms first-output / 1000 ms exit contracts. The checked-in x64 relative baseline is unchanged. Measurements below are local macOS arm64 / Node 26.5.0 evidence; no current GitHub workflow explicitly selects this new benchmark case.

Evidence

Current published head 8d72643069bafc8d04de5563315744d1ae627ed8 is an ordinary upstream merge with parents 91902d02257af69bf775b7a35f9c8cb618d5a15b and a38b64b2fea5b16aa4352147187a8c8ab2e7413a. Its tree f623ce1ecf5381d0e7147d95b5ed1f8f92734929 exactly matches the independent source review. GitHub readback confirms 12 files, 472 additions / 38 deletions. Latest main 121a56a643df9179be01623baffe2154200b8ca2 is merge-tree conflict-free; no chase merge was added.

  • Seven selected dotenv/async-config/fs-safe suites passed 76/76. Separately timed changed files: final root-help-live-config 3/3 (2.43 s), preflight 23/23 (2.41 s), benchmark tooling 30/30 (35.68 s, including compiled runtime-worker preparation/cache miss). Eager import closure passed 17/17. These are whole local command wall times, not fixture-only execution times.
  • Available historical 91902 CI costs: entire Run Node test shard steps were 85 s for root-help-live-config, 205 s for preflight, and 104 s for benchmark tooling. Those steps include other files; they are neither per-file CI wall times nor new-head coverage.
  • Rebuilt current-source CLI startup, bootstrap import guard, runtime postbuild, and standalone core typecheck passed. Full candidate-scoped check:changed --staged --base a38b64b2... finished exit 0, including selected ratchets, formatting, all core-test/root-test type shards, scripts types/lint, dead-export scans, targeted core/root lint and final guards, without skip flags. Full unrelated runtime suites are not claimed.
  • Five real help samples: first-output p50/p95 115.313/117.556 ms, exit p50/p95 121.396/123.670 ms, 5/5 exit 0; absolute contracts passed. Earlier matched same-base runs showed 687.709→79.073 ms with byte-identical stdout; that is historical evidence, not a new matched ratio on this base.
  • Independent read-only source review APPROVE binds the complete final tree/diff, including the exact single-row baseline shrink. No new P0–P3 findings; existing nonblocking ambient-cwd and V8 stack-depth test assumptions are retained. Reviewer did not execute runtime tests, builds, or CI.
  • Prior-head ClawSweeper Revision 10 reviewed 91902d02257af69bf775b7a35f9c8cb618d5a15b: ready for maintainer review, no findings or security blockers. It is not evidence of review of this new alignment head.
  • Historical CI run 36841763820 on 91902 finished with 77 successful, 23 skipped, and 2 failed jobs. The direct failure was spawnSync rg ENOENT while starting check:database-worker-ratchet; the aggregate gate then failed. Its comparison did not run, and those checker/workflow files had no candidate delta. Runner/PATH root cause remains unproven; local ratchet success on this alignment does not resolve or reclassify that CI failure. Current-head CI/review must be checked independently after publication.

Historical attribution: the prior 033ef941 memory-core failure remains UNKNOWN. A bounded matched replay of its exact 18-file group passed 265/265 on both that head and its actual upstream parent be46e696; local macOS/Node 26 results do not reproduce the original Linux/Node 24 context or prove every prior CI failure unrelated. No rerun, dispatch, empty commit, PR merge, release, or deployment is part of this alignment.

@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation cli CLI command changes scripts Repository scripts size: M labels Sep 14, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. labels Sep 14, 2026
@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 5, 2026, 5:50 PM ET / 21:50 UTC (Revision 11).

ClawSweeper review

What this changes

The PR keeps root CLI help fast for inert plugin configuration, shares dotenv path selection with normal loading, and adds startup benchmark coverage.

Merge readiness

✅ Ready for maintainer review

Keep open: current main and v2026.9.8 retain the reported config-loading overhead. The related merged optimization addresses a different cost, and no blocking defect was found in this patch.

Priority: P2
Reviewed head: 8d72643069bafc8d04de5563315744d1ae627ed8

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A useful, conservatively scoped patch with relevant real CLI measurements and no blocking review findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The supplied current-head evidence exercises rebuilt root help with the benchmark's inert-plugin fixture on macOS arm64 and records five fast successful exits. Historical matched output evidence supports unchanged help text; tests supplement conservative fallback coverage. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The supplied current-head evidence exercises rebuilt root help with the benchmark's inert-plugin fixture on macOS arm64 and records five fast successful exits. Historical matched output evidence supports unchanged help text; tests supplement conservative fallback coverage. No stored-data contract changes.
Evidence reviewed 9 items Pinned introduction reviewed: Reviewed the merge-base-to-head delta supplied by the host. The original head's recorded parents match the supplied identities; the stale GitHub test merge was not used to infer removal of main-branch behavior.
Current main still needs the optimization: At the fetched main revision, the root-help owner imports the configuration module and reads its snapshot before determining that empty plugin settings do not affect help.
Latest release retains the same path: The supplied latest release, v2026.9.8, also reads the full configuration snapshot before checking whether plugin help is affected. Its source was inspected through GitHub after the local release blob was unavailable.
Findings None None.
Security None None.

How this fits together

Root CLI help chooses between precomputed text and help rendered from live plugin configuration. The preflight examines the selected configuration and environment before deciding whether full configuration loading is necessary.

flowchart TD
  A[Root help request] --> B[Selected config and environment]
  B --> C[Conservative config preflight]
  C -->|Provably inert| D[Precomputed help]
  C -->|Dynamic or meaningful| E[Live configuration loader]
  E --> F[Plugin-aware help]
  D --> G[CLI output]
  F --> G
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +142, Tests +281, Other +11. Total +434 across 12 files.

View PR surface stats
Area Files Added Removed Net
Source 5 172 30 +142
Tests 4 288 7 +281
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 3 12 1 +11
Total 12 472 38 +434

Review metrics

Metric Value Why it matters
Production versus test growth Runtime production +172/-30; tests +287/-6; tooling +12/-0 Production growth is justified by the conservative preflight and shared dotenv path owner; tests protect shortcut eligibility and benchmark fixture delivery.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #114067
Summary: This PR is the open candidate for the inert-plugin configuration overhead; plugin-module evaluation and exit settlement are distinct problems.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep the conservative preflight with shared dotenv selection, preserving live configuration loading whenever help could change.

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

Yes, source establishes that root help with an inert plugins object loads the full configuration before selecting identical precomputed output. The linked report supplies measured reproduction; this read-only review did not execute it.

Is this the best way to solve the issue?

Yes, the conservative config-owned preflight avoids the unnecessary import while sharing dotenv selection and preserving ambiguous cases on the existing path.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 1b7dd0b2ac92.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This fixes bounded CLI help latency while retaining existing behavior for meaningful plugin configuration.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The supplied current-head evidence exercises rebuilt root help with the benchmark's inert-plugin fixture on macOS arm64 and records five fast successful exits. Historical matched output evidence supports unchanged help text; tests supplement conservative fallback coverage. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied current-head evidence exercises rebuilt root help with the benchmark's inert-plugin fixture on macOS arm64 and records five fast successful exits. Historical matched output evidence supports unchanged help text; tests supplement conservative fallback coverage. No stored-data contract changes.

Evidence

What I checked:

  • Pinned introduction reviewed: Reviewed the merge-base-to-head delta supplied by the host. The original head's recorded parents match the supplied identities; the stale GitHub test merge was not used to infer removal of main-branch behavior. (8d72643069ba)
  • Current main still needs the optimization: At the fetched main revision, the root-help owner imports the configuration module and reads its snapshot before determining that empty plugin settings do not affect help. (src/cli/root-help-live-config.ts:15, 1b7dd0b2ac92)
  • Latest release retains the same path: The supplied latest release, v2026.9.8, also reads the full configuration snapshot before checking whether plugin help is affected. Its source was inspected through GitHub after the local release blob was unavailable. (src/cli/root-help-live-config.ts:16, fc23bc864e45)
  • Conservative shortcut and fallback: The preflight accepts only known, inert plugin shapes in strict JSON. Plugin-sensitive environment values, canonical dotenv files, includes, substitutions, config-owned environment, unknown fields, and read/traversal failures retain the snapshot path. Injected environments bypass the shortcut. (src/config/root-help-preflight.ts:67, 8d72643069ba)
  • Dotenv loading compatibility: Compared the original loaders with the extracted selector. State-directory precedence, additional global paths, legacy gateway.env exclusion, and explicit undefined cwd selection are preserved; parsing, workspace filtering, fs-safe normalization, and first-wins application remain with their existing owners. (src/infra/dotenv-paths.ts:16, 8d72643069ba)
  • Real help behavior evidence: The complete supplied PR body binds five rebuilt real CLI help samples to the current head on macOS arm64 with Node 26.5.0: first-output p50/p95 115.313/117.556 ms, exit p50/p95 121.396/123.670 ms, and five successful exits. The benchmark writes inert plugin configuration and launches the actual help entrypoint. Historical matched runs additionally report 687.709→79.073 ms with identical stdout; that comparison is explicitly historical. Reviewer execution was not performed. (scripts/bench-cli-startup.ts:313, 8d72643069ba)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Michael Appel: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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 (10 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-15T09:44:44.507Z sha 918461e :: needs maintainer review before merge. :: none
  • reviewed 2026-09-20T02:05:14.419Z sha 785794a :: needs maintainer review before merge. :: none
  • reviewed 2026-09-20T04:46:17.020Z sha 75ca887 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-22T19:38:22.738Z sha 6843c79 :: needs changes before merge. :: none
  • reviewed 2026-09-22T21:15:05.863Z sha 6843c79 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-26T16:48:19.067Z sha 033ef94 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-01T09:24:43.552Z sha 91902d0 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-01T10:48:48.142Z sha 91902d0 :: needs maintainer review before merge. :: none

@baisiqi6

baisiqi6 commented Oct 1, 2026

Copy link
Copy Markdown
Contributor Author

Agent provenance: UNVERIFIED / Codex · role=Reporter · acting_for=OpenClaw dogfood Operator

At head 91902d02257af69bf775b7a35f9c8cb618d5a15b, CI run 36841763820 finished with 77 successful, 23 skipped, and 2 failed jobs.

The direct failure is checks-fast-baseline-ratchets: pnpm check:database-worker-ratchet --base refs/remotes/origin/ci-ratchet-base exits with spawnSync rg ENOENT. This occurs during executable lookup, before the database ratchet comparison. The aggregate CI gate fails subsequently. The checker and workflow paths have no candidate delta against integrated upstream 2ad1dd0254; why ripgrep was unavailable in this runner/PATH remains unproven.

Could a maintainer check ripgrep availability and the system-tool bootstrap for this lane, then validate the lane through its normal CI recovery process? No CI/workflow changes are included in this root-help patch. ClawSweeper Revision 10 found no correctness/security blocker on this head; CI still requires resolution before merge.

roboclaw-bot added a commit that referenced this pull request Nov 3, 2026
Keep root help and version from starting configured plugin runtimes. Use core-only config inspection and manifest CLI descriptors, removing the legacy root-help registration fallback. Legacy command execution remains available.

Migrate the source metadata caller and replace mocked help checks with real entrypoint coverage. Production LOC -25; test LOC -1; no test-ceiling increase.

Validated with an exact-main counterfactual (two expected loader-count failures), four green help/version cases, seven focused test files, touched-file lint/format, and clean P0-P2 autoreview. Native GitHub gates enforce final-head CI before merge.

Supersedes #147932, thanks @baisiqi6.

Co-authored-by: baisiqi6 <[email protected]>
@roboclaw-bot

Copy link
Copy Markdown
Collaborator

Thanks @baisiqi6 for tracking this down! Superseded by the merged #191681, with your co-author credit preserved. The core fix keeps root help/version from starting plugin runtimes and lists plugin commands from manifest metadata, with loader-count regression coverage.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 4, 2026
Keep root help and version from starting configured plugin runtimes. Use core-only config inspection and manifest CLI descriptors, removing the legacy root-help registration fallback. Legacy command execution remains available.

Migrate the source metadata caller and replace mocked help checks with real entrypoint coverage. Production LOC -25; test LOC -1; no test-ceiling increase.

Validated with an exact-main counterfactual (two expected loader-count failures), four green help/version cases, seven focused test files, touched-file lint/format, and clean P0-P2 autoreview. Native GitHub gates enforce final-head CI before merge.

Supersedes openclaw#147932, thanks @baisiqi6.

Co-authored-by: baisiqi6 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: L 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.

perf(cli): root help costs ~35x more when the config has a plugins key, for byte-identical output

2 participants