Skip to content

fix(mcp): keep add argument errors readable - #14068

Merged
esengine merged 1 commit into
esengine:studiofrom
pei711:fix/mcp-add-cli-errors-14052
Oct 21, 2026
Merged

esengine merged 1 commit into
esengine:studiofrom
pei711:fix/mcp-add-cli-errors-14052

Conversation

@pei711

@pei711 pei711 commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Make mcp add validation errors readable and handle mcp add -h/--help as help.

Cause

ParseArgs passed local syntax errors through dependency error redaction, while the CLI dispatched add to parsing before checking its help flag.

Blast radius

This affects invalid mcp add input and its help flags.

Neighbouring behaviours tested

Added coverage for missing arguments, unknown flags without echoing inline values, and the mcp add --help exit code/output.

Why this layer

The shared MCP argument parser owns syntax errors; the CLI dispatcher owns subcommand help routing.

Issues

Fixes #14052

Verification

  • go test ./internal/ext/mcpsetup ./internal/frontend/cli — passed.
  • go vet ./internal/ext/mcpsetup ./internal/frontend/cli — passed.
  • git diff --check — passed.
  • go test ./... — two internal/state/trustedstate filesystem timestamp/replacement tests also fail on clean baseline HEAD; one internal/state/memory ordering test failed in the parallel run but passed in an isolated baseline run.

Disclosure

  • AI assistance was used for this change.

@pei711
pei711 requested a review from esengine as a code owner October 21, 2026 04:42
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-21T04:44:01.816075Z
We couldn’t complete this review. Comment @codex review to try again.
bd13e43 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 added the tui Terminal UI / CLI (internal/cli, internal/control) label Oct 21, 2026

@esengine esengine left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked every place ParseArgs echoes caller input: the unknown-flag and first-argument errors no longer print the value (flag name only), the KEY=VALUE error was already redacted, and the remaining messages carry no input. Dropping the blanket DiagnosticError wrapper is therefore safe, and the help routing matches the other subcommands. Approving; merge after the checks are green.

@esengine
esengine merged commit c913955 into esengine:studio Oct 21, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tui Terminal UI / CLI (internal/cli, internal/control)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: reasonix mcp add reports "dependency failure (*errors.errorString)" for ordinary usage errors

2 participants