Skip to content

perf(cli): speed up onboarding help startup#84488

Merged
frankekn merged 4 commits into
mainfrom
perf-02-setup-onboard-configure-help
May 21, 2026
Merged

perf(cli): speed up onboarding help startup#84488
frankekn merged 4 commits into
mainfrom
perf-02-setup-onboard-configure-help

Conversation

@frankekn

@frankekn frankekn commented May 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • lazy-load setup/onboard/configure action runtime so command help construction stays light
  • add a scoped run-main help fast path for setup/onboard/configure without changing help output
  • preserve dynamic provider auth flags in onboard --help
  • add cold-import and run-main coverage for these help paths

Verification

  • pnpm build
  • pnpm test src/cli/help-cold-imports.test.ts src/cli/run-main.exit.test.ts src/cli/run-main.test.ts -- --reporter=default
  • pnpm test src/commands/configure.commands.test.ts src/commands/onboard*.test.ts src/commands/setup*.test.ts -- --reporter=default
  • pnpm tsgo
  • pnpm check:changed
  • exact help-output diff vs OPENCLAW_DISABLE_CLI_STARTUP_HELP_FAST_PATH=1: no diff for setup/configure/onboard

Benchmark

Command:
pnpm test:startup:bench -- --case configureHelp --case onboardHelp --case setupHelp --runs 3 --warmup 1 --json --output .artifacts/perf-onboarding-help-after.json

Before artifact: .artifacts/perf-onboarding-help-check.json
After artifact: .artifacts/perf-onboarding-help-after.json

Command Before avg Before p95 Before RSS avg After avg After p95 After RSS avg Avg change RSS change
configure --help 722.6ms 731.4ms 389.4MB 210.4ms 210.6ms 240.0MB -70.9% -149.5MB
setup --help 438.8ms 443.8ms 327.9MB 206.4ms 209.7ms 239.9MB -52.9% -88.0MB
onboard --help 714.6ms 731.1ms 332.3MB 502.3ms 507.7ms 272.4MB -29.7% -59.9MB

Control baseline from .artifacts/perf-onboarding-help-control.json:

  • root --help: avg 24.0ms, RSS avg 46.6MB
  • browser --help: avg 23.9ms, RSS avg 46.5MB

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: M maintainer Maintainer-authored PR labels May 20, 2026
@clawsweeper

clawsweeper Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

Workflow note: Future ClawSweeper reviews update this same comment in place.

How this review workflow works
  • 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.

Summary
The PR lazy-loads setup/onboard/configure action runtimes, adds a scoped help fast path for those commands, updates focused CLI tests, and records the performance fix in the changelog.

Reproducibility: no. high-confidence runtime reproduction was established in this read-only pass. Source inspection shows current main eagerly imports setup/onboard/configure action/runtime modules during command registration, and the PR body provides benchmark and help-diff commands.

PR rating
Overall: 🐚 platinum hermit
Proof: 🌊 off-meta tidepool
Patch quality: 🐚 platinum hermit
Summary: Focused maintainer PR with coherent implementation, targeted tests, benchmark data in the body, and no blocking source-review findings.

Rank-up moves:

  • Confirm the listed build, focused tests, help-output parity, and startup benchmark on the merge candidate before landing.
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

Real behavior proof
Not applicable: The external contributor proof gate does not apply to this member-authored, maintainer-labeled PR; the body includes verification commands, help-output parity, and benchmark results.

Risk before merge

  • This read-only pass did not rerun the listed build, focused tests, exact help-output diff, or startup benchmark; merge should rely on CI or maintainer-local validation on the merge candidate.

Maintainer options:

  1. Decide the mitigation before merge
    Land the scoped fast path after maintainer or CI validation confirms setup/onboard/configure help-output parity, focused tests, and benchmark results on the merge candidate.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge
The maintainer label and member authorship keep this in protected maintainer review; no narrow automation repair defect was found.

Security
Cleared: The diff is limited to CLI TypeScript, tests, and changelog text and does not introduce concrete security or supply-chain risk.

Review details

Best possible solution:

Land the scoped fast path after maintainer or CI validation confirms setup/onboard/configure help-output parity, focused tests, and benchmark results on the merge candidate.

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

No high-confidence runtime reproduction was established in this read-only pass. Source inspection shows current main eagerly imports setup/onboard/configure action/runtime modules during command registration, and the PR body provides benchmark and help-diff commands.

Is this the best way to solve the issue?

Yes, based on source review. The patch keeps existing command registration and shared help formatting as the source of truth, while moving only action/runtime imports behind execution and adding a narrow run-main help path.

Label justifications:

  • P3: This is a scoped CLI startup performance improvement with limited blast radius and no urgent regression signal.
  • rating: 🐚 platinum hermit: Current PR rating is 🐚 platinum hermit because proof is 🌊 off-meta tidepool, patch quality is 🐚 platinum hermit, and Focused maintainer PR with coherent implementation, targeted tests, benchmark data in the body, and no blocking source-review findings.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The external contributor proof gate does not apply to this member-authored, maintainer-labeled PR; the body includes verification commands, help-output parity, and benchmark results.

What I checked:

  • Protected live PR context: Provided GitHub context shows the PR is open, author association is MEMBER, labels include maintainer and cli, and head SHA is b3b086e. (b3b086e6d8ca)
  • Current main eager configure imports: Current main statically imports configureCommandFromSectionsArg and defaultRuntime while registering configure, so help construction pulls action/runtime code before the action runs. (src/cli/program/register.configure.ts:2, 258524973798)
  • Current main eager onboarding imports: Current main statically imports setupWizardCommand and defaultRuntime while registering onboard, while also preserving manifest-backed provider auth flags for help output. (src/cli/program/register.onboard.ts:14, 258524973798)
  • Current main eager setup imports: Current main statically imports setupWizardCommand, setupCommand, and defaultRuntime while registering setup, matching the PR's targeted startup path. (src/cli/program/register.setup.ts:2, 258524973798)
  • PR fast-path implementation: The PR adds tryOutputSetupOnboardConfigureHelp, creates a small Commander program with the shared help configuration, registers only the requested command, and parses the help invocation before full command registration. (src/cli/setup-onboard-configure-help-fast-path.ts:64, b3b086e6d8ca)
  • PR coverage: The PR diff adds cold-import checks for configure/setup/onboard help plus run-main policy and exit-path coverage for the new startup shortcut. (src/cli/help-cold-imports.test.ts:213, b3b086e6d8ca)

Likely related people:

  • @steipete: Current blame and shortlog show Peter Steinberger carrying much of the CLI registration, run-main, and help infrastructure touched by this PR. (role: recent area contributor; confidence: high; commits: 9c5e8eb4950e, a185ca283a74, 1e6e68534786; files: src/cli/run-main.ts, src/cli/run-main-policy.ts, src/cli/program/help.ts)
  • @vincentkoc: History shows Vincent Koc worked on CLI startup memory and static onboard auth choice help, both adjacent to this help-startup path. (role: adjacent CLI startup contributor; confidence: medium; commits: 67b2d1b8e82e, dd2eb2903845, 74e7b8d47b18; files: src/cli/run-main.ts, src/cli/program/register.onboard.ts)
  • @gumadeiras: History shows Gustavo Madeira Santana contributed descriptor-backed lazy root command registration and root-help non-activating behavior near this performance boundary. (role: adjacent lazy CLI registration contributor; confidence: medium; commits: 9b4f26e70af0, e5dac0c39e91; files: src/cli/run-main.ts, src/cli/program/command-registry.ts)

Codex review notes: model gpt-5.5, reasoning high; reviewed against 258524973798.

@clawsweeper clawsweeper Bot added 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. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels May 20, 2026
@clawsweeper

clawsweeper Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

✨ Hatched: 🥚 common Pearl Patch Peep

Hatch command

Comment @clawsweeper hatch when this PR is hatchable.

Hatchability rules:

  • Merged PRs are hatchable.
  • Open PRs are hatchable when they are status: 👀 ready for maintainer look, status: 🚀 automerge armed, or labeled clawsweeper:automerge.
  • Closed unmerged PRs are hatchable only when one of those hatchable labels is still present in the durable record.

Rarity: 🥚 common.
Trait: finds missing screenshots.
Image traits: location workflow harbor; accessory proof snapshot camera; palette seafoam, black, and opal; mood proud; pose nestled inside a glowing shell; shell matte ceramic shell; lighting cool dashboard glow; background delicate sparkle particles.
Share on X: post this hatch
Copy: My PR egg hatched a 🥚 common Pearl Patch Peep in ClawSweeper.

What is this egg doing here?
  • Eggs appear after the PR passes real-behavior proof. It is here for vibes, not verdicts: it does not change labels, ratings, merge decisions, or automation.
  • The shell reacts to review momentum: open follow-up work warms it up, re-review makes it wobble, and a clean final review lets it hatch.
  • Hatchability usually comes from sufficient real-behavior proof, no blocking P0/P1/P2 findings, no security attention needed, and clean correctness. A merged PR is already final, so merge makes the egg hatchable independently.
  • The hatch is seeded from this repository and PR number, so the same PR keeps the same creature; the reviewed head SHA can only change safe visual details.
  • Rarity is just collectible sparkle: 🥚 common, 🌱 uncommon, 💎 rare, ✨ glimmer, and 🌈 legendary.

@frankekn frankekn self-assigned this May 20, 2026
@frankekn frankekn force-pushed the perf-02-setup-onboard-configure-help branch from b396753 to ca3d6cf Compare May 21, 2026 02:28
@frankekn frankekn force-pushed the perf-02-setup-onboard-configure-help branch from 225c092 to b3b086e Compare May 21, 2026 03:08
@frankekn frankekn merged commit 2c0c9c9 into main May 21, 2026
99 checks passed
@frankekn frankekn deleted the perf-02-setup-onboard-configure-help branch May 21, 2026 03:22
@frankekn

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Thanks @frankekn!

SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 24, 2026
Merged via squash.

Prepared head SHA: b3b086e
Co-authored-by: frankekn <4488090+frankekn@users.noreply.github.com>
Co-authored-by: frankekn <4488090+frankekn@users.noreply.github.com>
Reviewed-by: @frankekn
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 24, 2026
Merged via squash.

Prepared head SHA: b3b086e
Co-authored-by: frankekn <4488090+frankekn@users.noreply.github.com>
Co-authored-by: frankekn <4488090+frankekn@users.noreply.github.com>
Reviewed-by: @frankekn
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 24, 2026
Merged via squash.

Prepared head SHA: b3b086e
Co-authored-by: frankekn <4488090+frankekn@users.noreply.github.com>
Co-authored-by: frankekn <4488090+frankekn@users.noreply.github.com>
Reviewed-by: @frankekn
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
Merged via squash.

Prepared head SHA: b3b086e
Co-authored-by: frankekn <4488090+frankekn@users.noreply.github.com>
Co-authored-by: frankekn <4488090+frankekn@users.noreply.github.com>
Reviewed-by: @frankekn
galiniliev pushed a commit to galiniliev/openclaw that referenced this pull request May 25, 2026
Merged via squash.

Prepared head SHA: b3b086e
Co-authored-by: frankekn <4488090+frankekn@users.noreply.github.com>
Co-authored-by: frankekn <4488090+frankekn@users.noreply.github.com>
Reviewed-by: @frankekn
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
Merged via squash.

Prepared head SHA: b3b086e
Co-authored-by: frankekn <4488090+frankekn@users.noreply.github.com>
Co-authored-by: frankekn <4488090+frankekn@users.noreply.github.com>
Reviewed-by: @frankekn
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
Merged via squash.

Prepared head SHA: b3b086e
Co-authored-by: frankekn <4488090+frankekn@users.noreply.github.com>
Co-authored-by: frankekn <4488090+frankekn@users.noreply.github.com>
Reviewed-by: @frankekn
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
Merged via squash.

Prepared head SHA: b3b086e
Co-authored-by: frankekn <4488090+frankekn@users.noreply.github.com>
Co-authored-by: frankekn <4488090+frankekn@users.noreply.github.com>
Reviewed-by: @frankekn
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
Merged via squash.

Prepared head SHA: b3b086e
Co-authored-by: frankekn <4488090+frankekn@users.noreply.github.com>
Co-authored-by: frankekn <4488090+frankekn@users.noreply.github.com>
Reviewed-by: @frankekn
SYU8384 pushed a commit to SYU8384/openclaw that referenced this pull request Jun 3, 2026
Merged via squash.

Prepared head SHA: b3b086e
Co-authored-by: frankekn <4488090+frankekn@users.noreply.github.com>
Co-authored-by: frankekn <4488090+frankekn@users.noreply.github.com>
Reviewed-by: @frankekn
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
Merged via squash.

Prepared head SHA: b3b086e
Co-authored-by: frankekn <4488090+frankekn@users.noreply.github.com>
Co-authored-by: frankekn <4488090+frankekn@users.noreply.github.com>
Reviewed-by: @frankekn
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 P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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