feat: distinguish between a session name and its first prompt#157
Merged
vakovalskii merged 4 commits intovakovalskii:mainfrom Apr 10, 2026
Merged
Conversation
apstenku123
added a commit
to apstenku123/codedash
that referenced
this pull request
Apr 11, 2026
- vakovalskii#155 clipboard copy fallback on non-secure origins (execCommand shim) - vakovalskii#156 star button sync in detail panel (already applied earlier) - vakovalskii#159 bind address vs browser URL separation (execFile, safer) - ca70fd2 dual metrics: user_messages (real) + total_interactions (all) - d3f4326 Node >= 18 version check at startup with clear error Skipped: vakovalskii#100 Warp launch config (non-iTerm2), vakovalskii#157 session name refactor (too many touches), vakovalskii#160 badge display config (non-critical), analytics totalSessionsAll (already have similar in createCostAggregator).
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.
Summary
This PR distinguishes between a session's metadata-derived name and its first prompt by introducing a separate
session_namefield in session data.Before this change,
first_messagewas overloaded:That made the model ambiguous and forced the UI to guess whether it was rendering a real session name or just fallback prompt text.
This PR separates those concerns:
session_namenow stores a trusted metadata-derived session namefirst_messageremains the fallback prompt/display textTrusted
session_namesources in this PR:custom-titlethread_nametitleWhy This Functionality Is Added
The detail view and session lists need to represent two different concepts cleanly:
Without a separate field, the UI cannot tell these apart. That causes several problems:
By introducing
session_name, the app can now:AI title -> session_name -> emptyUser-Facing Behavior
Session Details
The detail panel now follows this logic for the
Namerow:session_nameGenerate AI Nameaction availableThis is intentional: the detail panel is now strict about showing a real name, not the first prompt.
Projects / All Sessions / Related Views
List-style display surfaces continue to show the best available session label, now with explicit fallback:
session_name || first_messageThis preserves the existing UX expectation that every session row should still show something meaningful about what the session is about.
Search
Search now considers both:
session_namefirst_messageThis preserves discoverability whether the user remembers the formal session title or the original first prompt.
Why This Does Not Break Anything
This change is intentionally backward-compatible in behavior.
1. Existing sessions without
session_namestill workMost tools do not provide a reliable metadata title. For those sessions:
session_nameis simply emptyfirst_messagein list/card/search surfacesSo sessions that previously displayed correctly continue to display correctly.
2. No removal of
first_messagefirst_messageis not removed or repurposed into something incompatible. It remains available everywhere it was before, and continues to power fallback labeling and prompt-based discovery.The change is additive in the data model:
session_namefirst_message3. Detail panel behavior becomes stricter by design, not broken
The detail panel now prefers:
This is a deliberate semantic improvement. It avoids showing the first prompt as if it were a true session name. The action to generate an AI name remains available, so no capability is lost.
4. Search remains compatible
If title text moved entirely out of
first_messagewithout updating search, users could lose the ability to find sessions by title. This PR avoids that by explicitly searching bothsession_nameandfirst_message.So search behavior is preserved and improved.
5. Cloud and related displays stay consistent
Cloud-facing display and serialization now also prefer the best available label. That avoids local/cloud divergence for agents that provide a trusted session name.
Implementation Notes
session_namepopulation in session loaders for Claude Code, Codex, and OpenCodefirst_messageas prompt/display fallback textsession_name || first_messageAI title -> session_name -> emptyRisk Assessment
Risk is low because:
session_nameThe main semantic change is limited to the detail panel, where showing only a real name is the intended new behavior.