Repository navigation
fix: count MCP limits as advertised and keep setup recoverable - #109
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
Picker and repo-write defects found by the 2026-11-09 bug hunt: - The picker's progress bar always filled against 20 minutes, so a 5-minute send read "0s / 20m ... (budget 5m)". The send now reports the answer budget it settled on (CliIO.onSendBudget) and the bar uses it, falling back to 20 minutes when none is reported. - A list taller than the terminal pushed the title, the settings panel and the cursor off screen (25 projects at 80x24). The list is now a window around the cursor with "more above/below" lines, row numbers are right-aligned, and the banner and then the panel give way on a short terminal. - The attach line split `'/home/u/Bob'\''s notes.pdf'` into three paths and `"My File".pdf` into two, and dropped a separator from `C:\repo\#1\a.pdf`. It now reads words as a shell does and keeps every backslash of a Windows path. - U+2705, U+2B50 and U+2764 U+FE0F counted one column, and rows were cut at 40 columns even on narrower terminals. Wide symbols and the emoji selector now count two, and every line is cut to the real width. - Repo writes to a name over about 192 bytes passed the dry run and failed the apply with ENAMETOOLONG on a /proc/self/fd path. The temp name now cuts its copy of the target name to stay within 255 bytes, and a name the file system cannot hold gets a clean error naming the repo path in both the dry run and the apply. Verified: every new test failed first; reversing the src patch turned them red; two mutations caught; tsc clean; full suite 1953 passed, 3 skipped (subagent run); the changed test files re-run here (226 passed). Not run: a real `prodex ui` send (it would drive a browser); the onBudget hand-off in runInteractiveUi has no test of its own. Claude-Session: https://claude.ai/code/session_01EMqNwnnhHXznd2P2PDsaDV
…trusted # Conflicts: # CHANGELOG.md # src/store.ts
…to fix/cli-flag-parsing # Conflicts: # CHANGELOG.md
…icker-and-long-names # Conflicts: # CHANGELOG.md
MCP and setup defects found by the 2026-11-09 bug hunt: - MCP bridge text fields advertised maxLength in characters but the handlers counted UTF-8 bytes, so Korean text was refused at about a third of the limit (4000 x "가" as a title: "12000 bytes > 10000 bytes"). They now count characters; repo_write_file_dry_run content keeps its 1,000,000-byte file limit and says it is in UTF-8 bytes. - `bridge_create_task` with `repo_id: ""` returned a raw zod dump; the schema now advertises minLength 1 and refuses it as invalid input. - `setup` on an expired token said "it never expires" and pointed at a command that then failed; a TTL of 1e-9 hours saved an expired token and exited 0; hints omitted the --cwd setup was given. Each case now gets a hint that works from where it was run, and a TTL that expires on creation is refused. - One invalid optional field made setup discard the whole config: token rotated, valid defaults, expiry and created_at dropped, with no word. Setup now keeps every valid field, names each one it dropped (never values), and says plainly when the token changed. - A hand-edited non-loopback host was refused by status, start and setup without naming the file or the fix; the message now names both (`prodex setup --host 127.0.0.1`, with --cwd when needed). - setup help listed --allow-model-fallback, which setup rejects; it is a per-send option (0.39.5), so the line is removed. Verified: every new test failed on its assertion first; revert proofs per fix; tsc clean; full suite 1950 passed, 3 skipped (subagent run); changed test files re-run here (181 passed). release:verify passed npm test, typecheck and build; its package smoke failed only on the isolated PRODEX_CDP_PORT=1 environment's "--port 1" text, and passed with that text normalized; CI's release verification runs it unmodified. Claude-Session: https://claude.ai/code/session_01EMqNwnnhHXznd2P2PDsaDV
…fix/mcp-setup-config-messages # Conflicts: # CHANGELOG.md # src/repo-write.ts
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
34 file(s), 2246 line(s) changed. Tests changed. Worth a look
This is an automated first pass, not a review. CI is the gate; a person decides. |
youdie006
added a commit
that referenced
this pull request
Nov 17, 2026
0.40.52 (51da80d, PRs #100 and #105-#109) published on its first publish run and is installed on WSL, M3 and the Mac mini; the MacBook M4 did not answer ssh and still runs 0.40.51. The browser containers on WSL and M3 were rebuilt twice: from 58650ce (container PR #110), which fixes the request_mismatch every container consult hit once ChatGPT keyed transcript units by turn id, and then from 9969a64 (container PR #111), which ports this release's fixes. Each swap was gated on the send lock, and a smoke consult answered with its request verified on both hosts after each. Claude-Session: https://claude.ai/code/session_01EMqNwnnhHXznd2P2PDsaDV
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
MCP and setup defects from the 2026-11-09 bug hunt (against 0.40.50), each reproduced again on main 3b0bd6b. Own commit: 0f1889b. This branch is chained on #108 (which is chained on #107 and #105) so the shared CHANGELOG section merges without conflicts; until those merge, the PR diff also shows their changes.
assertMcpTextFieldnow counts characters (constants renamedMAX_MCP_{BRIDGE,SHORT}_TEXT_CHARS). Bytes stay bounded by the 128 MiB stdio frame limit, whose test already budgets six bytes a character.repo_write_file_dry_run.contentkeeps its 1,000,000-byte limit, because that is the file size read and apply use; its description and refusal now say the limit is in UTF-8 bytes.bridge_create_taskwithrepo_id: ""returned a raw zod dump. The schema now advertisesminLength: 1and the SDK refuses it as invalid input (-32602), liketitle: "".prodex setup --token-ttl-hours <hours>instead of "it never expires"; every command setup prints carries--cwdwhen setup was given it; a TTL that would expire on creation (1e-9) is refused before anything is written.readExistingConfigkeeps each valid field and drops only invalid ones (eachbrowser_defaultsfield separately); setup prints which fields it dropped (names only, never values), "The saved token was kept.", or, when it could not keep it, that the token changed and clients need the new URL. A token is kept only together with its saved expiry, so a token meant to lapse cannot become non-expiring..bridge/config.local.jsonandprodex setup --host 127.0.0.1(plainprodex setupwhen only server_url carries it), with--cwdwhen needed;sourceAwareSetupMessagenow rewrites any quotedprodex setup ...command. Non-loopback hosts are still refused.--allow-model-fallback, which setup rejects; it was added as a per-send option in 0.39.5 (26b925d), so the setup help line is removed.Verification
tests/mcp-field-limits.test.ts,tests/setup-config-recovery.test.ts;tests/setup-url-hint.test.tsrewritten to run the printed command as-is from another directory); each fix reverted one at a time turned its tests red again.npx tsc --noEmitclean; full suite 1950 passed, 3 skipped (subagent run, own branch); after merging the fix: fit the picker to the terminal and long names to the name limit #108 chain, the main thread ran tsc and the full suite: 2005 passed, 3 skipped. The merge kept both new helpers insrc/repo-write.ts(assertWritableContentSizefrom this PR,refuseOverlongNamefrom fix: fit the picker to the terminal and long names to the name limit #108).npm run release:verifyin an isolated environment passed npm test, typecheck and build; the package smoke failed only becausePRODEX_CDP_PORT=1made the login guide print--port 1where the smoke pins the default port, and passed with that text normalized. The unmodified smoke runs in this PR's release verification CI jobs.