Repository navigation
fix(remove): remove a root MCP server named 'ambiguous' instead of refusing it silently (#862) - #864
Merged
Conversation
|
No findings. The PR description documents sufficient testing, including a representative real-CLI end-to-end verification. Per instruction, I reviewed the diff only and did not run or install anything. |
…fusing it silently (Tencent#862) mcpRemovalTarget returned string | 'ambiguous' | null, so a root server named 'ambiguous' came back as its own name and the caller read it as the refusal sentinel: nothing removed, exit 1, no reason printed. Return a tagged result and switch on its kind.
SaulMoro
force-pushed
the
fix/remove-mcp-ambiguous-name
branch
from
September 28, 2026 12:34
7526d3f to
9e01eea
Compare
|
No findings. The PR description documents sufficient testing, including a representative real-CLI end-to-end verification. The tagged union cleanly resolves the sentinel/name collision while preserving existing behavior. Per instruction, I reviewed the diff only and did not run or install anything. |
jeff-r2026
approved these changes
Sep 28, 2026
Walternater
pushed a commit
to Walternater/teamai-cli
that referenced
this pull request
Nov 2, 2026
…fusing it silently (Tencent#862) (Tencent#864) mcpRemovalTarget returned string | 'ambiguous' | null, so a root server named 'ambiguous' came back as its own name and the caller read it as the refusal sentinel: nothing removed, exit 1, no reason printed. Return a tagged result and switch on its kind.
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.
Summary
teamai remove mcp ambiguousrefused to remove a server namedambiguousfrommcp/mcp.yaml, and gave no reason.mcpRemovalTargetreturnedstring | 'ambiguous' | null, so a server name and the refusal sentinel had the same type, and the root-file matchreturn namecame back as'ambiguous'. The function now returns a tagged result, and the caller switches onkindwith anevercheck:Every path returns what it returned before, now tagged: each
'ambiguous'becomes{ kind: 'ambiguous' }and eachnullbecomes{ kind: 'not-found' }. The agents path sets itsambiguousflag inline andpublishedNameForreturnsstring | null, so no other resource type has this collision.Type of Change
Test Plan
npx tsc --noEmitpassesnpm run lintpasses (0 warnings)npx vitest runpasses (5174 passed; the 9 failures are 15 s timeouts ingit-kind-reports.test.ts, which times out identically onmainat a8ab8e0 on this machine)Three tests in
remove-command.test.tsunderteamai remove mcp picks one file, through the exportedremove:npx vitest run src/__tests__/remove-command.test.ts: 11 passed.npx vitest run --config vitest.e2e.config.ts src/__tests__/e2e/remove-mcp-namespaces.test.ts: 7 passed.Real CLI, built
dist/index.js, sandboxHOME, a local bare remote whosemcp/mcp.yamldefinesambiguousanddb:Before (
mainat a8ab8e0):After (this branch):
The
Failed to create PRline is the sandbox: the fixture's remote URL names no provider repository, so the branch is pushed and the PR step falls back, as in the existingremove-mcp-namespacese2e fixture.Related Issues
Closes #862
Notes for Reviewers
The caller's
ambiguousflag and theambiguouskind keep their existing name, although the kind also covers the refusals for an MCP file that does not parse and for a bad--role/--project. Renaming it would widen the diff for no behavior change.