@@ -230,7 +230,7 @@ describe('LocalSubagentInvocation', () => {
230230 expect ( display . terminateReason ) . toBe ( AgentTerminateMode . TIMEOUT ) ;
231231 } ) ;
232232
233- it ( 'should stream THOUGHT_CHUNK activities from the executor' , async ( ) => {
233+ it ( 'should stream THOUGHT_CHUNK activities from the executor, replacing the last running thought ' , async ( ) => {
234234 mockExecutorInstance . run . mockImplementation ( async ( ) => {
235235 const onActivity = MockLocalAgentExecutor . create . mock . calls [ 0 ] [ 2 ] ;
236236
@@ -245,7 +245,7 @@ describe('LocalSubagentInvocation', () => {
245245 isSubagentActivityEvent : true ,
246246 agentName : 'MockAgent' ,
247247 type : 'THOUGHT_CHUNK' ,
248- data : { text : ' Still thinking .' } ,
248+ data : { text : 'Thinking about next steps .' } ,
249249 } as SubagentActivityEvent ) ;
250250 }
251251 return { result : 'Done' , terminate_reason : AgentTerminateMode . GOAL } ;
@@ -258,7 +258,13 @@ describe('LocalSubagentInvocation', () => {
258258 expect ( lastCall . recentActivity ) . toContainEqual (
259259 expect . objectContaining ( {
260260 type : 'thought' ,
261- content : 'Analyzing... Still thinking.' ,
261+ content : 'Thinking about next steps.' ,
262+ } ) ,
263+ ) ;
264+ expect ( lastCall . recentActivity ) . not . toContainEqual (
265+ expect . objectContaining ( {
266+ type : 'thought' ,
267+ content : 'Analyzing...' ,
262268 } ) ,
263269 ) ;
264270 } ) ;
0 commit comments