Show agent-provided session names in the sidebar - #601
Conversation
roborev: Combined Review (
|
|
Thanks for the review — addressed all three Medium findings, each in its own commit with a test that fails on the unpatched code:
Note: the failing frontend |
roborev: Combined Review (
|
|
Addressed the follow-up finding (
I also swept the rest of the codebase for the same class of omission (every I didn't think it belonged in the export format, but happy to add if needed. |
roborev: Combined Review (
|
|
Addressed the breadcrumb/consistency finding (
One remaining ungated path — question for @roborev-ci: the Pinned page's common code path renders @roborev-ci — should we thread |
roborev: Combined Review (
|
|
Hmm, this seems to be sprawling. I'll convert to draft and see if there is any interest from human maintainers, and what the scope should be. Just changing the titles in the sidebar was easy, but it would probably be better to use consistent names everywhere. An alternative design would be having |
|
I'm not entirely sure if we want to have the complexity of the feature flagging? Presumably if a user went to the effor of naming their sessions using /rename etc there is no reason to not show those. I would hazard a guess that removing the use-session-names toggle removes the need for a frontend name-source field etc. Ultimately having some coalesce based cascade feels like the correct implementation that users would expect. |
|
Hi @mariusvniekerk. Thanks for the review! Sure, I was being cautious with the feature flag but I agree it’s probably not worth the complexity. I think an extra field would be required for the behavior that user-entered name is preferred to session name, and goes back to session name if the entered name is removed. It could be a flag (as implemented) or a string. However, maybe if we relax it to last-one-wins or letting the session name win over the user-entered name, it could be just one field. I’ll investigate. Result: still two fields, but db-only; see below. |
|
@gordonwoodhull on the db model we should store all the names we can, and just send the correct computed field to the frontend from the golang side, keeps this a concern for the backend only and the frontend remains blissfully unaware |
|
Thanks @mariusvniekerk — fully agree. I've reworked the branch to implement the coalesce-based cascade with What changed The "Use session names" toggle and all frontend
Cascade behavior
Bugs fixed along the way
What's kept
|
7ba8975 to
80485cd
Compare
roborev: Combined Review (
|
|
(Response written by AI for concision and accuracy; opinions are mine.) Finding 1 (PG Finding 2 (imported sessions): This one is real. File-backed sessions (Claude Code, Copilot, etc.) work correctly — clearing a user rename immediately re-parses the session file and restores the agent name. But imported sessions (Claude AI export, ChatGPT export) have no backing file, so clearing a rename falls back to the first-message preview rather than the imported conversation title. The fix would require storing the user override and the agent title in separate fields, which is the more complex two-field design we moved away from. What would you like to do here? |
roborev: Combined Review (
|
roborev: Combined Review (
|
|
Previous round of fixes ( roborev's review of
Current round ( Finding 1 (imported sessions): Already raised with the human reviewers here — still waiting on direction. Finding 2 ( |
roborev: Combined Review (
|
|
Finding 1 (imported sessions): Covered here — still waiting on direction from the human reviewers. Finding 3 (PG Finding 2 (Claude fork sessions, |
roborev: Combined Review (
|
|
Finding 1 (imported sessions): Covered here — still waiting on direction. Finding 3 (PG Finding 2 (dead
The |
roborev: Combined Review (
|
|
This is the same "imported sessions" item raised many times by roborev and addressed here. Is it worth the complication of an extra field for this case? |
|
having the agentsview-owned field (ie not inferred) does feel like a good thing, since we do occasionally reparse sessions from the storage, so that field could get lost otherwise. |
|
Following up on @mariusvniekerk's guidance to store all names and send the correct computed field from the Go side — I've implemented the two-field design: What changed
All read queries return What this fixes The long-standing "imported sessions lose their title when you clear a custom rename" issue: previously What was deleted
What was renamed
|
roborev: Combined Review (
|
roborev: Combined Review (
|
Sessions with only an agent-provided session_name (no user rename) were returning NULL for session_display_name in the all-pins query, causing the Pinned page to fall back to first_message/project instead of showing the agent-provided name.
Sessions with an agent-provided name (session_name set, display_name NULL) were appearing nameless in the PG read path. Apply the same COALESCE(display_name, session_name) pattern used on the SQLite side to every PG SELECT that surfaces display_name: pgSessionCols, the sidebar index query, both Search CTEs in messages.go, both arms of pgUsageRowsSQL in usage.go, and the all-pins metadata query in curation.go. Add a pgtest test (TestPGSessionNameVisibleInReadPaths) that pushes a session with only SessionName set and asserts the name is visible via GetSidebarSessionIndex and GetSession.
…aCompat; session_name in search WHERE/CASE
…ia secret findings path
…h session_name changes reach PG push
…GPT re-import skip path
…verwriting existing fields
…session_name after upstream rebase
bf3b176 to
ee8399f
Compare
roborev: Combined Review (
|
…ByCost metadata query
roborev: Combined Review (
|
…hipped, no migration ambiguity
roborev: Combined Review (
|
roborev: Combined Review (
|
…el and short-query filter
roborev: Combined Review (
|
|
I'm looking at this now |
|
This looks good to go, I'll leave the last roborev finding unaddressed (technically accurate, not worth fixing) |
roborev: Combined Review (
|
Main's DuckDB mirror backend (kenn-io#609) predates this branch's naming model, where batch writes persist session_name and display_name is a user-owned rename. Resolve the semantic conflict in the merge: - mirror session_name in the DuckDB schema, push upsert, and migration column list - COALESCE(display_name, session_name) in DuckDB read paths (session list/get, sidebar index, search, pins, analytics), matching the SQLite and PostgreSQL backends - seed batch-written names via Session.SessionName in the store contract, DuckDB search, and backend bench fixtures - cover rename overrides in the DuckDB search test (display_name wins over session_name after an incremental push)
roborev: Combined Review (
|
The push upsert writes session_name but the incremental-sync fingerprint omitted it, so a session_name-only change that does not bump local_modified_at would be skipped as unchanged and leave a stale mirror title. All current writers bump local_modified_at or change file metadata, so this is hardening: the fingerprint should cover every pushed column, matching the PG push change detection which already compares session_name.
PG and DuckDB GetSessionFull return COALESCE(display_name, session_name) while SQLite returned the raw display_name, nil unless the user renamed the session. Coalesce post-scan so the shared sessionFullCols query keeps feeding the push paths unmerged columns, and pin the visible-name contract in the store contract test.
roborev: Combined Review (
|
## Summary - import Codex renamed session titles from Codex's `session_index.jsonl` `thread_name` into the existing session-name field instead of always falling back to the first user message preview - handle both `sessions` and `archived_sessions` directory layouts when resolving the `session_index.jsonl` path so archived session titles are also captured - add focused Codex parser coverage for both the title-capture path and the archived-session directory variant ## Scope - limited to Codex parser title extraction and focused parser tests - follow-up to the broader session-title surfaces already shipped in `#601` and `#209`; no unrelated UI changes ## Review Notes - start with `internal/parser/codex.go` and the matching Codex parser tests - the validated wire shape is `session_meta.payload.id` in the session file joined to adjacent `session_index.jsonl` `thread_name`; no guessed transcript-only rename event is involved Fixes #405 Co-authored-by: Rod Boev <rodboev@users.noreply.github.com>
I use the
/renamefeature pretty consistently in Claude Code, and wanted those names to show up in the left pane of Agentsview.It looks like there may have been previous work in this area but it was never complete.
Summary
Adds an opt-in "Use session names" Appearance toggle (default off) that shows agent-provided session names in the sidebar: Claude Code
/renamenames plus the native conversation titles seven other parsers already extract (ChatGPT, Claude.ai, Forge, Hermes, Kiro, Piebald, Cortex).A new
name_sourcecolumn (user|agent) records provenance. A manual in-app rename is markeduserand always shows, and is never overwritten by an agent name; agent names are markedagent, update live (including a full-reparse fallback when a/renameis appended mid-session), and are shown only when the toggle is on. Parser-extracted names are now carried throughtoDBSession(previously dropped on the live disk-sync path — only the importer persisted them), with matching PostgreSQL push/read parity, adataVersionbump so existing sessions re-parse to backfill the column, and resync metadata-copy logic that preserves user-owned names while letting agent names refresh.Because the names live in the skinny sidebar index, agent-named rows render immediately on load without per-row hydration.
Other agents/chat apps with a session name
The feature, if enabled, should also work for these coding agents. (Untested.)
And these imported chats (2):