feat(chat): intercept /new in canonical Bot Chat sessions to /compact (#979)
This commit is contained in:
5 files changed
+63
-1
No files matched your search
@@ -1573,7 +1573,22 @@ class ChatViewModel(
|
||||
}
|
||||
|
||||
is SlashResult.NewSession -> {
|
||||
createNewSession()
|
||||
val currentTitle = _uiState.value.chatTitle
|
||||
if (currentTitle.equals("Bot Chat", ignoreCase = true)) {
|
||||
// Bot Chat is a canonical forever-conversation — compact instead of creating an orphan
|
||||
val sessionId = _uiState.value.currentSessionId
|
||||
if (!sessionId.isNullOrBlank()) {
|
||||
addAssistantMessage(
|
||||
"Bot chats are one continuous conversation — compacting instead. " +
|
||||
"For a throwaway session, create a standard chat.",
|
||||
)
|
||||
dispatchViaRpc("/compact")
|
||||
} else {
|
||||
createNewSession()
|
||||
}
|
||||
} else {
|
||||
createNewSession()
|
||||
}
|
||||
}
|
||||
|
||||
is SlashResult.SessionBranch -> {
|
||||
|
||||
Reference in new issue
Block a user