Skip to content

Opencode slash commands configured by user are not recognized from Maestro chat #552

@chr1syy

Description

@chr1syy

Summary

When using Maestro with opencode, slash commands configured for opencode are not recognized when typed in chat. The input appears to be treated as regular user text rather than an agent-native slash command.

Repro (Desktop)

  1. Create/use an opencode session.
  2. Configure an opencode native slash command in the tool (or environment, plugin/config depending on how it is registered).
  3. In Maestro chat, type /your-command ....
  4. Observe: the command does not execute as a slash command in opencode and is handled as normal message flow.

Suspected root cause

This appears to be by design in current code paths:

  1. Opencode is currently marked as not supporting native slash commands:
  • src/main/agents/capabilities.ts (opencode block): supportsSlashCommands: false.
  1. Slash-command discovery IPC is hard-gated to Claude Code only:
  • src/main/ipc/handlers/agents.ts (agents:discoverSlashCommands) returns null when agentId !== 'claude-code'.
  • This means activeSession.agentCommands can never be populated for opencode via this route.
  1. UI only exposes discovered agent commands when the capability flag is true:
  • src/renderer/App.tsx around agentCommands = hasActiveSessionCapability('supportsSlashCommands') ? ... : [].
  1. Input handling for slashes only treats:
  • built-in Maestro /history, /wizard, /skills (Claude-only),
  • plus customAICommands.
  • unmatched slash input falls through to normal message flow, which then gets wrapped as user prompt text.
    • In src/renderer/hooks/input/useInputProcessing.ts, non-command path eventually builds effectivePrompt and appends maestroSystemPrompt for new sessions.

Why this breaks opencode slash workflows

If opencode depends on raw slash-prefixed commands from chat, it currently receives a normal prompt text path (and may be prefixed in new sessions), so native command dispatch is never triggered.

Probable fixes (ranked)

  1. Add opencode slash-command discovery path
  • Implement discovery for opencode if/where it exposes configured commands (likely not via Claude init event).
  • Store result on session agentCommands.
  • Gate execution path by capability only when this is true for opencode.
  1. Add passthrough execution path for configured opencode slash commands
  • If command is recognized as agent-native, send raw command input through the same message queue as a command item instead of converting to a normal text prompt.
  • Avoid wrapping with maestroSystemPrompt for this special case.
  1. Clarify expected behavior in docs
  • If opencode does not support native slash commands in Maestro’s batch mode, make that explicit in docs/provider-notes.md and docs/slash-commands.md as a known limitation.

Notes

  • There is existing parser support for opencode output (src/main/parsers/opencode-output-parser.ts), but command discovery/execution is currently blocked by capability/design guards.

Suggested acceptance

  • With configured opencode slash command /foo, command appears in autocomplete (if discoverable) and executes without being wrapped by Maestro system prompt.
  • Commands configured but unsupported should fail with clear feedback, not be treated as normal text silently.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions