File tree Expand file tree Collapse file tree 4 files changed +320
-30
lines changed
Expand file tree Collapse file tree 4 files changed +320
-30
lines changed Original file line number Diff line number Diff line change @@ -21,8 +21,22 @@ export async function processStrReplace(
2121 }
2222 | { tool : 'str_replace' ; path : string ; error : string }
2323> {
24+ logger . debug (
25+ {
26+ path,
27+ replacementsCount : replacements . length ,
28+ } ,
29+ 'processStrReplace: Starting to process str_replace' ,
30+ )
31+
2432 const initialContent = await initialContentPromise
2533 if ( initialContent === null ) {
34+ logger . warn (
35+ {
36+ path,
37+ } ,
38+ 'processStrReplace: File does not exist' ,
39+ )
2640 return {
2741 tool : 'str_replace' ,
2842 path,
@@ -31,6 +45,15 @@ export async function processStrReplace(
3145 }
3246 }
3347
48+ logger . debug (
49+ {
50+ path,
51+ initialContentLength : initialContent . length ,
52+ hasContent : ! ! initialContent ,
53+ } ,
54+ 'processStrReplace: Successfully read initial file content' ,
55+ )
56+
3457 // Process each old/new string pair
3558 let currentContent = initialContent
3659 let messages : string [ ] = [ ]
Original file line number Diff line number Diff line change @@ -289,6 +289,16 @@ export const runAgentStep = async (
289289
290290 const stream = getStream ( messagesWithSystem ( agentMessages , system ) )
291291
292+ logger . info (
293+ {
294+ agentStepId,
295+ userInputId,
296+ agentType,
297+ agentId : agentState . agentId ,
298+ } ,
299+ 'run-agent-step: About to call processStreamWithTools' ,
300+ )
301+
292302 const {
293303 toolCalls,
294304 toolResults : newToolResults ,
@@ -313,6 +323,17 @@ export const runAgentStep = async (
313323 onResponseChunk,
314324 fullResponse,
315325 } )
326+
327+ logger . info (
328+ {
329+ agentStepId,
330+ userInputId,
331+ toolCallsCount : toolCalls . length ,
332+ toolResultsCount : newToolResults . length ,
333+ toolCallTypes : toolCalls . map ( ( tc ) => tc . toolName ) ,
334+ } ,
335+ 'run-agent-step: Completed processStreamWithTools' ,
336+ )
316337 toolResults . push ( ...newToolResults )
317338
318339 fullResponse = fullResponseAfterStream
You can’t perform that action at this time.
0 commit comments