Repository navigation
Mobile: support OpenCode in native Chat UI #9308
Description
Summary
Add OpenCode support to the mobile native Chat UI so OpenCode sessions can be viewed on iOS/Android companion the same way Claude / Codex (and other chat-capable agents) are today.
Context
Mobile native chat eligibility goes through the shared support set:
// src/shared/native-chat-agent-support.ts
NATIVE_CHAT_SUPPORTED_AGENTS = claude | openclaude | codex | grokMobile resolves chat via resolveMobileNativeChat / canShowMobileNativeChat (mobile/src/session/mobile-native-chat-eligibility.ts), which calls isNativeChatSupportedAgent. OpenCode is recognized as an agent for TUI launch/status on mobile, but not for native chat.
Desktop tracks OpenCode chat separately; mobile needs its own UI, transport, and session-preference work.
Expected
On mobile:
- Long-press / view preference can open an OpenCode session in native Chat UI when the host can read the transcript.
- History loads; live append works over the mobile runtime/RPC path.
- Messages render readably on small screens (user / assistant / tools as supported).
- Send / interrupt (if offered for other agents on mobile) work for OpenCode within the same product rules.
- If transcript is not host-readable (e.g. certain remote layouts), gate cleanly like Grok’s local-readability check—no crash, optional terminal-only fallback.
Actual
isNativeChatSupportedAgent('opencode') is false → mobile chat toggle / resolution returns null for OpenCode tabs.
Implementation notes (mobile)
Likely touch points:
- Shared:
src/shared/native-chat-agent-support.ts(coordinate with desktop; shared gate) - Host/runtime: OpenCode transcript read + subscribe (same main/native-chat or relay path desktop uses)
mobile/src/session/mobile-native-chat-eligibility.ts— eligibility once support is true- Mobile chat merge / stream / empty states
- Session view preferences (terminal vs chat) for OpenCode tabs
- Tests under
mobile/src/session/for eligibility and merge
Depends on knowing OpenCode transcript path + schema on the host Orca is connected to.
Acceptance
- OpenCode session tab can enter native chat on mobile when transcript is readable
- History + live updates work over the companion connection
- Preference terminal ↔ chat works for OpenCode
- Remote/unreadability cases degrade safely
- No regression for existing mobile chat agents
Related
- Desktop counterpart: Desktop: support OpenCode in native Chat UI #9307
- Shared gate:
src/shared/native-chat-agent-support.ts - Mobile eligibility:
mobile/src/session/mobile-native-chat-eligibility.ts
Activity
AlexDesign420 commentedon Aug 10, 2026
Also hitting this — tried a fresh OpenCode session on mobile (2026-08-10), still falls back to the plain terminal instead of native chat. Would be great to see #13287 land, since #13576 already had a working implementation (128 tests passing) before it got closed. Any ETA?
EliasGcf commentedon Aug 11, 2026
+1 having this working would be really great. Being able to use OpenCode in the native mobile chat UI would make a huge difference.
cabraljv commentedon Sep 23, 2026
+1 waiting it to come
nwparker commentedon Oct 3, 2026
Implemented mobile 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 are attached; this proves actual transcript data and rendering. Mobile eligibility, preference, transport and permission controls pass; no physical iOS/Android device test is claimed.
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.