Skip to content

Port commands to V2 #34685

Closed
Closed

Description

@rekram1-node

Commands are still served and executed through the older packages/opencode command/session prompt path.

Current state:

  • command.list is handled by packages/opencode/src/server/routes/instance/httpapi/handlers/instance.ts through the legacy Command.Service.
  • /session/:id/command is handled by packages/opencode/src/server/routes/instance/httpapi/handlers/session.ts through SessionPrompt.command.
  • packages/core/src/command.ts has CommandV2 and the V2 plugin graph can populate it, but the public command list and slash command execution paths do not use it yet.

We need to port commands to V2 end-to-end while keeping the public API simple:

  • Keep the public command list shape simple.
  • Keep command execution as a simple command + arguments request.
  • Keep plugin command transforms simple for static templates unless we intentionally design dynamic plugin commands later.
  • Add whatever internal command resolution machinery V2 needs.

Blocked work:

  • MCP prompts as V2 slash commands in feat(core): support mcp prompts #34531 depends on this port for correct end-to-end behavior.
  • Dynamic MCP prompt resolution should happen at command execution time with actual user arguments, which likely belongs in the V2 command execution/resolution path rather than in the public command catalog.
  • Async MCP prompt list refresh work in Support async updates for MCP prompts in V2 #34541 also depends on having a V2 command path to update.

Activity

  1. self-assigned this
    on Jun 30, 2026
  2. opencode-agent commented on Jul 2, 2026

    @opencode-agent
    Contributor

    Tracker update from V2 TODO LIST audit (2026-07-02):

    This remains the canonical V2 command-port tracker.

    Known dependents / related work:

    Suggested implementation direction remains: port command list + command execution/resolution to V2 while keeping public command list and execution request shape simple.

  3. opencode-agent commented on Jul 2, 2026

    @opencode-agent
    Contributor

    Additional tracker update (2026-07-02):

    Related open PR:

    This is adjacent CLI command-surface work, but it does not complete session.command or slash-command execution. Keep #34685 open for end-to-end V2 command list/execution/resolution.

  4. opencode-agent commented on Jul 2, 2026

    @opencode-agent
    Contributor

    Tracker update from V2 TODO LIST (2026-07-02):

    @rekram1-node has an open PR for V2 command invocation:

    PR scope includes:

    • V2 session command invocation
    • commands expanding into normal durable prompt admission
    • MCP prompts exposed as command-shaped entries and resolved at invocation time
    • /review as a normal command for now
    • generated client updates

    Follow-ups noted by the PR:

    Keep this issue open until #34849 lands and command execution is verified in TUI/client.

  5. opencode-agent commented on Jul 2, 2026

    @opencode-agent
    Contributor

    Tracker update from V2 TODO LIST (2026-07-02): @rekram1-node has an open PR for V2 command invocation: #34849. PR scope includes V2 session command invocation, durable prompt admission for commands, MCP prompts as command-shaped entries resolved at invocation time, /review as a normal command for now, and generated client updates. Follow-ups noted by the PR: #34847 subtask/backgrounding decision and #34860 MCP prompt optimistic UI. Keep this issue open until #34849 lands and command execution is verified in TUI/client.

  6. opencode-agent commented on Jul 2, 2026

    @opencode-agent
    Contributor

    Landed via #34849.

    V2 command invocation now expands commands into normal durable prompt admission, exposes MCP prompts as command-shaped entries, resolves MCP prompts at invocation time, and adds the V2 session.command API/client surface.

    Source update from Aiden: https://discord.com/channels/1391832426048651334/1520962938733723720/1522286030844199043

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions