Skip to content

Desktop: support OpenCode in native Chat UI #9307

Closed

Description

@AmethystLiang

Summary

Add OpenCode support to the desktop native Chat UI so OpenCode sessions can be viewed and interacted with like Claude / Codex / Grok, instead of terminal-only.

Context

Native chat currently allows only a fixed agent set:

// src/shared/native-chat-agent-support.ts
NATIVE_CHAT_SUPPORTED_AGENTS = claude | openclaude | codex | grok

OpenCode is already a first-class agent elsewhere (launch, status, icons, hooks, usage), but it is not wired into native chat transcript parsing / eligibility.

Expected

On desktop:

  1. An OpenCode terminal/session can open native Chat UI (toggle / default where other agents do).
  2. Transcript history loads and streams updates (append) like supported agents.
  3. User messages, assistant replies, tools/reasoning (as available in OpenCode’s transcript format) render correctly.
  4. Chat input / send / interrupt behaviors match what the product already does for other chat-capable agents, within OpenCode’s capabilities.
  5. Unsupported OpenCode surfaces fail gracefully (empty state / fall back to terminal) rather than broken UI.

Actual

OpenCode sessions are terminal-only from the chat perspective: isNativeChatSupportedAgent('opencode') is false, so Chat UI is gated off.

Implementation notes (desktop)

Likely touch points:

  • src/shared/native-chat-agent-support.ts — add opencode (+ transcript-agent mapping)
  • src/main/native-chat/ — session read, watch, parse for OpenCode transcript layout
  • Desktop renderer chat view / agent eligibility / session option defaults
  • Hooks / provider session id + transcriptPath if OpenCode reports them
  • Tests for parse + support gating

Discover OpenCode’s on-disk transcript format (JSONL path, schema) and either:

  • map it into existing NativeChatMessage roles, or
  • extend the native-chat model only where required.

Acceptance

  • OpenCode appears as chat-eligible on desktop when a session has a readable transcript
  • Historical messages render for a typical OpenCode session
  • Live updates appear while the agent is working
  • No regression for claude / codex / grok chat
  • Clear behavior when transcript path is missing (wait / terminal fallback)

Related

Activity

  1. andyranitzsch commented on Sep 9, 2026

    @andyranitzsch

    any news around this?

  2. Jorgelig commented on Sep 13, 2026

    @Jorgelig

    any news?

  3. lector2002 commented on Sep 14, 2026

    @lector2002

    I'd like to contribute OpenCode native Chat UI support, covering desktop and the mobile counterpart (#9308), with mobile usability as the priority. Before implementing, I'm checking the transcript/session plumbing and an event-driven live-update approach with historical transcript loading. I'll also account for the plugin compatibility work in #20410 to avoid overlapping changes. @brennanb2025, is there an implementation or branch already in progress that I should coordinate with? Happy to align on scope and split the work into reviewable PRs.

  4. andyranitzsch commented on Sep 22, 2026

    @andyranitzsch

    any news?

  5. justeozan commented on Sep 23, 2026

    @justeozan

    Hi! I'd like to contribute to OpenCode native Chat UI support (#9307, and possibly the mobile counterpart #9308) and want to coordinate first to avoid duplicate work.

    Current state I can see:

    A few questions:

    1. @akhan157 — is feat: add OpenCode native chat support #13287 still active? Happy to help rebase, fix conflicts, add CI tests, or take over if you've moved on.
    2. @xodmd45-ctrl — same for feat(native-chat): read OpenCode transcripts from its SQLite session store #15026; it looks like the most recent desktop-focused approach, with the CodeRabbit findings already addressed.
    3. @brennanb2025 — as assignee, is there a preferred path: land one of the two, split scope (e.g. desktop vs mobile), or a fresh approach on top of one of them?

    If it helps, I can pick up whichever PR is stalled (conflict resolution + tests + CI + remaining review feedback) rather than opening a competing one. I have a fork ready (justeozan/orca).

  6. nwparker commented on Oct 3, 2026

    @nwparker
    Contributor

    Implemented desktop OpenCode native Chat support in merged #24647 (a2896f5). Both OpenCode versions use the existing chat eligibility, preferences, guarded host transcript reader and shared background worker. Missing/unreadable history keeps the existing fallback behavior.

    Fresh installed OpenCode 2.0.16 import/server-revert and hidden desktop screenshots verify actual history, bounded oversized-message handling and readable neighbors. Existing question/cancel proof and current append/deletion controls are retained.

    The complete change passed 306 desktop and 89 mobile controls, all relevant typechecks and all 34 exact-head CI checks. Closing this feature request as implemented. Further paired-history and recovery refinements remain separately tracked in the campaign PRs.

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions