feat(session): make generated titles optional - #39747
Merged
Merged
Conversation
kitlangton
force-pushed
the
optional-session-title
branch
from
July 31, 2026 00:11
70567d5 to
5f8e8b8
Compare
kitlangton
force-pushed
the
optional-session-title
branch
from
July 31, 2026 00:44
5f8e8b8 to
8eb2231
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Sessions now remain genuinely untitled until automatic generation succeeds or a user explicitly renames them. New sessions store
NULL, current and transitional API contracts omittitlewhen absent, and App, TUI, CLI/ACP, export, search, terminal-title, subagent, and share surfaces derive their existing display fallbacks at the boundary.Closes #39532.
Before / After
Before: creating a session persisted
New session - <timestamp>. Domain code could not distinguish a generated or explicit title from placeholder copy without matching English strings, and that placeholder could not serve as a durable retry signal.After: creating or forking an untitled session stores no title. Consumers display the appropriate new/child-session fallback without treating it as persisted state; successful generation and explicit renames still persist real titles.
How
packages/schemamakes current and transitional session titles optional with the sharedoptional(...)helper, so generated clients omit absent keys instead of encodingnull.packages/coremakessession.titlenullable, maps SQLiteNULLtoundefined, and stops assigning fallback strings during create/fork.sessiontable, its indexes, or its foreign-key relationships.packages/app,packages/tui,packages/cli, andpackages/enterprisederive fallback labels only where titles are rendered or exported.packages/clientwas regenerated withbun run generate.Scope
This PR establishes the durable untitled state and preserves historical fallback rows. Retry scheduling and explicit-title race protection are intentionally layered in #39748.
Testing
packages/core:bun typecheckpackages/core:bun run migration --checkpackages/core: migration and session creation regressionspackages/schema:bun typecheck; contract hygiene testspackages/client:bun typecheckpackages/cli:bun typecheckpackages/tui:bun typecheck;bun run test -- test/util/session.test.ts test/context/session-tabs-model.test.tspackages/app:bun typecheck; focusedsession-title.test.tspackages/enterprise:bun typecheck150.20 msfor 10,000,000 consumed calls versus the recorded237.89 msbaseline~/.config/opencode/plugins/voice.tsin a fixture expecting only its two invalid pluginsFlow
flowchart LR Create[Create or fork session] --> Store[(SQLite title = NULL)] Store --> API[API omits title] API --> Display{Display boundary} Display --> Root[New session fallback] Display --> Child[Child session fallback] Rename[Generated or explicit rename] --> Persist[(Persist real title)] Persist --> API