Skip to content

Mobile: support OpenCode in native Chat UI #9308

Closed

Description

@AmethystLiang

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 | grok

Mobile 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:

  1. Long-press / view preference can open an OpenCode session in native Chat UI when the host can read the transcript.
  2. History loads; live append works over the mobile runtime/RPC path.
  3. Messages render readably on small screens (user / assistant / tools as supported).
  4. Send / interrupt (if offered for other agents on mobile) work for OpenCode within the same product rules.
  5. 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

Activity

  1. AlexDesign420 commented on Aug 10, 2026

    @AlexDesign420

    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?

  2. EliasGcf commented on Aug 11, 2026

    @EliasGcf

    +1 having this working would be really great. Being able to use OpenCode in the native mobile chat UI would make a huge difference.

  3. cabraljv commented on Sep 23, 2026

    @cabraljv

    +1 waiting it to come

  4. nwparker commented on Oct 3, 2026

    @nwparker
    Contributor

    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.

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