File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ import { useAppServerEvents } from "./useAppServerEvents";
2828const emptyItems : Record < string , ConversationItem [ ] > = { } ;
2929const MAX_ITEMS_PER_THREAD = 400 ;
3030const MAX_ITEM_TEXT = 20000 ;
31+ const NO_TRUNCATE_TOOL_TYPES = new Set ( [ "fileChange" ] ) ;
3132
3233type ThreadState = {
3334 activeThreadIdByWorkspace : Record < string , string | null > ;
@@ -131,15 +132,23 @@ function normalizeItem(item: ConversationItem): ConversationItem {
131132 return { ...item , diff : truncateText ( item . diff ) } ;
132133 }
133134 if ( item . kind === "tool" ) {
135+ const isNoTruncateTool = NO_TRUNCATE_TOOL_TYPES . has ( item . toolType ) ;
134136 return {
135137 ...item ,
136138 title : truncateText ( item . title , 200 ) ,
137139 detail : truncateText ( item . detail , 2000 ) ,
138- output : item . output ? truncateText ( item . output ) : item . output ,
140+ output : isNoTruncateTool
141+ ? item . output
142+ : item . output
143+ ? truncateText ( item . output )
144+ : item . output ,
139145 changes : item . changes
140146 ? item . changes . map ( ( change ) => ( {
141147 ...change ,
142- diff : change . diff ? truncateText ( change . diff ) : change . diff ,
148+ diff :
149+ isNoTruncateTool || ! change . diff
150+ ? change . diff
151+ : truncateText ( change . diff ) ,
143152 } ) )
144153 : item . changes ,
145154 } ;
You can’t perform that action at this time.
0 commit comments