Repository navigation
fix(cli): preserve option values and machine output - #116389
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 30, 2026, 8:16 AM ET / 12:16 UTC. ClawSweeper reviewWhat this changesThe PR changes OpenClaw’s Commander-based CLI so required dash-leading values are not mistaken for flags, parse-error hints use the active command path, baseline setup emits JSON, and explicit false onboarding choices retain user intent. Merge readinessKeep this PR open for normal protected maintainer review. The revised PR body now provides concrete after-fix CLI behavior proof, and the supplied patch consistently moves decisions from raw argv heuristics toward Commander’s parsed command state; no discrete regression introduced by the patch was established from the available evidence. Priority: P1 Review scores
Verification
How this fits togetherOpenClaw’s CLI parses shell arguments into Commander command trees, then applies startup, help, output-mode, setup, and onboarding behavior. This change sits at the parsing boundary and affects both interactive operators and scripts consuming machine-readable output. flowchart LR
A[Shell arguments] --> B[Commander command tree]
B --> C[Parsed command facts]
C --> D[Help and error guidance]
C --> E[JSON output routing]
C --> F[Setup and onboarding dispatch]
D --> G[Human CLI output]
E --> H[Machine-readable output]
F --> I[Requested setup flow]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +209, Tests +211. Total +420 across 25 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the Commander-owned parsing boundary, preserve the supplied regression coverage and real-process proof, and land only after a CLI owner confirms that existing uncommon option orderings keep their Commander-defined semantics. Do we have a high-confidence way to reproduce the issue? Yes, at medium confidence: the PR supplies specific command invocations, focused process tests, and a reported source-blind after-fix Testbox transcript, but this review could not independently execute the current-main reproduction path. Is this the best way to solve the issue? Mostly yes: deriving ownership from Commander’s parsed command state is narrower and less error-prone than reparsing raw argv, but normal owner review should still confirm behavior across current command factories and existing invocation patterns. AGENTS.md: unclear because the file could not be read completely. Codex review notes: model internal, reasoning high; reviewed against 3e7ecb3aeaaf. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
* origin/main: (99 commits) docs(automation): rename scheduled-tasks feature wording to Automations (#114855) feat(ui): finish cron -> Automations rename in visible strings (#114853) feat(cli): add openclaw automations alias and reword cron display prose (#114854) feat(agents): rename scheduler agent tool cron -> automations (#114841) fix(tui): preserve session state across switches and reconnects (#116399) feat(agents): report CLI command outcomes in channel progress fix(cli): preserve explicit option intent (#116389) fix(release): trust update restart harness (#116301) test(reef): remove false-green live guard smoke (#116393) test(comfy): evaluate live guards after setup (#116388) fix(heartbeat): serialize wake lifecycle state (#116351) test: remove redundant extension boundary wrapper (#116385) fix(test): bound Testbox agentic and extension suites (#115696) fix(ui): show the correct Threads page size (#116349) test(discord): align progress timing expectations (#116377) feat(ui): add composable skill references (#116330) fix(qa): prevent Slack cleanup from stalling profile runs (#116361) fix(ci): validate frozen release candidates faithfully (#116357) improve(ci): fail_fast option for release validation, off by default (#116352) fix(agents): compare shell tool names case-insensitively and stop re-parsing tool labels ...
What Problem This Solves
Fixes five CLI contract failures: required option values named
--helpor--jsonwere mistaken for flags, parse errors suggested help paths built from option values,setup --baseline --jsonemitted no JSON, and explicit false-valued onboarding controls silently entered a wizard that ignored them.Why This Change Was Made
Commander-owned parse facts now distinguish real options from consumed values, errors use the active command node instead of reparsing raw argv, baseline setup emits one structured result, and onboarding dispatch preserves explicit false provenance without treating omitted defaults as user intent. This is an AI-assisted maintainer QA fix.
User Impact
Automation can pass dash-leading values safely, machine-output modes remain trustworthy, parse errors point to real commands, baseline setup is scriptable, and documented negated/text-only onboarding flags reach the path that honors them.
Evidence
--helpworkspace while startup bootstrap was skipped;--jsonas a required value redirected human output to stderr.tbx_01kys7hva9qdktr7mchpekc70g: 381 focused tests across 10 CLI/setup/onboard files passed — https://github.com/openclaw/openclaw/actions/runs/30533059373check:changed: core/coreTests typecheck, format, lint, deadcode, cycles, and storage/security guards passed.7a9d2c3e; stable patch ID unchanged; final Codex autoreview found no accepted/actionable findings, confidence0.87.Source-blind CLI behavior proof
Validated exact head
cd3b5eeb85bf9fa7d71611b9a2582b269983076don Blacksmith Testboxtbx_01kysed0tp5zye9e1e77wryetk. The validator did not inspect source, diffs, tests, history, or credentials. Each probe used distinct temporary HOME/state/workspace paths, split stdout/stderr capture, a scrubbed environment, bounded timeouts, and cleanup; the Testbox was stopped afterward.openclaw setup --help: exit 0; setup usage/help on stdout; stderr empty.openclaw secrets apply --from --help: exit 1; stdout empty; stderr reports plan file--helpmissing, proving the token was consumed as the required value rather than activating help.openclaw secrets apply --from --json: exit 1; stdout empty; human stderr reports plan file--jsonmissing, proving JSON mode was not activated.openclaw status --timeout 5000 --wat: exit 1; stderr suggests exactlyopenclaw status --help; no syntheticstatus 5000path.openclaw setup --baseline --json: exit 0; stderr empty; stdout is exactly one parseable object containingok, config path/status, workspace path, and sessions path.onboard --no-tailscale-reset-on-exitandsetup --custom-text-inputboth displayed the classicOpenClaw setupwizard. Flaglessonboarddisplayed guided setup (“Hi — I’m OpenClaw… Setup choices”). PTY exits were intentional timeout 124 while awaiting user input.