You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: Change compact to start new conversation with summary (#356)
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:
- `/compact` now creates a new conversation titled "Continued from
[original title]" with optimized messages
- Removed redundant `OptimizeMessagesWithModel` method from interface
- Added `GetCurrentConversationTitle()` to conversation repository
- Updated all callers to use the simplified `OptimizeMessages` method
- Improved error handling when no model is selected
## Files changed:
- `internal/domain/interfaces.go` - Simplified interface, added
GetCurrentConversationTitle method
- `internal/handlers/chat_shortcut_handler.go` - Updated to use new
compact behavior
- `internal/services/agent.go` - Updated to use simplified
OptimizeMessages method
- `internal/services/conversation.go` - Updated to use simplified
OptimizeMessages method
- `internal/services/conversation_optimizer.go` - Implemented new
compact behavior
- `internal/services/conversation_optimizer_test.go` - Updated tests for
new behavior
- `internal/services/persistent_conversation.go` - Updated to use
simplified OptimizeMessages method
- `internal/shortcuts/core.go` - Updated to use simplified
OptimizeMessages method
- `tests/mocks/domain/fake_conversation_repository.go` - Updated mock to
include new method
0 commit comments