Add first-class app-level slash command handling to chat (/help, /session)#114
Draft
IeuanWalker with Copilot wants to merge 2 commits into
Draft
Add first-class app-level slash command handling to chat (/help, /session)#114IeuanWalker with Copilot wants to merge 2 commits into
/help, /session)#114IeuanWalker with Copilot wants to merge 2 commits into
Conversation
Agent-Logs-Url: https://github.com/IeuanWalker/Cockpit/sessions/31cad225-5721-46b2-bdc6-b7aa9364c972 Co-authored-by: IeuanWalker <6544051+IeuanWalker@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add first-class slash command support to chat interface
Add first-class app-level slash command handling to chat (May 7, 2026
/help, /session)
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.
Cockpit chat now supports slash commands directly in the app pipeline, without relying on external SDK argument autocomplete. Inputs starting with
/are parsed and routed through a .NET command registry before normal LLM dispatch.Slash command feature (new app abstraction)
SlashCommandFeaturewith reusable command metadata + handler routing.SlashCommandDefinition,SlashCommandContext,SlashCommandResult) for clean command registration and execution responses.Pipeline integration (pre-LLM command routing)
SessionFeature.SendMessageAsync.SendAsyncis skipped for handled commandsBuilt-in command set
/help: returns available commands with usage/description./session: returns current session metadata (id/title/model/working dir/branch).Try /help,Usage: /session).Dependency wiring
SlashCommandFeaturein DI and injected intoSessionFeature.Tests + discoverability
/sessionbehavior, and quoted argument parsing.Original prompt
Add first-class slash command support to the chat interface in
IeuanWalker/Cockpit, implemented in the repository itself rather than relying on external SDK autocomplete support. The user has a chat interface in the app and wants slash commands to work now using .NET.Implement a practical, app-level slash command system for the chat experience with these goals:
/and treat them as commands./helpand at least one additional example command relevant to the app.Suggested scope:
IeuanWalker/Cockpit./help.Constraints:
Context from the conversation:
IeuanWalker/Cockpit.github/copilot-sdk#1219) is only motivational context about missing SDK autocomplete/ghost-text support for extension command arguments; the implementation should be in this app repo, not ingithub/copilot-sdk.The following is the prior conversation context from the user's chat exploration (may be truncated):
User: How can i allow slash commands to work now? using .net?
Assistant: You can make slash commands work today in .NET by handling the entire command line yourself inside a normal extension command handler.
The short version:
/cost/costGiven issue #1219 is about autocomplete/ghost text support, the current workaround is to make
/costa single entry point and implement argument parsing yourself.Example shape in practice:
/cost/cost help/cost panel on/cost session abc123/cost --plan proWhat to do in .NET
System.CommandLine, orSpectre.Console.Cliif you want richer command modelingRecommended approach
Use
System.CommandLinesemantics in your own app/library, even if the Copilot SDK only gives you one command entry point. That lets you model subcommands cleanly.Conceptually:
Example help text
Show this when the user types just
/costor invalid args:Good UX workarounds right now
/costshow concise usage/cost helpFor example:
panle. Did you meanpanel?”/cost panel on|off|refresh”If you mean “using a .NET extension specifically”
Then the answer is still: yes, ...
This pull request was created from Copilot chat.