Skip to content

Plugin slash commands fail in Desktop app with "Failed to send command" — work fine in TUI #22255

@rkkautsar

Description

@rkkautsar

Description

Slash commands registered by plugins via the command.execute.before hook fail in opencode Desktop with the error:

Failed to send command — request failed

The same commands work correctly in the TUI.

Reproduction

  1. Install the opencode-pty plugin
  2. Open opencode Desktop
  3. Run /pty-open-background-spy or /pty-show-server-url
  4. Result: Toast error "Failed to send command — request failed"
  5. Run the same commands in TUI → works correctly

Analysis

The plugin registers commands via command.execute.before hook in the plugin SDK. In TUI mode, commands are dispatched via direct HTTP to the server, and the hook fires successfully. In Desktop mode, commands go through the Tauri IPC bridge → sidecar process → HTTP, and appear to fail before the server-side hook is ever reached.

Evidence that the hook never fires:

  • /pty-show-server-url calls client.session.prompt() before throwing — if the hook executed, the URL would appear in chat. It doesn't.
  • Both commands fail with the same generic error, suggesting the failure is in the command dispatch layer, not the plugin handler.

The error originates from the catch block in packages/app/src/components/prompt-input/submit.ts (prompt.toast.commandSendFailed.title).

Expected Behavior

Plugin-registered slash commands should work identically in Desktop and TUI modes.

Environment

  • opencode Desktop (latest)
  • Plugin: opencode-pty
  • OS: macOS

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions