fix(cli): accept parent options placed after lazy subcommands (#55563 regression 1) [AI-assisted]#94431
Conversation
|
Codex review: found issues before merge. Reviewed July 1, 2026, 5:40 PM ET / 21:40 UTC. Summary PR surface: Source +212, Tests +296. Total +508 across 5 files. Reproducibility: yes. Source inspection shows docs still publish the after-subcommand browser-profile order, --browser-profile remains a browser parent option, and current lazy reparse has no parent-option hoist; the PR body also includes before/after terminal and focused test output. Review metrics: 2 noteworthy metrics.
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: Rebase or resolve conflicts by layering the parent-option hoist onto current main's full nested fallback reconstruction, then land with focused parser and browser lazy regression coverage. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows docs still publish the after-subcommand browser-profile order, --browser-profile remains a browser parent option, and current lazy reparse has no parent-option hoist; the PR body also includes before/after terminal and focused test output. Is this the best way to solve the issue? No at the current head. The reparse layer is the right place for the fix and the missing-value edge case is now covered, but the branch must preserve current-main nested fallback reconstruction before it is the best mergeable solution. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against eb417fa206e6. Label changesLabel justifications:
Evidence reviewedPR surface: Source +212, Tests +296. Total +508 across 5 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
Review history (1 earlier review cycle)
|
|
@clawsweeper re-review Pushed commit 83bf422 addressing the P2 finding ("Preserve missing parent option errors" at src/cli/program/helpers.ts:172): a bare parent value option with no following value is no longer hoisted alone, so Commander's missing-value error is preserved instead of the next token being swallowed as the option value. Added 3 helpers.test.ts + 2 browser-cli.lazy.test.ts regression cases for the missing-value paths; focused lazy CLI tests, oxlint on touched files, and git diff --check all pass. PR body updated with the missing-value after-fix evidence. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
Co-authored-by: ml12580 <[email protected]>
|
Maintainer verification complete; thanks @ml12580 for the original fix and reproduction. What changed in the maintainer rewrite:
How I tested it:
The tempting one-line |
|
Merged via squash.
|
…aw#55563 regression 1) [AI-assisted] (openclaw#94431) * fix(cli): restore lazy parent option ordering Co-authored-by: ml12580 <[email protected]> * chore: defer release-owned changelog entry --------- Co-authored-by: Peter Steinberger <[email protected]>
…aw#55563 regression 1) [AI-assisted] (openclaw#94431) * fix(cli): restore lazy parent option ordering Co-authored-by: ml12580 <[email protected]> * chore: defer release-owned changelog entry --------- Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
OpenClaw v2026.3.24 enabled Commander's positional-option mode. That made this previously shipped and documented invocation fail during lazy command reparse:
--browser-profilebelongs to thebrowserparent, but the second parse happens only aftertabshas replaced its lazy placeholder. Positional mode then treats the trailing flag as atabsoption. This is Regression 1 of #55563 and breaks existing WSL2/remote-CDP troubleshooting commands. Regression 2 in that issue (doctor --fixgateway cycling) is separate and intentionally untouched.Why This Change Was Made
The contributor patch established the right normalization point. I rewrote it around one invariant: after the real lazy subtree loads, restore parent-option placement only when the selected child path does not own the same flag.
The final parser:
browser extension pair --jsonand cookie--url;--terminator.Simply disabling positional options on
browserwas rejected: Commander 15 would make the parent steal colliding leaf flags. That would fix the reported command by breaking currently valid child behavior.User Impact
Both supported orderings work again:
The same repair applies to nested lazy commands such as
browser tab new --browser-profile remote. Existing child-option ownership remains unchanged. No config, protocol, auth, network, or migration surface changes.Evidence
Dependency contract checked directly against Commander 15.0.0 source and types: positional parent options after a subcommand are intentionally disabled, and disabling positional mode would restore parent capture at the cost of child collisions.
Blacksmith Testbox provider/id:
blacksmith-testbox/tbx_01kwxpxmb3x1g1prnaa9cs4230.pnpm test src/cli/program/action-reparse.test.ts src/cli/program/register.subclis.test.ts— 32 passed.pnpm test extensions/browser/src/cli/browser-cli.lazy.test.ts extensions/browser/src/cli/browser-cli-extension.test.ts extensions/browser/src/cli/browser-cli-state.option-collisions.test.ts— 26 passed.pnpm check:changed -- CHANGELOG.md src/cli/program/action-reparse.ts src/cli/program/action-reparse.test.ts extensions/browser/src/cli/browser-cli.lazy.test.ts— passed all selected type, lint, docs, and repository guards before the release-owned changelog line was removed by the landing guard.pnpm build— passed, including CLI bootstrap/import guards, runtime postbuild, plugin assets, and Control UI build.Release-note context and contributor credit are retained here. Root
CHANGELOG.mdis release-owned, so the native landing guard correctly kept it out of this normal PR.