You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mcpx completion zsh generates a script that zsh cannot parse.
This is the same defect as dezren39/darwin-nix#365 (fixed there by PR #379), present in this repo's pkgs/mcpx copy: the fix was never ported here. pkgs/mcpx/internal/cli/completion.go (~line 92, zshCompletion) still emits each _describe commands entry unquoted:
Summaries carry apostrophes, parentheses and glob brackets — e.g. prompts: list or render a server's prompts (manual.go:414) and search: find tools by name and description (keyword or semantic). zshEscape turns ' into '\'', which is only valid inside single quotes, and leaves parens/brackets bare.
Reproduction (verified on main a29abd3, 2026-10-18)
$ go build -o /tmp/mcpx ./cmd/mcpx # in pkgs/mcpx
$ /tmp/mcpx completion zsh > comp.zsh
$ zsh -n comp.zshcomp.zsh:192: parse error near `;;'
$ echo$?1
Generated array (excerpt):
prompts:list or render a server'\''s prompts
resources:list or read a server'\''s resources
search:find tools by name and description (keyword or semantic)
No existing issue in this repo tracks this (gh search issues --repo developing-today/code zsh → none); there is also no internal/cli/completion_test.go in this copy.
Why it matters
Anyone who installs the zsh completion gets a script their shell rejects at load — the completion feature is simply broken for zsh users, silently. It was already diagnosed and fixed once in the sibling copy; letting the copies drift means users here keep the broken version.
Emit each commands entry single-quoted: '%s:%s' with a new zshDescribe helper that only handles _describe's own syntax (backslash-escape : inside the description, '\'' for apostrophes) instead of reusing zshEscape.
Keep zshEscape for the flag-description sites, which are already inside single quotes.
Port the regression tests from nix (internal/cli/completion_test.go): every commands entry is single-quoted, an apostrophe-bearing entry is present, and zshDescribe escapes colons/quotes.
Acceptance criteria
mcpx completion zsh | zsh -n exits 0
bash/fish completions still parse (bash -n, fish -n or equivalent)
New regression tests in internal/cli fail on the pre-fix code and pass with the fix
Activity