@@ -1458,50 +1458,11 @@ export function useChat(
14581458 return
14591459 }
14601460 if ( handledClientWorkflowToolIdsRef . current . has ( toolCallId ) ) {
1461- // #region agent log
1462- fetch ( 'http://127.0.0.1:1025/ingest/85045d0a-92f7-4ee2-9de1-e2f99930c6bc' , {
1463- method : 'POST' ,
1464- headers : { 'Content-Type' : 'application/json' , 'X-Debug-Session-Id' : '21c369' } ,
1465- body : JSON . stringify ( {
1466- sessionId : '21c369' ,
1467- location : 'use-chat.ts:startClientWorkflowTool' ,
1468- message : 'SKIPPED:handled' ,
1469- data : { toolCallId } ,
1470- timestamp : Date . now ( ) ,
1471- } ) ,
1472- } ) . catch ( ( ) => { } )
1473- // #endregion
14741461 return
14751462 }
14761463 if ( recoveringClientWorkflowToolIdsRef . current . has ( toolCallId ) ) {
1477- // #region agent log
1478- fetch ( 'http://127.0.0.1:1025/ingest/85045d0a-92f7-4ee2-9de1-e2f99930c6bc' , {
1479- method : 'POST' ,
1480- headers : { 'Content-Type' : 'application/json' , 'X-Debug-Session-Id' : '21c369' } ,
1481- body : JSON . stringify ( {
1482- sessionId : '21c369' ,
1483- location : 'use-chat.ts:startClientWorkflowTool' ,
1484- message : 'SKIPPED:recovering' ,
1485- data : { toolCallId } ,
1486- timestamp : Date . now ( ) ,
1487- } ) ,
1488- } ) . catch ( ( ) => { } )
1489- // #endregion
14901464 return
14911465 }
1492- // #region agent log
1493- fetch ( 'http://127.0.0.1:1025/ingest/85045d0a-92f7-4ee2-9de1-e2f99930c6bc' , {
1494- method : 'POST' ,
1495- headers : { 'Content-Type' : 'application/json' , 'X-Debug-Session-Id' : '21c369' } ,
1496- body : JSON . stringify ( {
1497- sessionId : '21c369' ,
1498- location : 'use-chat.ts:startClientWorkflowTool' ,
1499- message : 'FIRING' ,
1500- data : { toolCallId, toolName } ,
1501- timestamp : Date . now ( ) ,
1502- } ) ,
1503- } ) . catch ( ( ) => { } )
1504- // #endregion
15051466 handledClientWorkflowToolIdsRef . current . add ( toolCallId )
15061467
15071468 ensureWorkflowToolResource ( toolArgs )
@@ -1530,40 +1491,13 @@ export function useChat(
15301491 }
15311492 }
15321493
1533- // #region agent log
1534- fetch ( 'http://127.0.0.1:1025/ingest/85045d0a-92f7-4ee2-9de1-e2f99930c6bc' , {
1535- method : 'POST' ,
1536- headers : { 'Content-Type' : 'application/json' , 'X-Debug-Session-Id' : '21c369' } ,
1537- body : JSON . stringify ( {
1538- sessionId : '21c369' ,
1539- location : 'use-chat.ts:recoverPending' ,
1540- message : 'scan complete' ,
1541- data : { pendingCount : pending . length , pendingIds : pending . map ( ( t ) => t . id ) } ,
1542- timestamp : Date . now ( ) ,
1543- } ) ,
1544- } ) . catch ( ( ) => { } )
1545- // #endregion
1546-
15471494 for ( const toolCall of pending ) {
15481495 try {
15491496 const toolArgs = toolCall . params ?? { }
15501497 const targetWorkflowId = ensureWorkflowToolResource ( toolArgs )
15511498
15521499 if ( targetWorkflowId ) {
15531500 const rebound = await bindRunToolToExecution ( toolCall . id , targetWorkflowId )
1554- // #region agent log
1555- fetch ( 'http://127.0.0.1:1025/ingest/85045d0a-92f7-4ee2-9de1-e2f99930c6bc' , {
1556- method : 'POST' ,
1557- headers : { 'Content-Type' : 'application/json' , 'X-Debug-Session-Id' : '21c369' } ,
1558- body : JSON . stringify ( {
1559- sessionId : '21c369' ,
1560- location : 'use-chat.ts:recoverPending' ,
1561- message : 'bind result' ,
1562- data : { toolCallId : toolCall . id , targetWorkflowId, rebound } ,
1563- timestamp : Date . now ( ) ,
1564- } ) ,
1565- } ) . catch ( ( ) => { } )
1566- // #endregion
15671501 if ( rebound ) {
15681502 handledClientWorkflowToolIdsRef . current . add ( toolCall . id )
15691503 continue
@@ -2524,20 +2458,6 @@ export function useChat(
25242458 ! existingToolCall . result ) )
25252459 if ( shouldStartWorkflowTool ) {
25262460 startClientWorkflowTool ( id , name , args ?? { } )
2527- } else {
2528- // #region agent log
2529- fetch ( 'http://127.0.0.1:1025/ingest/85045d0a-92f7-4ee2-9de1-e2f99930c6bc' , {
2530- method : 'POST' ,
2531- headers : { 'Content-Type' : 'application/json' , 'X-Debug-Session-Id' : '21c369' } ,
2532- body : JSON . stringify ( {
2533- sessionId : '21c369' ,
2534- location : 'use-chat.ts:processSSE' ,
2535- message : 'SKIPPED:replay' ,
2536- data : { toolCallId : id , toolName : name } ,
2537- timestamp : Date . now ( ) ,
2538- } ) ,
2539- } ) . catch ( ( ) => { } )
2540- // #endregion
25412461 }
25422462 }
25432463 break
@@ -2914,7 +2834,7 @@ export function useChat(
29142834 sseRes . body . getReader ( ) ,
29152835 assistantId ,
29162836 expectedGen ,
2917- { preserveExistingState : true , suppressWorkflowToolStarts : true }
2837+ { preserveExistingState : true }
29182838 )
29192839
29202840 if ( liveResult . sawStreamError ) {
0 commit comments