File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -304,8 +304,10 @@ class SummaryAggregator {
304304 this . messageCount ++ ;
305305 this . startTypingIndicator ( ) ;
306306
307+ const isSummaryMessage = ( info as { summary ?: boolean } ) . summary === true ;
308+
307309 // Notify that agent started thinking
308- if ( this . onThinkingCallback ) {
310+ if ( ! isSummaryMessage && this . onThinkingCallback ) {
309311 const callback = this . onThinkingCallback ;
310312 setImmediate ( ( ) => {
311313 if ( typeof callback === "function" ) {
Original file line number Diff line number Diff line change @@ -159,6 +159,29 @@ describe("summary/aggregator", () => {
159159 expect ( onThinking ) . toHaveBeenCalledWith ( "session-1" ) ;
160160 } ) ;
161161
162+ it ( "does not send thinking callback for summary assistant messages" , async ( ) => {
163+ const onThinking = vi . fn ( ) ;
164+ summaryAggregator . setOnThinking ( onThinking ) ;
165+ summaryAggregator . setSession ( "session-1" ) ;
166+
167+ summaryAggregator . processEvent ( {
168+ type : "message.updated" ,
169+ properties : {
170+ info : {
171+ id : "message-summary" ,
172+ sessionID : "session-1" ,
173+ role : "assistant" ,
174+ summary : true ,
175+ time : { created : Date . now ( ) } ,
176+ } ,
177+ } ,
178+ } as unknown as Event ) ;
179+
180+ await new Promise < void > ( ( resolve ) => setImmediate ( resolve ) ) ;
181+
182+ expect ( onThinking ) . not . toHaveBeenCalled ( ) ;
183+ } ) ;
184+
162185 it ( "sends apply_patch payload as tool file" , ( ) => {
163186 const onToolFile = vi . fn ( ) ;
164187 summaryAggregator . setOnToolFile ( onToolFile ) ;
You can’t perform that action at this time.
0 commit comments