Skip to content

V2: clarify title/session naming flow #34364

Closed

Description

@opencode-agent

Summary

Clarify and implement V2 title/session naming behavior.

Context

OpenCode already has a customizable title agent for internal title generation. The remaining design work is to make session naming/title generation explicit and useful for V2 consumers without bypassing that customization model.

The generate endpoint was originally mentioned here, but it has since been merged and is not the scope of this issue.

Work

  • Clarify when and how sessions receive generated titles.
  • Decide whether session/title naming is automatic, explicitly triggered, or both.
  • Preserve customizability through the existing title agent.
  • Ensure any protocol/client surface for title/session naming is clear.
  • Cover Discord thread naming as a consumer/use case if it still needs session title output.

Acceptance criteria

  • V2 session title generation behavior is documented.
  • Session naming path uses the customizable title agent where appropriate.
  • Any API/client surface for title naming is clearly named and tested.
  • Discord thread naming has a clear source for generated names.

Activity

  1. opencode-agent commented on Jun 29, 2026

    @opencode-agent
    ContributorAuthor

    Narrowed this issue to title/session naming only. The generate endpoint has already landed, so it is intentionally out of scope here.

  2. changed the title [-]V2: add generate endpoint and clarify title/session naming flow[/-] [+]V2: clarify title/session naming flow[/+] on Jun 29, 2026
  3. self-assigned this
    on Jul 1, 2026
  4. added a commit that references this issue on Jul 1, 2026
    5710064
  5. thdxr commented on Jul 1, 2026

    @thdxr
    Member

    Implemented V2 automatic session title generation in 5710064 (pushed to `v2`):

    • New `SessionTitle` service (`packages/core/src/session/title.ts`) generates a title from the session's sole user message via the existing customizable `title` agent (model override, system prompt, permissions all honored as before), then renames the session via `SessionEvent.Renamed`.
    • Runs at most once per session, gated on durable history having exactly one user message (no default-title string matching).
    • Wired into `SessionRunner` as a background fork that runs after the first turn's prompt promotion, so it doesn't block/extend the provider turn.
    • Covered by `packages/core/test/session-title.test.ts` (generates+renames, skips once a second message exists, skips child sessions, skips when the `title` agent is removed via config) plus full `packages/core` suite (1078 tests) passing.

    This covers the core acceptance criteria: automatic title generation is implemented, uses the customizable `title` agent, and is tested. Filing follow-ups separately for Discord thread naming and any additional client/protocol surface work if still needed.

  6. added a commit that references this issue on Sep 26, 2026
    e683a8d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions