Skip to content

fix: fit the picker to the terminal and long names to the name limit - #108

Merged
youdie006 merged 6 commits into
mainfrom
fix/picker-and-long-names
Nov 17, 2026
Merged

youdie006 merged 6 commits into
mainfrom
fix/picker-and-long-names

Conversation

@youdie006

Copy link
Copy Markdown
Owner

What changed

Picker (prodex ui) and repo-write defects from the 2026-11-09 bug hunt (against 0.40.50), each reproduced again on main 3b0bd6b (the picker in a real pty with the hunter's mocked harness):

  1. Progress budget fixed at 20 minutes. The bar read "0s / 20m ... (budget 5m)". runAskProCommand now reports the answer budget it settled on through a new CliIO.onSendBudget; runInteractiveUi hands it to the picker, which starts at 20m and switches to the reported value.
  2. Tall lists pushed the title and cursor off screen (25 projects at 80x24). renderSelectList takes maxLines and shows a window around the cursor with "... N more above/below" lines (always reserved, so rows do not jump); row numbers are right-aligned; pick drops the banner first, then the settings panel, on a short or narrow terminal.
  3. Attach-line parsing: a shell-style word reader joins adjacent quoted and unquoted parts ('/home/u/Bob'\''s notes.pdf', "My File".pdf), takes an unclosed quote literally, keeps an apostrophe after a letter (it's.txt), keeps every backslash in words starting X:\, X:/ or \\, and still reads My\ File.pdf and docs\report.pdf as before.
  4. Width: a compact table of East Asian Width W symbols (U+2705, U+2B50, ...) counts two columns, and U+FE0F after a one-column symbol adds one; title, hints and footer are cut to the real width with a floor of 24 instead of 40.
  5. Long file names in repo writes: names over about 192 bytes passed repo_write_file_dry_run and failed repo_write_file_apply with ENAMETOOLONG ... '/proc/self/fd/21/.<name>.<pid>.<time>.<uuid>.tmp'. temporaryPathFor (src/safe-file.ts) cuts the copied base name to fit 255 bytes in UTF-8 on code-point boundaries; the format is unchanged for names that fit (.<name>.<pid>.<time>.<uuid>.tmp). refuseOverlongName maps ENAMETOOLONG in both the dry run and the apply to "Path has a file or folder name too long for the file system ...". The record temp cleanup matchers (src/store.ts, src/store-writer.ts) only match their own record temps with short ids and are unaffected.

Verification

  • Test-first: every new test failed on its assertion first; reversing only the src patch turned all new regression tests red; two mutations caught (the leading-dot byte in the temp-name room, the window's end clamp).
  • npx tsc --noEmit clean; full suite 1953 passed, 3 skipped (subagent run); the changed test files re-run by the main thread: 226 passed.
  • Checked in a pty at 80x24 with colour and at 32 columns (mocked runConsult).
  • Not verified: a real prodex ui send (it would drive a browser), so the one-line onBudget -> onSendBudget hand-off in runInteractiveUi is covered only by the tests on each side; the long-name tests are skipped on win32 (MAX_PATH); Windows path parsing is unit-tested only.

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
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T00:15:37.042401Z 1974a93 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

What this touches

  • browser adapter
  • bridge store
  • CLI
  • MCP
  • tests

28 file(s), 1450 line(s) changed. Tests changed.

Worth a look

  • Careful read: touches the receipt/integrity path.
  • Careful read: touches what gets written to a repo.

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
…icker-and-long-names

# Conflicts:
#	CHANGELOG.md
@youdie006
youdie006 merged commit cc9e29d into main Nov 17, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant