Skip to content

OpenCode: show user messages sent from another client (e.g. the TUI) in the thread #27807

Closed

Description

@SidneyJob

When T3 Code is attached to an existing OpenCode server (provider settings → Server URL / Server password), the same session can also be used from another OpenCode client, e.g. the OpenCode TUI on the laptop. Replies to prompts sent from that client do show up in the T3 thread (as "Background activity updated"), but the user's own prompt does not. A long thread then reads as a list of assistant answers with no questions, which makes it hard to follow.

Steps to reproduce (t3 0.1.5, OpenCode 2.2.4):

  1. Run opencode service start and point T3's OpenCode provider at it (Server URL + Server password).
  2. Start a thread in T3 with the OpenCode provider and send "Привет". It shows normally.
  3. Open the same session in the OpenCode TUI and send "qwe!".
  4. In T3 (web or mobile), the assistant's answer to "qwe!" appears after "Background activity updated", but the "qwe!" message itself is missing.

Expected: user messages sent from another client appear in the thread like messages sent from T3, so the conversation reads in order.

Where: packages/provider-opencode/src/server/adapter.ts, handlePartUpdated. User text parts are projected only for child (subagent) turns:

if (part.type === "text" && state.messageRoles.get(part.messageID) === "user") {
  if (!turn.isRoot) yield* projectChildUserPart(state, turn, part);
  return;
}

For root turns started by another client, the part is dropped. Projecting those parts as user messages (marked as coming from another client, if that's useful) would fix it. The snapshot path (readSnapshot) already keeps user messages (createdBy: info.role === "user" ? "user" : "agent").

Related: #10826 (importing OpenCode sessions started outside T3).

Activity

  1. RanDumSocks commented on Nov 6, 2026

    @RanDumSocks

    same. reproducible via phone web UI over Tailscale, T3 desktop 0.1.7, even persists after refresh

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions