@@ -364,21 +364,19 @@ NOTE: At any point in time through this workflow you should feel free to ask the
364364 agent : input . agent . name ,
365365 messages : input . messages ,
366366 metadata : ( val ) =>
367- run . promise (
368- input . processor . updateToolCall ( options . toolCallId , ( match ) => {
369- if ( ! [ "running" , "pending" ] . includes ( match . state . status ) ) return match
370- return {
371- ...match ,
372- state : {
373- title : val . title ,
374- metadata : val . metadata ,
375- status : "running" ,
376- input : args ,
377- time : { start : Date . now ( ) } ,
378- } ,
379- }
380- } ) ,
381- ) ,
367+ input . processor . updateToolCall ( options . toolCallId , ( match ) => {
368+ if ( ! [ "running" , "pending" ] . includes ( match . state . status ) ) return match
369+ return {
370+ ...match ,
371+ state : {
372+ title : val . title ,
373+ metadata : val . metadata ,
374+ status : "running" ,
375+ input : args ,
376+ time : { start : Date . now ( ) } ,
377+ } ,
378+ }
379+ } ) ,
382380 ask : ( req ) =>
383381 permission
384382 . ask ( {
@@ -592,17 +590,14 @@ NOTE: At any point in time through this workflow you should feel free to ask the
592590 callID : part . callID ,
593591 extra : { bypassAgentCheck : true , promptOps } ,
594592 messages : msgs ,
595- metadata ( val : { title ?: string ; metadata ?: Record < string , any > } ) {
596- return run . promise (
597- Effect . gen ( function * ( ) {
598- part = yield * sessions . updatePart ( {
599- ...part ,
600- type : "tool" ,
601- state : { ...part . state , ...val } ,
602- } satisfies MessageV2 . ToolPart )
603- } ) ,
604- )
605- } ,
593+ metadata : ( val : { title ?: string ; metadata ?: Record < string , any > } ) =>
594+ Effect . gen ( function * ( ) {
595+ part = yield * sessions . updatePart ( {
596+ ...part ,
597+ type : "tool" ,
598+ state : { ...part . state , ...val } ,
599+ } satisfies MessageV2 . ToolPart )
600+ } ) ,
606601 ask : ( req : any ) =>
607602 permission
608603 . ask ( {
@@ -1054,7 +1049,7 @@ NOTE: At any point in time through this workflow you should feel free to ask the
10541049 messageID : info . id ,
10551050 extra : { bypassCwdCheck : true , ...extra } ,
10561051 messages : [ ] ,
1057- metadata : ( ) => { } ,
1052+ metadata : ( ) => Effect . void ,
10581053 ask : ( ) => Effect . void ,
10591054 } )
10601055 . pipe ( Effect . onInterrupt ( ( ) => Effect . sync ( ( ) => controller . abort ( ) ) ) )
0 commit comments