fix(cli): accept launcher flags after dashboard command - #39108
Conversation
12b1c3f to
34583fa
Compare
Review FindingsOverall: Needs rebasing onto main + has a correctness bug in the original hoisting logic Issue 1: Hoisting ignores subcommand-native options (blocker)The PR version of
A follow-up fix ( Issue 2: Tests use outdated 2-parameter APIThe test file calls Issue 3: Minor —
|
Review: Post-subcommand flag hoistingVerdict: Approve (with follow-up suggestions) What works
Follow-up suggestions (non-blocking)1. Subcommand flag collision avoidance — If a subcommand defines its own 2. Position-0 blind spot — 3. Test gap — The |
Review Summary (self-review, OmarB97)Verdict: Approve with 1 concern for follow-up. What works
Concerns (non-blocking)Subcommand option collision risk (suggestion): The hoisting function does not check whether a flag is native to the subcommand before extracting it. If a future subcommand defines --dev, --tui, or any flag in the hoistable sets, the hoister would incorrectly pull it before the subcommand. The main branch has already addressed this with subcommand_option_strings plus native_options awareness. Consider backporting that improvement to this PR before merge, or ensure the follow-up lands immediately after. Minor test gaps (info): Missing test for short-form hoisting after subcommand, and no test verifying that a value flag without a following value stays in remainder gracefully. Low priority. No blockers found. |
Review SummaryVerdict: Approve (with non-blocking suggestions below) The PR correctly solves the reported problem: What Works Well
Non-blocking Suggestions
|
Review SummaryVerdict: Approve with minor suggestions (non-blocking). What the PR doesAdds to move known top-level launcher flags (like , , ) that appear after a subcommand (e.g., ) to before the subcommand. Fixes argparse rejecting parent-parser options that trail the subcommand. Correctness
Non-blocking suggestions
No blockers found.The change is well-contained, conservative, and solves the reported issue. |
Review SummaryVerdict: Approve with minor suggestions (non-blocking). What the PR doesAdds Correctness
Non-blocking suggestions
No blockers found.The change is well-contained, conservative, and solves the reported issue. |
Review: fix(cli): accept launcher flags after dashboard commandOverall: Looks good. Conservative, well-scoped fix that solves the reported issue. Findings1. Missing test for value flag hoisting (suggestion) 2. includes (suggestion) Wait — actually, the scanning loop for finding the command does: For , it starts with , is NOT in , so — it correctly skips over it. The next token would be which IS in known_cmds. So this works correctly. 3. Edge case: consumed as skills value (info) 4. No test for the full integration path (suggestion) |
Review: fix(cli): accept launcher flags after dashboard commandOverall: Looks good. Conservative, well-scoped fix that solves the reported issue. Findings1. Missing test for --provider value flag hoisting (suggestion) 2. Edge case: 3. No test for the full integration path (suggestion) 4. Test uses |
Review: Post-subcommand flag hoisting (hermes-local-longctx-ko-mac)Verdict: Approve (non-blocking follow-ups noted) What works
Follow-up (non-blocking)1. Test gap: inline value syntax — No test for 2. Test gap: position-0 after subcommand — 3. Branch has accumulated unrelated changes — The branch diff vs main includes workflow files, website content, model catalog updates, desktop app changes, and achievement JSON. These are unrelated to the flag hoisting fix. Consider squashing or cherry-picking only the relevant commit for a cleaner review surface. 4. Verdict: The core approach is sound and addresses the reported issue (argparse rejecting parent-level flags after subcommand). Merge with the understanding that test coverage could be expanded in follow-up. |
Review: fix(cli): accept launcher flags after dashboard commandVerdict: Approve (with non-blocking suggestions below) SummaryClean implementation that solves the real problem: argparse rejecting global flags placed after subcommand names. The approach of post-hoc argv reordering before argparse sees it is the right call - avoids touching every subparser and is conservative about what gets hoisted. Strengths
Non-blocking suggestions
Alignment with task goalDesktop invoked No blocking issues found. Ready to merge. |
|
Closing: the motivating rc-2 crash was fixed upstream in 2820d87 (hidden accepted-and-ignored --tui on the dashboard subparser, now in hermes_cli/subcommands/dashboard.py), and the per-subparser tolerance approach maintainers chose makes the generic post-subcommand flag hoisting here a separate behavior-change proposal. If the generic hoist is still wanted it deserves a fresh feat(cli) PR with its own motivation. |
Summary
hermes dashboard --no-open --tui--tuiand--skills ... --tuion dashboard launchesRoot Cause
The macOS desktop app can launch the local backend as
dashboard ... --tui.--tuiis a top-level Hermes flag, but argparse rejected it after thedashboardsubcommand, causing the backend to exit with rc 2 before readiness.Validation
python -m pytest tests/hermes_cli/test_default_interface_resolution.py tests/hermes_cli/test_subparser_routing_fallback.py tests/hermes_cli/test_startup_plugin_gating.py -qpython -m hermes_cli.main dashboard --status --tui~/.hermes/hermes-agentcherry-pick:venv/bin/python -m pytest tests/hermes_cli/test_default_interface_resolution.py tests/hermes_cli/test_subparser_routing_fallback.py tests/hermes_cli/test_startup_plugin_gating.py -q/api/statusreturnedgateway_running=True,gateway_state=running/api/wsprobe opened and receivedgateway.ready/Applications/Hermes.apprelaunch opened pastCONNECTINGinto the chat shell with backend commanddashboard --no-open --tui --host 127.0.0.1 --port 9120Related
Fork PR: OmarB97#79.
OmarB97#76 / #38446 is separate and still needed for macOS bootstrap installer re-signing after copying to
~/.hermes; it is not this dashboard argument-order crash.