Skip to content

test(cli): reduce redundant process launches - #118141

Merged
steipete merged 3 commits into
mainfrom
codex/test-performance-compact-small-6
Aug 2, 2026
Merged

steipete merged 3 commits into
mainfrom
codex/test-performance-compact-small-6

Conversation

@steipete

@steipete steipete commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • reduce the CLI process suite from 41 child launches to 12 representative lifecycle and entry-composition checks
  • move the exact secrets apply --from --help and required debug-proxy warning assertions to their direct owners
  • keep process-level coverage for help exit, lazy registration shutdown, trace flushing, dotenv/import ordering, respawn, raw output, and routed/Commander composition

Performance

  • warm help-exit.process.test.ts: 69.37s to 25.68s (63% faster)
  • child launches: 41 to 12 (71% fewer)

Proof

  • node scripts/run-vitest.mjs src/cli/secrets-cli.test.ts src/cli/precomputed-help.test.ts src/cli/help-exit.process.test.ts src/proxy-capture/coverage.test.ts — 53/53 passed across three test projects in 32.46s
  • full cli-process plan: 36/36 tests passed in 46.79s
  • git diff --check
  • oxfmt on touched files
  • autoreview: clean

Test-only change; no changelog entry.

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: L maintainer Maintainer-authored PR labels Aug 2, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Aug 2, 2026
@steipete
steipete force-pushed the codex/test-performance-compact-small-6 branch from fac2af3 to 39abf13 Compare August 2, 2026 19:28
@clawsweeper

clawsweeper Bot commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 2, 2026, 4:18 PM ET / 20:18 UTC.

ClawSweeper review

What this changes

This test-only PR reduces redundant CLI process launches by retaining representative lifecycle coverage and moving command-specific help fallback and debug-proxy warning checks to their direct owners.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep this PR open for protected maintainer handling. The prior coverage finding is addressed: the branch now proves both that the precomputed-help fast path declines secrets apply --from --help and that the registered secrets command treats --help as the required value, matching the old process assertion without retaining an extra child launch.

Priority: P2
Reviewed head: 87584e2a8f3bf61f90b6d7e719cbcc32fc430014
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, coherent test-only consolidation with the prior coverage concern addressed and credible terminal proof supplied.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The PR body records focused after-change terminal runs with 53/53 targeted tests and a full 36/36 CLI-process plan; the proof is appropriate for this non-visual test-suite change.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The PR body records focused after-change terminal runs with 53/53 targeted tests and a full 36/36 CLI-process plan; the proof is appropriate for this non-visual test-suite change.
Evidence reviewed 5 items Entry-point composition: runMainOrRootHelp returns early only when precomputed command help reports success; when it returns false, the same argv is passed to runCli, so the two replacement tests cover the two branches of the deleted process assertion.
Fast-path rejection coverage: The PR-head test verifies that secrets apply --from --help does not invoke precomputed secrets help, matching the fast-path condition needed for normal command parsing.
Commander outcome coverage: The PR-head secrets test asserts exit code 1, the Secrets plan file not found: --help diagnostic, and that apply is not executed—the observable outcome previously covered by the removed process test.
Findings None None.
Security None None.

How this fits together

The CLI entry point handles eligible help requests before loading the main command runtime; otherwise it passes the original argv to the normal Commander-based command tree. The PR keeps process tests for entry/lifecycle behavior while unit tests cover the secrets command parser and debug-proxy warning owner directly.

flowchart LR
  Args[CLI arguments] --> FastPath[Precomputed help fast path]
  FastPath -->|handled| Help[Help output and exit]
  FastPath -->|declines| Entry[CLI entry point]
  Entry --> Commander[Commander command parser]
  Commander --> Secrets[Secrets apply command]
  Secrets --> Error[Exit code and diagnostic]
  Entry --> Lifecycle[Process lifecycle checks]
Loading

Decision needed

Question Recommendation
Should a maintainer approve this protected CLI test-coverage consolidation now that the prior Commander fallback finding is covered by direct owner tests? Approve the coverage transfer: Accept the direct fast-path and secrets-command assertions as the canonical replacement for the removed child-process case.

Why: The patch has no remaining concrete correctness finding, but the maintainer label requires explicit human handling rather than an automated close or merge verdict.

Before merge

None.

Agent review details

Security

None.

PR surface

Tests -411. Total -411 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 4 69 480 -411
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 69 480 -411

Review metrics

None.

Stored data model

Persistent data-model change detected: serialized state: src/cli/help-exit.process.test.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Preserve the streamlined process suite and land the branch after the protected maintainer review confirms that the direct tests remain the canonical owners of the fast-path and secrets-parser contracts.

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

Not applicable: this is a test-only PR. The relevant verification is source-level comparison of the deleted process assertion with the replacement tests and entry-point composition.

Is this the best way to solve the issue?

Yes. The direct tests align with the ownership boundary: the precomputed-help test owns fast-path rejection, the secrets test owns Commander parsing and diagnostic behavior, and the process suite retains lifecycle coverage.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 3a2337ece4f9.

Labels

Label justifications:

  • P2: This is a bounded CLI test-suite consolidation whose main risk is regression-detection coverage rather than a direct runtime behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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 PR body records focused after-change terminal runs with 53/53 targeted tests and a full 36/36 CLI-process plan; the proof is appropriate for this non-visual test-suite change.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body records focused after-change terminal runs with 53/53 targeted tests and a full 36/36 CLI-process plan; the proof is appropriate for this non-visual test-suite change.

Evidence

What I checked:

  • Entry-point composition: runMainOrRootHelp returns early only when precomputed command help reports success; when it returns false, the same argv is passed to runCli, so the two replacement tests cover the two branches of the deleted process assertion. (src/entry.ts:285, 3a2337ece4f9)
  • Fast-path rejection coverage: The PR-head test verifies that secrets apply --from --help does not invoke precomputed secrets help, matching the fast-path condition needed for normal command parsing. (src/cli/precomputed-help.test.ts:30, 87584e2a8f3b)
  • Commander outcome coverage: The PR-head secrets test asserts exit code 1, the Secrets plan file not found: --help diagnostic, and that apply is not executed—the observable outcome previously covered by the removed process test. (src/cli/secrets-cli.test.ts:556, 87584e2a8f3b)
  • Prior-review repair provenance: The follow-up commit 87584e2a8f3bf61f90b6d7e719cbcc32fc430014 added the direct secrets assertion after the earlier ClawSweeper review requested preservation of the Commander fallback outcome. (src/cli/secrets-cli.test.ts:556, 87584e2a8f3b)
  • No production or supply-chain surface: The branch changes only four test files; it does not alter runtime source, dependencies, workflows, package metadata, or release configuration. (src/cli/help-exit.process.test.ts:1, 87584e2a8f3b)

Likely related people:

  • Shakker: Current-main history attributes the foundational CLI test and precomputed-help surfaces to the commit that introduced the surrounding behavior. (role: current CLI test and help-path contributor; confidence: high; commits: c0104d567582; files: src/cli/help-exit.process.test.ts, src/cli/precomputed-help.test.ts, src/cli/secrets-cli.test.ts)
  • Peter Steinberger: Recent history shows work on the same CLI process-test surface, and the follow-up commit contains the current repair for the prior fallback-coverage finding. (role: recent adjacent CLI test contributor; confidence: medium; commits: 8404f5fee373, 87584e2a8f3b; files: src/cli/help-exit.process.test.ts, src/cli/secrets-cli.test.ts)

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 (1 earlier review cycle)
  • reviewed 2026-08-02T19:33:08.708Z sha 39abf13 :: needs changes before merge. :: [P2] Preserve the Commander fallback assertion

@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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Aug 2, 2026
@steipete
steipete merged commit f4766de into main Aug 2, 2026
107 of 115 checks passed
@steipete
steipete deleted the codex/test-performance-compact-small-6 branch August 2, 2026 20:38
@juyterman1000

Copy link
Copy Markdown
Contributor

@steipete it might get a regression-detection gap, especially for the Commander fallback and JSON console path. Subsequent production regressions would be needed.

vincentkoc added a commit that referenced this pull request Aug 2, 2026
* origin/main:
  feat(gateway): track event-loop degradation persistence and add concurrency benchmark (#118193)
  fix(config): preserve secret ownership when configuration rows move (#118149)
  fix(cron): deliver failure alerts after persistence (#118200)
  chore(lint): clear 172 lint:all baseline violations in five batches (#118098)
  perf(gateway): remove streaming hot-path rescans (#118192)
  test(gateway): use in-memory task registry (#118191)
  test(macos): fix three races in the bounded process suites (#118196)
  refactor(migrate-hermes): consolidate test fixtures (#118182)
  test(android): share Wear transport fixtures (#118177)
  test(ui): deduplicate control UI e2e setup (#118180)
  fix(plugins): unblock prerelease validation (#118103)
  test(cli): reduce redundant process launches (#118141)
  test(gateway): compact terminal observer fixtures (#118179)
  fix(agents): make requested threads sidebar-visible (#118073)
  test(plugins): canonicalize native resolver fixtures (#118174)
  test: deduplicate agent runner fixtures (#118176)
  refactor(policy): consolidate doctor test fixtures (#118173)
  fix(plugins): remove disabled channel plugin configuration on uninstall (#118127)
  refactor(matrix): consolidate monitor test fixtures (#118175)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 3, 2026
* test(cli): reduce redundant process launches

* test(proxy): complete debug coverage fixture

* test(cli): preserve secrets help fallback

---------

Co-authored-by: Peter Steinberger <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 3, 2026
* origin/main:
  feat(gateway): track event-loop degradation persistence and add concurrency benchmark (openclaw#118193)
  fix(config): preserve secret ownership when configuration rows move (openclaw#118149)
  fix(cron): deliver failure alerts after persistence (openclaw#118200)
  chore(lint): clear 172 lint:all baseline violations in five batches (openclaw#118098)
  perf(gateway): remove streaming hot-path rescans (openclaw#118192)
  test(gateway): use in-memory task registry (openclaw#118191)
  test(macos): fix three races in the bounded process suites (openclaw#118196)
  refactor(migrate-hermes): consolidate test fixtures (openclaw#118182)
  test(android): share Wear transport fixtures (openclaw#118177)
  test(ui): deduplicate control UI e2e setup (openclaw#118180)
  fix(plugins): unblock prerelease validation (openclaw#118103)
  test(cli): reduce redundant process launches (openclaw#118141)
  test(gateway): compact terminal observer fixtures (openclaw#118179)
  fix(agents): make requested threads sidebar-visible (openclaw#118073)
  test(plugins): canonicalize native resolver fixtures (openclaw#118174)
  test: deduplicate agent runner fixtures (openclaw#118176)
  refactor(policy): consolidate doctor test fixtures (openclaw#118173)
  fix(plugins): remove disabled channel plugin configuration on uninstall (openclaw#118127)
  refactor(matrix): consolidate monitor test fixtures (openclaw#118175)
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 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. 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.

2 participants