Repository navigation
fix: refuse repeated single-value flags and correct CLI help - #107
Merged
Merged
Conversation
Four ledger listing defects found by the 2026-11-09 bug hunt: - One untrusted older result failed `results show latest`, `results artifact latest` and MCP `bridge_list_results` for every trusted result beside it. The store now splits results into trusted and untrusted; `latest` resolves to the newest trusted one (as `pro latest` does) and `bridge_list_results` lists the trusted ones with `untrusted_skipped` and each untrusted record's reason. Fetching an untrusted result by id still refuses. - `pro blockers --cwd` turned one corrupt result record into "No consults recorded in this repo." with rc=0. With --cwd the record's error now fails the command; across all roots the bad root is named on stderr and the others are still reported. - `sessions cancel <id>` stamped last_used_at, so the cancelled session became "latest" and `sessions cancel latest` refused while a newer session was still running. Cancelling now keeps last_used_at. - `--since 2026-02-30` was read as 2026-03-02; impossible dates are refused. Verified: each new test failed on its assertion before its fix; tsc clean; full suite 1944 passed, 3 skipped (subagent run), and the five changed test files re-run here (397 passed). Claude-Session: https://claude.ai/code/session_01EMqNwnnhHXznd2P2PDsaDV
CLI parsing and help defects found by the 2026-11-09 bug hunt: - A single-value flag given twice silently kept the first value (`--title First --title Second` saved "First"; `--timeout-ms` given twice sent with the first). The shared parsers now refuse it with "--title was given twice; give it once, with the value you mean."; --file, --attach, --tool, --command and --artifact still repeat. - A value starting with "--" was reported as missing, and `--prompt=x` got "Did you mean `--prompt`?". Both now say what is wrong and how to pass the value. - `ui --help`, `ui help`, `version --help` and help requests that carry a command's own flags (`tasks list --json --help`) now print help; `version --bogus` is refused instead of ignored. - The "put -- before it: prodex ask" hint now appears only for the ask commands and names the one that was run. - Help, README and docs said the model rows cannot be clicked; they are walked by keyboard since 0.40.34. `pro help` said creating a project from the CLI was planned; `--project-new` works. - The effort alias lists now say that `max` (any case but `Max`) means 매우 높음 while `Max` is the Work rung. Verified: 17 new tests (14 failed first, 3 are guards); two mutations caught; tsc clean; full suite 1951 passed, 3 skipped and `npm run release:verify` ok (subagent run); CLI test files re-run here (257 passed). The MCP consult and picker argument builders pass each single-value flag at most once. Claude-Session: https://claude.ai/code/session_01EMqNwnnhHXznd2P2PDsaDV
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
What this touches
19 file(s), 767 line(s) changed. Tests changed. Worth a look
This is an automated first pass, not a review. CI is the gate; a person decides. |
…trusted # Conflicts: # CHANGELOG.md # src/store.ts
…to fix/cli-flag-parsing # Conflicts: # CHANGELOG.md
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.
What changed
CLI parsing and help defects from the 2026-11-09 bug hunt (against 0.40.50), each reproduced again with the built CLI on main 3b0bd6b:
tasks create --title First --title Secondsaved "First";--timeout-ms 300000 ... --timeout-ms 900000sent with 300000, so an agent appending an override after its defaults got the default.assertGivenOnceinsrc/cli-args.tsis called byassertOnlyOptions,readPositionalsWithOptionsandparseAskProArgs, so every command refuses it: "--title was given twice; give it once, with the value you mean."REPEATABLE_VALUE_FLAGS(--file, --attach, --tool, --command, --artifact) matches everyreadRepeatedFlaguse. Words after--are not counted; boolean flags may still repeat. The MCPpro_consultargv builder and the picker's command builders pass each single-value flag at most once (checked).--was reported as missing, and--prompt=xgot "Did you mean--prompt?". Now: "--prompt cannot take "..." as its value: an argument that starts with "--" is read as an option. Reword the value ..." and "Options do not take "=value"; give the value as the next argument: --prompt "x"".--title --prompt pstill says "--title requires a value". No--flag=valuesyntax was added.ui --help/ui -h/ui helpprint a new ui help;version --helpprints help andversion --bogusis refused; help checks now accept the command's own boolean flags (tasks/receipts/sessions list --json --help,pro blockers/list/latest/show --json,pro report-issue --confirm).prodex ask. It now appears only for ask, pro ask and pro browser ask and names the command that was run;tasks list -gets a plain "Unknown option".pro helpsaid the model rows cannot be clicked (or that GPT-5.6 Sol is rejected); they are walked by keyboard since 0.40.34, with a click as the fallback.pro helpsaid creating a project from the CLI was planned;--project-new "name"works and is now listed. README anddocs/cli-reference.mdcarried the same stale sentence and are corrected too.maxvsMax: the mapping is unchanged; the invalid-effort error, the--efforthelp lines, README and the CLI reference now say thatmaxin any case butMaxmeans 매우 높음, whileMaxis Work's Max rung.Verification
tests/cli-flag-parsing.test.ts(17 tests); 14 failed on their assertions before any code change, 3 are regression guards. Two mutations were caught (dropping--commandfrom the repeatable list; showing the ask hint for other commands).tests/dash-prompt-hint.test.tswas updated for the new parameter.npx tsc --noEmitclean; full suite 1951 passed, 3 skipped;npm run release:verifyok (subagent run; no pinned help line changed). CLI test files re-run by the main thread after the README/docs edit: 257 passed.prodex uihelp was checked as printed output only). No browser, no ChatGPT.