feat(core): add session history archive with History tab UI#23
Merged
Conversation
Persist completed agent sessions to daily JSON files (~/.agentpet/history/) and surface them in a new History tab in Settings. Includes: - SessionArchive model + SessionArchiveStore with serial queue protection - Archive hooks in SessionStore.prune() and apply() isSessionEnd path - AgentSession.createdAt field for accurate start time tracking - HistoryTabView with Today/7-day/30-day filters, summary bar, date-grouped list Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Owner
|
Merged, thank you. A session history archive is something people have wanted, and this is a clean implementation, daily JSON files with 90-day retention, hooked into both the prune and agent-quit paths so nothing is missed, plus a thread-safe store with dedup and fail-soft handling. The History tab with Today/7/30-day filters and the summary bar is a nice touch, and the test coverage is excellent. 581 tests green. 🙏 |
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
~/.agentpet/history/YYYY-MM-DD.json) with automatic 90-day retentionSessionStore.prune()andapply()(isSessionEnd path) so both idle-timeout and normal agent-quit sessions are archivedcreatedAtfield toAgentSessionfor accurate session start time trackingSessionArchiveStorewith serial DispatchQueue, in-memory dedup Set (rebuilt on restart), and fail-soft error handlingScreenshots
History tab showing session records with summary bar and date-grouped list.
Test plan
SessionArchiveStoreTests— 10 test cases: encode/decode round-trip, dedup, daily-file naming, prune, restart dedup rebuildSessionStoreArchiveTests— 9 test cases: idle prune archive, isSessionEnd archive, stale working archive, nil archiveStore compat, existing test regression, cross-cycle dedup🤖 Generated with Claude Code