fix: resolve lcm-tui topic session lookups#300
Merged
Conversation
Resolve TUI session metadata and count lookups against the selected conversation row instead of grouping by bare session_id. Topic-suffixed session filenames now prefer an exact session_key match and only then fall back to the normalized bare session_id, which restores conv_id, session key, summary count, and file count for Telegram topic sessions while preserving non-topic behavior. Reuse the same resolution path for single-session conversation lookups so summaries/files/context drill-downs follow the same normalization. Regeneration-Prompt: | Fix the lossless-claw TUI bug where Telegram topic session files on disk are named like <session-id>-topic-<n> but LCM stores the bare runtime session_id and the topic identity separately in session_key. Keep the patch tight in tui/data.go and related tests. Preserve existing behavior for non-topic sessions. Resolve each visible session entry to a concrete conversation row first, preferring an exact session_key match for topic-suffixed filenames and otherwise falling back to the normalized bare session_id, then load summary/file counts by conversation_id so multiple topic rows sharing one bare session_id do not collapse together. Add regression coverage showing a topic session file now gets the right session key, conv_id, summary count, file count, and single-session lookup behavior.
This was referenced Apr 6, 2026
Merged
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
This PR isolates the
lcm-tuifix for Telegram topic-backed session keys so topic session files resolve to the correct conversation row and show the right session metadata, summary counts, and file counts.Why
The original branch also contains unrelated planning work, but this bug fix stands on its own and is needed so browsing topic sessions in the TUI does not collapse multiple topic conversations onto the same bare runtime session.
Changes
session_keysession_idconversation_idTesting
cd tui && go test ./... -run 'TestLoadSessionBatchIncludesConversationMetadata|TestLoadSessionBatchResolvesTopicSessionFiles|TestLookupConversationIDResolvesTopicSessionFiles|TestRenderSessionsShowsSessionKeyAndEstimatedTokens|TestRenderSessionsAlignsColumns'cd tui && go test ./... -run 'TestLoadDoctorTargetsUsesPositionAwareDetection|TestScanDoctorConversationsAggregatesAllConversations'currently fails onorigin/mainas well, so the fullgo test ./...suite is not a clean gate for this change yet.