Skip to content

acp: generated session titles are never pushed to clients (no session_info_update with title) #56894

Open

Description

@gultaj

Summary

When running opencode acp, auto-generated session titles never reach the ACP client. Core OpenCode generates a title after the first user message and internally publishes the rename (bus event SessionEvent.Renamed), but the ACP adapter never forwards it: no session/update notification with sessionUpdate: "session_info_update" and a title field is ever sent. The generated title is only discoverable via session/list.

ACP clients that display dynamic session names from session_info_update (as documented in the ACP core schema — SessionInfoUpdate: "This allows clients to display dynamic session names") therefore keep a static fallback label forever. Example consumer: the ACP Pro VS Code extension, which updates tab titles exclusively from session_info_update — with OpenCode its tabs never rename after the first prompt, while agents that do push titles (e.g. Claude Code's ACP adapter) rename correctly.

Environment

  • opencode version: 2.0.32 (also verified in v1.19.3 sources — same gap)
  • OS: Windows_NT 10.0.22621.6060 (win32 x64)
  • Terminal: Unavailable — ACP runs over stdio (opencode acp) from an IDE client; no terminal involved
  • Shell: C:\Windows\system32\cmd.exe (ComSpec)
  • Install/channel: latest (npm global @opencode/cli, channel=latest from CLI logs)
  • Active plugins: none configured (cli.json / opencode.jsonc contain no plugins entries)

Reproduction

With a minimal scripted ACP client against opencode acp (v2.0.32):

  1. initialize → session/new (cwd = project directory, no mcpServers) → wait for the response.
  2. session/prompt with a short message → wait for stopReason: "end_turn" (the turn completes normally, usage_update and message chunks are received as expected).
  3. Record every session/update notification for the entire session lifetime → zero session_info_update messages are received.
  4. ~9 seconds after the turn, call session/list: the new session is listed with the LLM-generated title (e.g. "Тест: ответ одним словом" for the prompt "Ответь ровно одним словом: ок") — the title has been generated server-side, but was never pushed to the client.

Reproducible consistently (3 independent runs, v2.0.32). Also reproducible from a GUI client: ACP Pro 0.3.9 + OpenCode, first prompt → tab label never renames.

Expected Behavior

Per the ACP schema, an agent should notify the client when session metadata changes:

{
  "sessionUpdate": "session_info_update",
  "title": "<generated title>",
  "updatedAt": "<iso ts>"
}

OpenCode already has the exact hook for this: packages/core/src/session/title.ts publishes SessionEvent.Renamed to the bus when a title is generated or regenerated. Forwarding that event through the ACP adapter as a session_info_update would make dynamic session names work for all ACP clients.

Additionally, session/load replay (packages/cli/src/acp/replay.ts) never tells the client the loaded session's current title either — pushing one session_info_update at the start of the replay would let clients label restored sessions correctly.

Actual Behavior

No session_info_update with a title is ever sent. In the current source (HEAD 501b15af26915ba52682e20e220e7e137e89e92f):

  • packages/cli/src/acp/translate.ts — session_info_update is used only for the retry marker _meta["opencode/retry"]; nothing maps SessionEvent.Renamed / title changes.
  • packages/cli/src/acp/service.ts — listSessions maps session.title into the session/list response (with a "New session - <timestamp>" fallback), so titles surface only when the client re-lists sessions on its own.
  • packages/cli/src/acp/replay.ts — contains no title forwarding.

Same for tag v1.19.3 (packages/opencode/src/acp/*): session/list returns title, nothing pushes renames. So no OpenCode release has ever implemented this part of the protocol; clients never received a push.

Additional Context

  • Title generation itself works in ACP mode: session/list returned generated titles seconds after a completed turn in every test run, so the fix is purely the push (plus a one-time title announcement on session/load).
  • Title generation can fail (e.g. AI_APICallError: Insufficient account funds seen in logs for the title agent's small model); in that case session/list keeps the timestamped fallback. Even when generation succeeds, though, nothing is pushed — the client can't tell the difference without polling session/list.
  • Current client-side workaround: re-open the session (the client picks the title up from session/list), or poll session/list after each turn end.
  • Frequency: always; user-visible impact: ACP client tab/session labels never auto-rename with OpenCode.

References

Activity

  1. opencode-agent commented on Oct 18, 2026

    @opencode-agent
    Contributor

    Thanks for the detailed write-up and the source pointers, @gultaj!

    To restate the request: when OpenCode generates or changes a session's title, opencode acp should send a session_info_update with the title to the client, and send the current title when a session is loaded with session/load. That way clients can rename their tabs and threads without polling session/list.

    I checked the current dev code and it matches what you found. Core publishes SessionEvent.Renamed, but the ACP adapter in packages/cli/src/acp/ doesn't forward it, and the only session_info_update messages it sends are the retry and compaction markers. Sending this notification is optional in ACP and OpenCode has never done it, so I've filed this as a feature request. Maintainers will consider it.

    Related:

    For now, the workaround you mentioned still works: call session/list again after a turn ends.

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