fix(tui): full-view age tracks last message, surviving daemon restarts#943
Merged
Conversation
The full session-list view's 'xx ago' read last_event_at, which every persisted transcript event refreshes — including the Status rows that daemon-restart resume writes — so idle sessions snapped back to '0s ago' on every restart without any new conversation. - protocol: add SessionSummary::last_message_at, stamped only when a chat Message event persists; cleared on Reset. - daemon: restore it at load from the transcript's newest Message event timestamp (the same self-healing recount walk as message_count), so it survives restarts and backfills pre-field sessions. - tui: the full view's idle age prefers last_message_at, falling back to last_event_at for sessions with no messages (plain shells).
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
After a daemon restart, every resumed session's
xx agoin the full session-list view snapped back to0seven with no new messages. Root cause: the age readSessionSummary::last_event_at, which the daemon stamps for every persisted transcript event — and startup resume writesStatusevents (Running→AwaitingInput) for each non-terminal session, so "last event" genuinely became "just now" on restart. The same mechanism let tool blocks, usage reports, and/modelchanges refresh the age without any conversation movement.Fix — make the age mean "since the conversation last moved":
SessionSummary::last_message_at, stamped only when a chatMessageevent persists; cleared onReset(the transcript truncates there anyway).Messageevent's own timestamp, in the existing self-healing recount walk (same pattern asmessage_count/tokens) — so it survives restarts and backfills sessions recorded before the field existed.last_message_atand falls back tolast_event_atfor sessions with no messages (plain shells keep "any recorded activity" semantics). Thebusy Xsrunning branch is unchanged.Spec 0106's activity wording updated to record the semantics.
Testing
cargo test --workspacegreen.load_recounts_chat_messages_from_the_transcript:last_message_atrestores from the newest Message event's timestamp while trailing non-message events (with newer stamps) don't move it.🤖 Generated with Claude Code