Repository navigation
Desktop: support OpenCode in native Chat UI #9307
Copy link
Copy link
Closed
Labels
Description
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 | grokOpenCode 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:
- An OpenCode terminal/session can open native Chat UI (toggle / default where other agents do).
- Transcript history loads and streams updates (append) like supported agents.
- User messages, assistant replies, tools/reasoning (as available in OpenCode’s transcript format) render correctly.
- Chat input / send / interrupt behaviors match what the product already does for other chat-capable agents, within OpenCode’s capabilities.
- 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— addopencode(+ 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 +
transcriptPathif OpenCode reports them - Tests for parse + support gating
Discover OpenCode’s on-disk transcript format (JSONL path, schema) and either:
- map it into existing
NativeChatMessageroles, 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
- Mobile counterpart: Mobile: support OpenCode in native Chat UI #9308
- Shared gate:
src/shared/native-chat-agent-support.ts
Reactions are currently unavailable
Activity
andyranitzsch commentedon Sep 9, 2026
any news around this?
Jorgelig commentedon Sep 13, 2026
any news?
lector2002 commentedon Sep 14, 2026
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.
andyranitzsch commentedon Sep 22, 2026
any news?
justeozan commentedon Sep 23, 2026
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:
mainmainA few questions:
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).nwparker commentedon Oct 3, 2026
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.