feat: Add persistent storage for agent mode conversations #333
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.
Implements automatic saving of agent conversations to database. Adds
--no-saveflag to disable persistence. Agent sessions now appear in conversation history alongside chat sessions.And it is possible to continue a session that was started in agent mode, in chat mode.
Changes
Key Features:
--no-saveflag to disable saving for specific runs (useful for testing or temporary sessions)Technical Changes:
Modified conversation repository interface (
internal/domain/interfaces.go):SaveAgentConversationmethod to support agent session persistenceGetConversationsto include agent sessions in historyEnhanced SQLite storage (
internal/infra/storage/sqlite.go):Updated agent command (
cmd/agent.go):--no-saveflag to disable persistenceEnhanced conversation services (
internal/services/conversation.go,internal/services/persistent_conversation.go):Updated documentation (
CLAUDE.md):--no-saveflagBenefits:
--no-saveflag provides control over when to persist sessionsTesting:
tests/mocks/domain/fake_conversation_repository.go)internal/handlers/chat_shortcut_handler.go)internal/shortcuts/core.go)This feature brings agent mode to parity with chat mode in terms of persistence and history management, making it easier for users to work with long-running agent sessions.