Repository navigation
Description
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_atat 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
opencode-agent commentedon Jul 31, 2026
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.