Skip to content

CL-9361: quote whitespace args in shared MCP trust prompt helper (TTY + TUI) - #1183

Merged
TheGreatAxios merged 4 commits into
mainfrom
cl-9361-quote-whitespace-args-in-shared-trust-prompt-helper-tty-tui
Sep 27, 2026
Merged

TheGreatAxios merged 4 commits into
mainfrom
cl-9361-quote-whitespace-args-in-shared-trust-prompt-helper-tty-tui

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Stacks onto #1165 (CL-8996, unmerged): that PR created the TTY helper with a bare space-join; this change adds argv quoting in one shared helper consumed by both the TTY exec prompt and the TUI prompt.

  • Shared display-only helper formatMcpTrustQuestion in src/trust/project-trust.ts (next to mcpServerFingerprint): args containing whitespace (also quotes, empty args) render double-quoted with backslash/quote escaping, so ["a b"] and ["a","b"] never look alike.
  • formatExecMcpTrustQuestion (TTY, src/exec/runner.ts) and new formatTuiMcpTrustQuestion (TUI, src/tui/runner/session.ts) both delegate to it; both surfaces fixed together.
  • Fingerprint algorithm and inputs unchanged (no diff to mcpServerFingerprint); existing fingerprint suites green.
  • Tests: argv-boundary cases on both the shared helper and the TTY wrapper, plus tests/unit/tui/mcp-trust-prompt-parity.test.ts asserting both surfaces render identically across a 12-config matrix.

Verification: bun run typecheck exit 0; exec+TUI runner + trust suites 108 pass 0 fail; full bun test ./src ./tests ./evals ./scripts --randomize --seed 424242 8052 pass 0 fail; bun run lint exit 0.

@linear-code

linear-code Bot commented Sep 26, 2026

Copy link
Copy Markdown

CL-9361

@TheGreatAxios
TheGreatAxios deleted the branch main September 27, 2026 22:26
@TheGreatAxios TheGreatAxios reopened this Sep 27, 2026
@TheGreatAxios
TheGreatAxios changed the base branch from cl-8996-exec-mcp-tofu-prompt-omits-spawn-args to main September 27, 2026 22:29
The trust prompt showed Command whenever command was set, but connect
opens HTTP when type is http or type is unset and url is set. Name and
url also interpolated raw. Display now shares isHttpServer and escapes
those fields plus Unicode/C1 line breaks. Fingerprint inputs are unchanged.
@TheGreatAxios
TheGreatAxios force-pushed the cl-9361-quote-whitespace-args-in-shared-trust-prompt-helper-tty-tui branch from ab27029 to 1747d4d Compare September 27, 2026 22:33
@TheGreatAxios
TheGreatAxios enabled auto-merge (squash) September 27, 2026 22:33
@TheGreatAxios
TheGreatAxios merged commit ac7a449 into main Sep 27, 2026
12 of 13 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