Slash commands: parity with OpenHands CLI and a built-in /help
#1.407 geöffnet am 17.06.2026
Repository-Metriken
- Stars
- (43 Sterne)
- PR-Merge-Metriken
- (Durchschn. Merge 2T 10h) (106 gemergte PRs in 30 T)
Beschreibung
Problem
agent-canvas ships only 3 built-in slash commands -- /new, /btw, and /model -- and all three are further gated by backend type in ways that leave local-backend users with no built-in slash commands at all:
| Command | Cloud | Local |
|---|---|---|
/new |
Yes | No |
/btw |
Yes | Yes |
/model |
No | Yes |
The OpenHands CLI (TUI) has 9 built-in commands that are all always available regardless of backend kind:
| Command | Description |
|---|---|
/help |
Display all available commands in the chat area |
/new |
Start a new conversation, reusing the current sandbox |
/history |
Toggle the conversation history side panel |
/settings |
Open the settings modal |
/confirm |
Configure confirmation policy (always-ask / yolo / llm-approve) |
/condense |
Condense (summarise) the conversation history |
/skills |
Display loaded skills, hooks, and MCPs in the chat area |
/feedback |
Open the anonymous feedback form |
/exit |
Exit (not applicable to browser UI -- skip) |
Additionally, there is no /help equivalent in agent-canvas at all: users who type / can browse through available slash commands but if there are many that list can be unhelpful.
Proposed Changes
1. Add new slash commands
Four commands from the CLI TUI are immediately implementable in agent-canvas without backend changes:
-
/condense-- Triggers conversation history condensation. In the CLI this callsrunner.condense_async(). In agent-canvas this would need to wire through to the agent-server'sPOST /api/condense(or equivalent) if that endpoint exists; otherwise a no-op with a toast explaining it is not yet supported. -
/skills-- Renders the currently loaded skills, hooks, and MCPs inline in the chat. The skill list is already fetched byuseConversationSkills(). This is purely a display concern. -
/help-- Renders the full list of available slash commands (both built-in and skill-derived) in the chat area, giving users discoverability. This also serves as the single source of truth for what commands exist. -
/feedback-- Opens the existing anonymous feedback form (forms.gle/chHc5VdS3wty5DwW6) in a new browser tab. No backend involvement required.
2. Support /new in local conversations
The gating that hides /new on local backends (in src/hooks/chat/use-slash-command.ts line 59) was added because cloud creates new conversations via an async WORKING task that requires polling. Local backends create synchronously, so the same /new flow used for cloud could work for local too -- the mutation in use-new-conversation-command.ts already handles both paths:
// Cloud returns a WORKING task (no app_conversation_id yet);
// navigate to /conversations/task-{id} so useTaskPolling drives it
// to READY. Local creates synchronously -- app_conversation_id is
// already set, so we navigate straight to it.
The menu filter just needs the isCloud guard removed from /new.
3. A better way to discover all slash commands
Even after adding the above, users have no way to know commands exist unless they type / and read the dropdown. A /help command solves this by listing every command (built-in + skill-derived) in the chat itself. The help text should include:
- All built-in commands with descriptions
- All skill-derived commands (e.g.
/init,/releasenotes) - A note that typing
/shows the autocomplete menu
Relevant Files
| File | Relevance |
|---|---|
src/utils/constants.ts |
BUILT_IN_COMMANDS, BTW_COMMAND, MODEL_COMMAND definitions |
src/hooks/chat/use-slash-command.ts |
Menu filtering -- isCloud gates /new and /model |
src/hooks/chat/use-btw-interceptor.ts |
/btw interceptor (no backend gating) |
src/hooks/chat/use-model-interceptor.ts |
/model interceptor (local-only) |
src/hooks/mutation/use-new-conversation-command.ts |
/new mutation (handles both cloud and local) |
src/components/features/chat/chat-interface.tsx |
/new execution handler |
src/components/features/chat/interactive-chat-box.tsx |
Chains interceptors |
References
- OpenHands-CLI commands definition:
openhands_cli/tui/core/commands.py - OpenHands-CLI command handlers:
openhands_cli/tui/widgets/input_area.py - OpenHands frontend (no backend gating):
frontend/src/hooks/chat/use-slash-command.ts - agent-canvas (backend gating added):
src/hooks/chat/use-slash-command.ts