refactor: Change compact to start new conversation with summary #356
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.
Changes the /compact command behavior to start a new conversation with a summary instead of compacting in-place.
Simplifies the ConversationOptimizerService interface by removing OptimizeMessagesWithModel and consolidating into OptimizeMessages.
Adds GetCurrentConversationTitle method to preserve conversation context.
Key changes in this PR:
/compactnow creates a new conversation titled "Continued from [original title]" with optimized messagesOptimizeMessagesWithModelmethod from interfaceGetCurrentConversationTitle()to conversation repositoryOptimizeMessagesmethodFiles changed:
internal/domain/interfaces.go- Simplified interface, added GetCurrentConversationTitle methodinternal/handlers/chat_shortcut_handler.go- Updated to use new compact behaviorinternal/services/agent.go- Updated to use simplified OptimizeMessages methodinternal/services/conversation.go- Updated to use simplified OptimizeMessages methodinternal/services/conversation_optimizer.go- Implemented new compact behaviorinternal/services/conversation_optimizer_test.go- Updated tests for new behaviorinternal/services/persistent_conversation.go- Updated to use simplified OptimizeMessages methodinternal/shortcuts/core.go- Updated to use simplified OptimizeMessages methodtests/mocks/domain/fake_conversation_repository.go- Updated mock to include new method