Repository navigation
fix(cli): honor profile selection before cached help - #133148
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 4:10 AM ET / 08:10 UTC. ClawSweeper reviewWhat this changesThe branch delegates cached command help with leading Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessThe focused repair is correct: it keeps selector-bearing help on the existing runtime-owned validation path, while selector-free static help remains cached. This active maintainer-labeled PR should remain open for normal landing review. Priority: P2 Review scores
Verification
How this fits togetherThe launcher may print precomputed command help before loading the CLI runtime. Profile and development selectors change the runtime configuration context, so those invocations must reach the runtime before help is rendered. flowchart LR
A[CLI arguments] --> B[Launcher help recognizer]
B -->|Static selector-free help| C[Precomputed help]
B -->|Profile or development selector| D[CLI runtime]
D --> E[Profile validation and configuration]
E --> F[Profile-aware help or diagnostics]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +37, Other -8. Total +29 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Land the launcher-only delegation so profile-sensitive help and selector errors consistently use the established runtime parser without changing the selector-free help fast path. Do we have a high-confidence way to reproduce the issue? Yes—the current-main launcher scan demonstrably consumes leading profile tokens before cached-help selection, and the supplied installed-package cases exercise the affected forms. This read-only review did not rerun the package scenario. Is this the best way to solve the issue? Yes—the runtime already owns profile parsing, validation, and environment projection, so rejecting those selectors from the launcher cache is the narrow canonical repair. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a3b5ce6d2c7b. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles) |
bf73640 to
ad92a49
Compare
|
Merged via squash.
|
Closes #133145
What Problem This Solves
Fixes an issue where users requesting help with a leading
--profileor--devselector would see cached commands from the wrong profile. For example,openclaw --profile work nodes --helpadvertised Canvas even when that profile disabled it, while the same selector after the command worked. Invalid or conflicting leading selectors also returned successful cached help instead of their normal errors.Why This Change Was Made
Profile validation and environment projection remain owned by the runtime entry. The launcher now delegates profile-bearing help to that existing flow before choosing cached output. Its help recognizer uses one leading-option scan and one help-only tail check, removing the parallel command/help state without changing the shared Gmail option parser.
User Impact
Help reflects the selected profile's plugin availability, and malformed profile selections retain their normal diagnostics and exit status. Bare help, version, and passive root-option fast paths remain available. No configuration, dependency, persistent-state, protocol, or plugin SDK contract changes are introduced.
Evidence
Baseline package from
3f1c84c706bf1e4c8bc7b2ab106ab96ff1fe6ddbbuilt with the repository packer and installed with npm in a clean isolated Linux Testbox prefix/home. Eight cases reproduced stale plugin help or swallowed selector errors. Distinct custom config/state overrides and default/trailing-selector controls were checked separately.New launcher boundary regression: all eight cases failed before the repair because cached text bypassed the runtime entry.
Final launcher and version files: 64 tests passed; one existing Bun-specific test was unavailable/skipped. Command:
node scripts/run-vitest.mjs test/openclaw-launcher.e2e.test.ts test/openclaw-launcher-version.e2e.test.ts.Full
check:changedpassed all 24 stages on the exact committed head, including all production/test type checks, full lint, repository guards, and zero runtime import cycles. Targeted lint, formatting, JavaScript syntax, and whitespace checks also passed. Fresh autoreview reported scoped-clean; independent source review confirmed the canonical ownership boundary and unchanged sibling grammar.Production delta: +14/-22, net -8 lines. Test delta: +38/-1.
Final clean committed-ref package proof passed on Blacksmith Testbox: run 33298420827. The repository packer built and validated the tarball, npm installed it into a fresh prefix/home, and all 17 assertions passed: default/root help, named/default/dev selection, trailing selection, inherited canonical paths, distinct custom config/state overrides, static help, invalid/conflicting selectors, and version. Source HEAD and packaged build commit both equal
bf7364077f48366c3008b6634af2c3b3afd8c318; source and installed launcher hashes match. Tarball SHA-256:4c26f3304bddcf804aa7cc8f514b7a7b2c4dd8f18241f7c33faabbfe16948520. The owned testbox was stopped after evidence collection.Provenance: the defect is reachable in stable tag
v2026.7.1-2; its introducing commit is unknown because available history is shallow. A separately observed environment-onlyOPENCLAW_PROFILEprojection mismatch is outside this repair; this PR does not claim to fix it.Hosted integration CI is now green; native landing gates remain. The original CI run failed on an unrelated missing Code Mode metadata export in main. A subsequent draft-to-ready run reused that old merge tree, as verified from its actual preflight checkout; cancellation was requested for that obsolete run. The mechanical refresh is now
ad92a490ce2a9b2b17978608e4f7ca86b329c803, directly based on the canonical repairbe5e79ca4713c33a11ccd56b2d728c19f0779f3d. The source/test patch ID and both file blobs match the package-tested commit; the relevant entry/profile/config-owner files are also unchanged. Fresh exact-commit autoreview is clean. New integration CI actually checked out merge03290e3a3659a2b7bdc3438b4c9896d6618a2894, whose parents include this refreshed head, so the repaired ancestry is verified. The full check watcher completed successfully with zero pending or failing checks. Native review, prepare, and merge gates remain before landing.Suggested release note: CLI: honor profile and development selection before cached command help so plugin availability and selector errors match the normal runtime.
Latest ClawSweeper disposition: the exact-head review found no code or security findings and accepted the installed-package proof. Its incomplete-CI item is resolved by the green integration run; the linked issue remains open until this PR lands.