Skip to content

fix(cli): reject separate empty-string values for mcp add valued options - #8929

Open
mirzasnowy wants to merge 1 commit into
morluto:mainfrom
mirzasnowy:fix/8003-empty-string-valued-option
Open

mirzasnowy wants to merge 1 commit into
morluto:mainfrom
mirzasnowy:fix/8003-empty-string-valued-option

Conversation

@mirzasnowy

@mirzasnowy mirzasnowy commented Nov 4, 2026 •

Copy link
Copy Markdown

Follow-up to morluto's closing comment on #8003 (#8003 (comment)): a separate empty-string value after --agent, --command, or -c was not rejected yet. mcp add --agent "" exited 0 and registered with defaults.

Change: the mcp add guard in src/cli.ts now treats "" in a value position as a missing value, same as a trailing flag or an empty --flag= form. Covers --agent, --command, and -c, including behind global flags such as --full-output.

Evidence: reproduced on current main (exit 0, settings written for all three flags); after the fix all variants exit 1 with VALIDATION_ERROR and nothing written, and mcp add --agent amp still registers. tests/boundary/cli/mcpAddOptionValidation.test.ts passes with the fix and fails without it.

I have reviewed every line of this diff.

@chatgpt-codex-connector

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-11-04T18:31:30.867285Z
We couldn’t complete this review. Comment @codex review to try again.
50a843f 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@greptile-apps

greptile-apps Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] This PR appears safe to merge; no actionable issues were found.

Summary

Rejects separate empty-string values for mcp add --agent, --command, and -c before registration.

  • MCP add rejects blank values for its agent and command options.

Reviews (1) · Last reviewed commit: "fix(cli): reject separate empty-string v..." · Reviewed by Greptile

This branch has not been deployed

No deployments
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