Skip to content

Commit 70513aa

Browse files
committed
add more logging for malformed tool calls
1 parent 9197f64 commit 70513aa

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

backend/src/tools/definitions/tool/code-search.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ Note: Do not use the end_turn tool after this tool! You will want to see the out
6565
6666
Examples:
6767
${getToolCallString(toolName, { pattern: 'foo' }, endsAgentStep)}
68+
${getToolCallString(toolName, { pattern: 'foo\\.bar = 1\\.0' }, endsAgentStep)}
6869
${getToolCallString(toolName, { pattern: 'import.*foo', cwd: 'src' }, endsAgentStep)}
6970
${getToolCallString(toolName, { pattern: 'function.*authenticate', flags: '-i -t ts' }, endsAgentStep)}
7071
${getToolCallString(toolName, { pattern: 'TODO', flags: '-n --type-not test' }, endsAgentStep)}

backend/src/xml-stream-parser.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,14 @@ export async function* processStreamWithTags(
7070
AnalyticsEvent.MALFORMED_TOOL_CALL_JSON,
7171
loggerOptions?.userId ?? '',
7272
{
73-
contents,
73+
contents: JSON.stringify(contents),
7474
model: loggerOptions?.model,
7575
agent: loggerOptions?.agentName,
76+
error: {
77+
name: error.name,
78+
message: error.message,
79+
stack: error.stack,
80+
},
7681
autocompleted,
7782
}
7883
)

0 commit comments

Comments
 (0)