fix(tui): wire MCP prompts into slash command dispatch#3565
Open
EronWright wants to merge 2 commits into
Open
Conversation
MCP prompt items were added to the command palette but not to the slash command parser — they were missing SlashCommand and Immediate fields. As a result, an MCP server's prompts (e.g. /review, /summarize) passed through as plain text instead of invoking the MCP prompt. Add SlashCommand and Immediate to MCP prompt items, mirroring the existing pattern for agent commands and skills. Update Execute to map a non-empty arg string to the first declared prompt argument, so /summarize <text> and /review <path> work from the keyboard without the command palette dialog.
…omptItem Factor the agent-command palette / slash Item construction out of BuildCommandCategories into a newAgentCommandItem helper, mirroring newMCPPromptItem. Behavior is unchanged; the extraction makes the item builder unit-testable without constructing an App, and the two builders now read symmetrically. Add unit tests covering the slash-command wiring and argument forwarding.
1ec88cd to
2f0c879
Compare
Sayt-0
approved these changes
Jul 10, 2026
Member
|
Hi @EronWright ! your commits must be signed in this repo |
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.
What
MCP prompt palette items were registered without
SlashCommand/Immediate, sotyping an MCP prompt as a slash command (e.g.
/review,/summarize) fellthrough to the model as plain chat text instead of invoking the prompt — only
clicking the item in the command palette worked.
This wires MCP prompt items into the slash-command parser, mirroring the
existing agent-command and skill items:
SlashCommand+ImmediatesoParser.Parsematches them./summarize <text>works from the keyboard), falling back to the input dialogwhen a required argument is missing, and to an empty-args run otherwise.
Companion to the skill-dispatch fix in #3054 — this is the MCP-prompt analog.
Unlike skills it does not need
SkipImmediateParse: itsExecuteemitsMCPPromptMsgdirectly rather than re-emitting aSendMsgthat would bere-parsed.
Refactor + tests
To make the item builders unit-testable without standing up an
App, theper-item construction is factored into small helpers —
newMCPPromptItemand,for symmetry,
newAgentCommandItem— each with unit tests that drive the realitem through
Parser.Parse(slash-command wiring + argument mapping/forwarding).