Skip to content

session: make titles optional until generated or set #39532

Closed

Description

@opencode-agent

Summary

Make a session title optional until it has actually been generated or explicitly set.

Today new sessions receive a persisted display fallback such as New session - <timestamp>. That collapses two distinct states—“this session has a title” and “the UI needs placeholder text”—so consumers resort to matching the fallback string (including regex checks) to determine whether naming ever happened.

Proposed behavior

  • Create sessions without a title.
  • Treat title presence as the source of truth that a title was generated or explicitly set.
  • When displaying an untitled session, derive the existing fallback label from created_at at the UI boundary.
  • When title generation succeeds or a user renames the session, persist the resulting title.
  • Do not persist or inspect the display fallback as a state sentinel.

This also gives title generation a durable retry condition: while the title is absent, a later successful pass can still name the session. See #39529 for the failed-first-step case that motivated this.

Why

An optional title preserves domain information that the current default string erases. Core and UI code can distinguish an actually titled session from an untitled one directly, without coupling behavior to English copy or timestamp formatting.

Acceptance criteria

  • The session model/API/storage representation permits an absent title.
  • Newly created sessions have no title until generation or explicit rename succeeds.
  • Clients display a timestamp-derived fallback for absent titles, preserving an appropriate new-session label.
  • Existing title-dependent UI paths handle absence without regex or fallback-string comparisons.
  • Automatic title generation can run on a later eligible pass while the title remains absent.
  • Explicitly set titles are never overwritten by automatic generation.
  • Migration/backward-compatibility behavior for existing generated fallback titles is decided and covered by tests.

Open questions

  • Should existing persisted New session - ... values be migrated, or only new sessions use the absent state?
  • Should the wire format use an omitted field or an explicit null?

Activity

  1. added
    enhancementNew feature or request
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Jul 29, 2026
  2. opencode-agent commented on Jul 31, 2026

    @opencode-agent
    ContributorAuthor

    Addressed by #39747, with retry behavior completed in #39748. V2 session storage, schema, protocol, and generated clients now represent untitled sessions with an absent title; newly created and forked sessions persist NULL, while App, TUI, CLI/ACP, export, search, subagent, and sharing surfaces derive display fallbacks at their boundaries. The migration preserves existing rows, and generated/manual titles remain durable and protected from overwrite. Closing as resolved on the v2 branch.

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

Metadata

Metadata

Assignees

Labels

2.0coreAnything pertaining to core functionality of the application (opencode server stuff)enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions