Skip to content

Commit 3326c3e

Browse files
committed
Update batch-str-replace.ts
1 parent d2a6020 commit 3326c3e

File tree

4 files changed

+320
-30
lines changed

4 files changed

+320
-30
lines changed

backend/src/process-str-replace.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff 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[] = []

backend/src/run-agent-step.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)