Skip to content

Conversation

@edenreich
Copy link
Contributor

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

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.
@edenreich edenreich merged commit 1d6f5dd into main Jan 1, 2026
5 checks passed
@edenreich edenreich deleted the refactor/compact-conversation-behavior branch January 1, 2026 22:50
ig-semantic-release-bot bot pushed a commit that referenced this pull request Jan 1, 2026
## [0.95.1](v0.95.0...v0.95.1) (2026-01-01)

### ♻️ Code Refactoring

* Change compact to start new conversation with summary ([#356](#356)) ([1d6f5dd](1d6f5dd))
@ig-semantic-release-bot
Copy link

🎉 This PR is included in version 0.95.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants