You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: Auto-generate session titles in desktop app #30926
In the OpenCode desktop app, new chats currently appear in the sidebar as "New session", even after the conversation has started.
This makes it hard to identify previous sessions when there are multiple chats.
It would be useful if the desktop app automatically generated a short title for each session based on the first prompt or conversation context, similar to Codex.
Expected behavior
After a session starts, "New session" should be replaced with a short meaningful title, for example:
Plan phase 2
Refine menu and dark mode
Fix dark mode issue
Current behavior
All new sessions stay labeled as "New session" in the sidebar.
Why this helps
It makes session history easier to scan and helps users quickly return to the right conversation.
It is something requested from a very long time. I request the maintainers to assign this issue to me so I can fix it right away.
Note: Auto-title generation already exists in OpenCode (based on the first message), so this may be specifically about the Desktop app not reflecting that title in the sidebar. If so, it may be more of a bug/display issue rather than a new feature — please clarify if that is the case.
Confirmed: this is a regression/intermittent bug, not a missing feature
The compliance bot's own note hinted at this ("Auto-title generation already exists in OpenCode... may be more of a bug/display issue") - I have concrete evidence.
Proof from session DB
Querying my local opencode.db (v1.17.13), last 15 sessions:
Title
Created
Find LID 2026 photos/assets (@explore subagent)
17:54:02
New session - 2026-07-06T22:33:57.776Z
22:33:57
New session - 2026-07-06T22:16:22.616Z
22:16:22
New session - 2026-07-06T18:44:08.602Z
18:44:08
New session - 2026-07-06T16:45:41.814Z
16:45:41
... (12 more all "New session - ")
...
1 of 15 sessions got a real title; the other 14 stayed as the generic timestamp placeholder. Same opencode version, same day, same project. The title-generation feature exists and works - it just fails to fire on most sessions.
What seems different about the one that worked
The titled session was a subagent dispatch (@explore subagent, visible in the title text itself). This suggests:
Subagent sessions trigger title generation reliably (maybe because they have a clear initial instruction)
Top-level user sessions often don't get a title generated from the first message
What to investigate
Is title generation triggered by the first user message, the first assistant response, or only certain session types (subagent)?
Is there a race condition where the title-update write gets dropped if the session tab is closed/backgrounded quickly?
v1.16.0 changelog mentions "Fixed tab title truncation" - was something in that area broken since?
Happy to provide more session data or test a fix if useful. This makes the desktop multi-session UX genuinely unusable - the sidebar is just a wall of identical "New session" entries.
Reacted by Brian, H.Alper Tuna and Misha Merkushin
Same pain here — hundreds of sessions stay labeled "New session..." in the sidebar, which also makes finding past conversations harder (I filed #41354 about cross-session search). Auto-title from the first prompt helps both.
Root cause found (with reproducible evidence): silent small_model failure, swallowed and never retried
Following up on my earlier comment from July 6 where I hypothesized a UI/race bug — I dug into the logs and found the actual cause. It's not intermittent, it's deterministic, and it's a config/provider issue masquerading as a missing feature.
The mechanism
Title generation runs exactly once per session, right after the first user message (ensureTitle in packages/opencode/src/session/prompt.ts). It resolves the model as: the title agent's model, else small_model from config, else the session model. If the LLM call fails, the error is swallowed by Effect.ignore (prompt.ts:1139) and never retried — on the next user message, history.filter(real).length !== 1 is false, so ensureTitle returns early forever. The session keeps New session - <timestamp> for life.
Subagent sessions are unaffected because their title is set synchronously at creation (... (@agent subagent)), bypassing the title agent entirely — which is exactly the pattern I reported on July 6 (1/15 sessions titled, the titled one being a subagent dispatch).
The evidence
Grepping my local opencode.db (~/.local/share/opencode/opencode.db), every untitled top-level session had a matching error in ~/.local/share/opencode/log/opencode.log:
level=ERROR message="stream error" providerID=fireworks modelID=glm-4p7-flash small=true agent=title error.error="AI_APICallError: Model not found, inaccessible, and/or not deployed"
One stream error per untitled session, all naming the same small_model. In my case this had two layers:
small_model pointed at fireworks/glm-4p7-flash, a model id Fireworks had retired (404 Model not found).
The deeper blocker: the Fireworks account itself was suspended for billing (412 Account ... is suspended, possibly due to reaching the monthly spending limit). My main model ran on a different provider (OpenRouter), so the app worked fine — only small_model (on Fireworks) failed, silently, taking the session titles down with it.
The fix (user-side)
Point small_model at a live, independent provider. In opencode.json:
Cost is negligible (~0.01 USD/year for ~10 sessions/day). After restart, new sessions auto-title and the sidebar is usable again. I backfilled 21 past untitled sessions by generating a title from each session's first user message and updating session.title directly in the DB.
Suggestion for maintainers
The user-visible symptom ("wall of New session") is caused by a config/provider problem, but the fragility is in the title path itself:
No retry. Title generation fires once and only once. If the LLM call fails for any transient reason (rate limit, timeout, a flaky small_model id, billing suspension), the session is permanently untitled. A retry on the next user message (relax the history.filter(real).length !== 1 guard to === 1 on first attempt, or retry while isDefaultTitle is true) would recover most of these cases.
Silent failure.Effect.ignore on the forked title fiber means the error never surfaces — not even in the TUI. Logging the title failure (or surfacing a one-time warning when isDefaultTitle is still true after N messages) would make this self-diagnosable instead of a GitHub ticket.
The diagnostic recipe for anyone hitting this: rg "agent=title" ~/.local/share/opencode/log/opencode.log — if you see stream error lines, your small_model (or its provider account) is the culprit, not the title feature.
Reacted by H.Alper Tuna
liudongyan13701205717-source commented on Aug 15, 2026
Cross-link with #41363 (session tree/branch history) — both about session management/navigation. Auto titles (#30926) help a session tree (#41363) stay readable. +1, still relevant.
V2 automatically generates session titles from the first user message and updates them in the desktop UI. If the title model fails, it tries the primary model, and untitled sessions can retry on later messages. To get v2: npm i -g @opencode/cli@latest or curl -fsSL https://opencode.ai/v2/install | bash (desktop: update the app). If you still see this on v2, please open a new issue with the details.
Activity
github-actions commentedon Jun 5, 2026
This issue might be a duplicate of existing issues. Please check:
Note: Auto-title generation already exists in OpenCode (based on the first message), so this may be specifically about the Desktop app not reflecting that title in the sidebar. If so, it may be more of a bug/display issue rather than a new feature — please clarify if that is the case.
fdebane commentedon Jul 6, 2026
Confirmed: this is a regression/intermittent bug, not a missing feature
The compliance bot's own note hinted at this ("Auto-title generation already exists in OpenCode... may be more of a bug/display issue") - I have concrete evidence.
Proof from session DB
Querying my local opencode.db (v1.17.13), last 15 sessions:
Find LID 2026 photos/assets (@explore subagent)New session - 2026-07-06T22:33:57.776ZNew session - 2026-07-06T22:16:22.616ZNew session - 2026-07-06T18:44:08.602ZNew session - 2026-07-06T16:45:41.814Z1 of 15 sessions got a real title; the other 14 stayed as the generic timestamp placeholder. Same opencode version, same day, same project. The title-generation feature exists and works - it just fails to fire on most sessions.
What seems different about the one that worked
The titled session was a subagent dispatch (
@exploresubagent, visible in the title text itself). This suggests:What to investigate
Happy to provide more session data or test a fix if useful. This makes the desktop multi-session UX genuinely unusable - the sidebar is just a wall of identical "New session" entries.
bibendi commentedon Jul 15, 2026
I've got the same issue after upgrade of OpenCode Desktop today
bibendi commentedon Jul 16, 2026
Update: it doesn't work only on the new Desktop layout.
liudongyan13701205717-source commentedon Aug 9, 2026
Same pain here — hundreds of sessions stay labeled "New session..." in the sidebar, which also makes finding past conversations harder (I filed #41354 about cross-session search). Auto-title from the first prompt helps both.
fdebane commentedon Aug 9, 2026
Root cause found (with reproducible evidence): silent
small_modelfailure, swallowed and never retriedFollowing up on my earlier comment from July 6 where I hypothesized a UI/race bug — I dug into the logs and found the actual cause. It's not intermittent, it's deterministic, and it's a config/provider issue masquerading as a missing feature.
The mechanism
Title generation runs exactly once per session, right after the first user message (
ensureTitleinpackages/opencode/src/session/prompt.ts). It resolves the model as: thetitleagent's model, elsesmall_modelfrom config, else the session model. If the LLM call fails, the error is swallowed byEffect.ignore(prompt.ts:1139) and never retried — on the next user message,history.filter(real).length !== 1is false, soensureTitlereturns early forever. The session keepsNew session - <timestamp>for life.Subagent sessions are unaffected because their title is set synchronously at creation (
... (@agent subagent)), bypassing thetitleagent entirely — which is exactly the pattern I reported on July 6 (1/15 sessions titled, the titled one being a subagent dispatch).The evidence
Grepping my local opencode.db (
~/.local/share/opencode/opencode.db), every untitled top-level session had a matching error in~/.local/share/opencode/log/opencode.log:One
stream errorper untitled session, all naming the samesmall_model. In my case this had two layers:small_modelpointed atfireworks/glm-4p7-flash, a model id Fireworks had retired (404Model not found).Account ... is suspended, possibly due to reaching the monthly spending limit). My main model ran on a different provider (OpenRouter), so the app worked fine — onlysmall_model(on Fireworks) failed, silently, taking the session titles down with it.The fix (user-side)
Point
small_modelat a live, independent provider. Inopencode.json:Cost is negligible (~0.01 USD/year for ~10 sessions/day). After restart, new sessions auto-title and the sidebar is usable again. I backfilled 21 past untitled sessions by generating a title from each session's first user message and updating
session.titledirectly in the DB.Suggestion for maintainers
The user-visible symptom ("wall of New session") is caused by a config/provider problem, but the fragility is in the title path itself:
history.filter(real).length !== 1guard to=== 1on first attempt, or retry whileisDefaultTitleis true) would recover most of these cases.Effect.ignoreon the forked title fiber means the error never surfaces — not even in the TUI. Logging the title failure (or surfacing a one-time warning whenisDefaultTitleis still true after N messages) would make this self-diagnosable instead of a GitHub ticket.The diagnostic recipe for anyone hitting this:
rg "agent=title" ~/.local/share/opencode/log/opencode.log— if you seestream errorlines, yoursmall_model(or its provider account) is the culprit, not the title feature.liudongyan13701205717-source commentedon Aug 15, 2026
Cross-link with #41363 (session tree/branch history) — both about session management/navigation. Auto titles (#30926) help a session tree (#41363) stay readable. +1, still relevant.
Q1583 commentedon Aug 21, 2026
这个需求太重要了,官方为什么就不能修复一下,多项目并行总是New session,根本分不清谁是谁,哪个在运行,稍微搞错了就将A项目弄到B项目里,浪费时间,而且特么容易对项目的上下文产生干扰
neriousy commentedon Oct 19, 2026
V2 automatically generates session titles from the first user message and updates them in the desktop UI. If the title model fails, it tries the primary model, and untitled sessions can retry on later messages. To get v2:
npm i -g @opencode/cli@latestorcurl -fsSL https://opencode.ai/v2/install | bash(desktop: update the app). If you still see this on v2, please open a new issue with the details.