fix(cli): accept --log-level after subcommands#93455
Merged
Merged
Conversation
This was referenced Jun 16, 2026
9 tasks
Contributor
Author
|
@clawsweeper re-review |
Contributor
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Member
|
land-ready verification:
|
Member
|
Merged via squash.
Thanks @ooiuuii! |
1 similar comment
Member
|
Merged via squash.
Thanks @ooiuuii! |
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jun 17, 2026
Merged via squash. Prepared head SHA: b6d3aa5 Co-authored-by: ooiuuii <[email protected]> Co-authored-by: vincentkoc <[email protected]> Reviewed-by: @vincentkoc
crh-code
pushed a commit
to crh-code/openclaw
that referenced
this pull request
Jun 18, 2026
Merged via squash. Prepared head SHA: b6d3aa5 Co-authored-by: ooiuuii <[email protected]> Co-authored-by: vincentkoc <[email protected]> Reviewed-by: @vincentkoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--log-level <level>is accepted before a subcommand, but Commander-owned command paths can reject it when callers append it after the subcommand, for exampleopenclaw doctor --lint --json --log-level debug.--no-colornormalization in fix(cli): accept --no-color after subcommands #93324.--log-level <level>and--log-level=<level>tokens back into the root option prefix before the final Commander parse.--log-levelwhile command-owned--log-level, required option values, missing values, and--positionals stay command-scoped.--, required option values such asagent --message --log-level, and the final Commander-metadata pass that avoids stealing command-owned--log-leveloptions.Linked context
No separate issue. This is a small follow-up to the CLI parser behavior fixed in #93324.
Real behavior proof (required for external PRs)
--log-level <level>after a subcommand could be parsed as an unknown command option instead of the root log-level override on final Commander command paths.fix/cli-log-level-subcommands, commit6d39dd1760, Nodev22.22.0, pnpm11.2.2, source rebuilt throughscripts/run-node.mjs.{"ok":true,"checksRun":22,"checksSkipped":0,"findings":[]}--log-level debugafterdoctorboolean flags and reaches doctor lint JSON output; Commander no longer rejects it as an unknown command option.2026.6.8-beta.1while the source package version is2026.6.2; the doctor lint proof still completed successfully.Tests and validation
Commands run:
Results:
Regression coverage added:
--log-level <level>and--log-level=<level>from unambiguous subcommand positions to the root option prefix.--profile work.--log-levelafter--positional.--log-levelcommand-scoped.agent --message --log-level debug.--log-levelafter boolean command flags without stealing command-owned--log-leveloptions.Risk checklist
Did user-visible behavior change? (
Yes/No)Yes. The CLI now accepts root
--log-level <level>after subcommands in valid unambiguous positions.Did config, environment, or migration behavior change? (
Yes/No)No.
Did security, auth, secrets, network, or tool execution behavior change? (
Yes/No)No.
What is the highest-risk area?
Accidentally treating a command-owned
--log-levelor a required option value as the root log-level override.How is that risk mitigated?
The early normalization remains conservative, the final parse uses Commander command metadata, and tests cover required-option values, command-owned option preservation, missing values, and the
--terminator.Current review state
What is the next action?
Wait for CI, ClawSweeper, and maintainer review.
What is still waiting on author, maintainer, CI, or external proof?
CI and ClawSweeper are pending after PR creation.
Which bot or reviewer comments were addressed?
Local autoreview was run before opening and reported no accepted/actionable findings.