perf(cli): skip config load for default root help#85396
Conversation
|
Codex review: found issues before merge. Reviewed June 24, 2026, 7:50 AM ET / 11:50 UTC. Summary PR surface: Source +66, Tests +127. Total +193 across 2 files. Reproducibility: yes. Source inspection on current main shows default root help still imports the config facade and reads a snapshot before precomputed help can render; the PR body also includes copied live before/after CLI startup output. Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Replay the fast path onto current main, preserve the current-main root-help predicate unless maintainers intentionally change it, then rerun focused root-help tests and Dependency Guard before landing. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection on current main shows default root help still imports the config facade and reads a snapshot before precomputed help can render; the PR body also includes copied live before/after CLI startup output. Is this the best way to solve the issue? Yes, with a refresh. The root-help live-config probe is the right layer for this optimization, but the branch must be replayed over current main to avoid stale predicate drift. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1069c60e1e25. Label changesLabel justifications:
Evidence reviewedPR surface: Source +66, Tests +127. Total +193 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
|
|
ClawSweeper PR egg ✨ Hatched: 🌱 uncommon Tiny Proofling Hatch commandComment Hatchability rules:
Rarity: 🌱 uncommon. What is this egg doing here?
|
|
Companion benchmark-harness PR: #85400 adds saved-report comparison to . I used this PR's before/after outputs as the smoke proof for the new comparison mode. |
|
Correction to the previous note: #85400 uses this PRs saved |
|
Updated this PR to keep the root-help fast path aligned with the legacy runtime dotenv loader. Fix:
Checks:
|
|
@clawsweeper re-review The legacy |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review PR body proof format has now been updated with the required behavior/environment/steps/evidence/observedResult/notTested fields. Please re-check the fixed head c553706. |
|
🦞👀 Command router queued. I will update this comment with the next step. Re-review progress:
|
|
@clawsweeper re-review Rebuilt the branch on current main and replayed only the root-help source/test changes, with no shrinkwrap deltas. Focused checks passed: |
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Heads up: this PR needs to be updated against current |
|
This pull request has been automatically marked as stale due to inactivity. |
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: perf(cli): skip config load for default root help This is item 1/1 in the current shard. Shard 0/31. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
|
Closing due to inactivity. |
Summary
openclaw --helpwhen there is no config file, no OpenClaw dotenv file, and no plugin-help-affecting env override~/.config/openclaw/gateway.envruntime dotenv compatibility path in the fast-path precheck unless an explicit non-defaultOPENCLAW_STATE_DIRis activeWhy
The root help fast path has precomputed help text, but it still called
readConfigFileSnapshot()first to see whether plugin config could affect help output. In a default/no-config invocation that dragged in config validation before printing static help.Real behavior proof
Behavior or issue addressed: default
openclaw --helpstartup no longer imports the full config/validation stack when no config, dotenv, or plugin-help-affecting env can change static root help output. Plugin-sensitive help still uses the live config path, including legacy~/.config/openclaw/gateway.envand the.envfile beside an explicitOPENCLAW_CONFIG_PATH.Real environment tested: local OpenClaw checkout on Linux, CLI startup artifacts built with
node scripts/build-all.mjs cliStartup, isolated temporary HOME/state directories, real CLI startup measured withnode scripts/bench-cli-startup.ts --case help, and focused Vitest regression coverage on the pushed PR head4b2c49f3.Exact steps or command run after this patch:
node scripts/build-all.mjs cliStartup.node scripts/bench-cli-startup.ts --case help --runs 3 --warmup 0 --timeout-ms 10000 --json.node scripts/bench-cli-startup.ts --case help --runs 5 --warmup 0 --timeout-ms 10000 --json.~/.config/openclaw/gateway.env, explicit customOPENCLAW_STATE_DIRexclusion, and explicitOPENCLAW_CONFIG_PATHsidecar.envhandling.Evidence after fix:
Observed result after fix: default root help improved by 1072.3ms (-96.0%) and 209.9MB RSS (-79.5%) in the isolated real CLI startup sample. The focused regression suite now passes 6/6 and covers the legacy
gateway.envcompatibility path, custom state-dir exclusion, and explicit config-path sidecar.envpath. The shrinkwrap guard now reports current generated files after regeneration.What was not tested: full repository CI was not run locally. GitHub Actions is still the broad merge gate after the pushed PR head.
Tests
node scripts/test-projects.mjs src/cli/root-help-live-config.test.ts- passed, 5/5 after the legacygateway.envrepaircorepack pnpm exec oxfmt --write --threads=1 src/cli/root-help-live-config.ts src/cli/root-help-live-config.test.ts(commit hook)git diff --check HEAD~1..HEAD -- src/cli/root-help-live-config.ts src/cli/root-help-live-config.test.ts- passed after the follow-up repairHygiene
Related follow-up to #85353 and #85368; this is the startup/init overhead bucket outside media provider discovery.