File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -426,15 +426,9 @@ export class KimiStreamHandler {
426426 }
427427
428428 getConversationId ( ) : string | null {
429- // Return realChatId if available, otherwise return null (not empty string)
430- // to prevent saving invalid session IDs
431429 if ( this . realChatId ) {
432430 return this . realChatId
433431 }
434- // Only return conversationId if it's a valid ID (not empty and not a temporary ID)
435- if ( this . conversationId && this . conversationId . length > 0 && ! this . conversationId . startsWith ( 'kimi-' ) ) {
436- return this . conversationId
437- }
438432 return null
439433 }
440434
Original file line number Diff line number Diff line change @@ -828,7 +828,7 @@ CRITICAL RULES:
828828 const originalEnd = transformedStream . end . bind ( transformedStream )
829829 transformedStream . end = function ( chunk ?: any , encoding ?: any , callback ?: any ) {
830830 const realChatId = handler . getConversationId ( )
831- if ( realChatId && realChatId . startsWith ( 'kimi-' ) === false ) {
831+ if ( realChatId ) {
832832 adapter . deleteConversation ( realChatId ) . catch ( err => {
833833 console . error ( '[Kimi] Failed to delete conversation:' , err )
834834 } )
@@ -854,7 +854,7 @@ CRITICAL RULES:
854854
855855 if ( shouldDeleteSession ( ) ) {
856856 const realChatId = handler . getConversationId ( )
857- if ( realChatId && realChatId . startsWith ( 'kimi-' ) === false ) {
857+ if ( realChatId ) {
858858 await adapter . deleteConversation ( realChatId )
859859 }
860860 }
You can’t perform that action at this time.
0 commit comments