Skip to content

tui: new sessions retain Thinking, User, or Asking as their title #57043

Open

Description

@pgasparini-byte

Summary

New sessions in the OpenCode V2 TUI sometimes display generic activity labels such as Thinking, User, or Asking instead of receiving a descriptive title derived from the first prompt.

This makes concurrent sessions difficult to distinguish and appears to be a regression from the previous automatic session-title behavior.

Environment

  • opencode version: 2.0.32
  • OS: Darwin 24.6.0, macOS arm64
  • Terminal: Apple Terminal, TERM=xterm-256color
  • Shell: /bin/zsh
  • Install/channel: latest release
  • Active plugins: none found in configuration

Reproduction

  1. Start OpenCode V2.
  2. Create a new session.
  3. Send the first user prompt and wait for the assistant turn to complete.
  4. Open additional sessions and repeat.
  5. Observe the titles shown in the TUI session tabs or session list.

Expected Behavior

Each session should receive a short, descriptive title derived from its first user prompt, as in the previous automatic session-title behavior.

Temporary execution-state labels may be shown while a turn is running, but they should not remain as the session title.

Actual Behavior

New sessions remain identified by generic labels such as:

  • Thinking
  • User
  • Asking

These labels describe message roles or execution states rather than the subject of the session. They make multiple concurrent sessions difficult to identify without manually renaming them.

Additional Context

  • The behavior was observed after updating to OpenCode V2.
  • Restarting OpenCode does not resolve it.
  • Manual session renaming is a workaround, but every affected session must be renamed individually.
  • No active OpenCode plugins were found that would appear to override title generation.
  • Related but not identical: Title agent produces conversational replies instead of session titles (V2) #54185, where the title agent produces conversational responses instead of concise titles.

Activity

  1. opencode-agent commented on Oct 19, 2026

    @opencode-agent
    Contributor

    Thanks for the clear report, @pgasparini-byte.

    In v2 the session title comes from a background request to a model. OpenCode keeps the first line of what that model writes. The TUI doesn't put labels like Thinking into the title itself, so Thinking, User or Asking were most likely written by the model, and that depends a lot on which model it is. To narrow it down, could you share:

    1. The provider and model you use for sessions, e.g. anthropic/..., openai/..., or a local or self-hosted model. Please say whether it is a reasoning or thinking model.
    2. Any title or small-model setting in your config, e.g. an agents.title override or a small model setting. If you have none, just say so.
    3. One concrete example: the exact first prompt you sent and the title the session ended up with.

    You can reply here with the details, or edit the issue. If you edit it, please also leave a comment saying you've updated it, so we know you're done.

    Related issues, ordered by likelihood that they cover the same problem:

  2. pgasparini-byte commented on Oct 19, 2026

    @pgasparini-byte
    Author

    Thanks — I checked the local configuration and the persisted session data.

    Configuration

    • Session model: litellm-team/auto
    • Small model: litellm-team/lite
    • Provider: a self-hosted LiteLLM gateway (litellm.turbocrowd.net)
    • agents.title: no override configured
    • Plugins: none configured

    I cannot confirm the exact downstream model selected by the LiteLLM router for every title request, but the affected titles strongly indicate that a reasoning/thinking-capable model is being used for title generation, or that its reasoning output is not being stripped before OpenCode stores the first line.

    Concrete persisted example

    First prompt:

    /mcps
    

    Stored session title:

    <think>The user message is "/mcps" - a command likely related to MCP servers. Need a brief title....
    

    This is not a user-facing title. It is clearly internal reasoning from the title-generation request, persisted verbatim as the session title.

    The same local session history also contains another title beginning with:

    <think>The user is asking in Italian about Qonto (a business banking/finance tool) - wanting help...
    

    This likely explains the user-facing Thinking, User, and Asking labels reported earlier: they appear to be short or first-line fragments emitted by the title model, not TUI activity labels.

    This seems especially close to #51997 and #54401. A title-generation path that strips <think>...</think> / reasoning output and validates the remaining title before persistence would address this case.

    No agents.title override is currently configured. If you can confirm the recommended configuration for a dedicated non-reasoning title model in a LiteLLM-routed setup, I can test it as a workaround.

  3. opencode-agent commented on Oct 19, 2026

    @opencode-agent
    Contributor

    Thanks for the extra details, @pgasparini-byte. I can confirm this.

    I used a simulated title model that returns its reasoning inline as plain text, <think>The user message is "/mcps" … Need a brief title.</think> followed by MCP servers list, which is how your LiteLLM gateway appears to pass it through. After the first prompt, the session tab title became <think>The user message is "… instead of MCP servers list. The recording and screenshot below show it, and the script below reproduces it.

    It happens on 2.0.32 and still happens on the latest dev (cec70f3). v2's title code keeps the first non-empty line of the title model's output and doesn't remove <think>…</think> blocks first. v1 used to strip them.

    My simulation stands in for the gateway, so I couldn't confirm that your LiteLLM router sends the reasoning as plain text. Your stored titles suggest it does.

    Until this is addressed, a possible workaround is to point the title agent at a model that doesn't emit reasoning, e.g. a non-reasoning LiteLLM model as small_model, or an agents.title override with such a model. Turning reasoning off for that model on the LiteLLM side should also work.

    Related: #51997 (model commentary taken as the title) and #54401 (no output limit on title requests).

    recording.mp4

    Screenshot

    Reproduction script (drive.ts)
    // Repro for anomalyco/opencode#57043: title model output containing inline
    // <think>...</think> reasoning (as some OpenAI-compatible gateways such as
    // LiteLLM return it) is saved verbatim as the session title.
    import { Effect } from "effect"
    import { Llm, OpenCodeDriver } from "opencode-drive"
    
    const TITLE_OUTPUT =
      '<think>The user message is "/mcps" - a command likely related to MCP servers. Need a brief title.</think>\nMCP servers list'
    
    export default OpenCodeDriver.use(
      {
        ...(process.env.OC_DEV ? { opencode: { dev: process.env.OC_DEV } } : {}),
        tui: { recording: true },
      },
      ({ ui, llm }) =>
        Effect.gen(function* () {
          // Simulated title model streams reasoning inline in the text channel.
          yield* llm.title(() => Effect.succeed(TITLE_OUTPUT))
          yield* llm.queue(Llm.text("Here are your MCP servers."))
          yield* ui.submit("list my mcp servers")
          yield* ui.waitFor("Here are your MCP servers.")
          yield* Effect.sleep("3 seconds")
          yield* ui.screenshot("after-title")
          yield* ui.waitFor("<think>")
          yield* ui.screenshot("think-title")
        }),
    )

    Run it with opencode-drive: opencode-drive run ./drive.ts. It drives opencode from your PATH; set OC_DEV to the path of an OpenCode checkout to run that from source instead.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions