Agents: fix lint in tool-call sanitizers
This commit is contained in:
@@ -103,7 +103,7 @@ export function installSessionToolResultGuard(
|
||||
if (sanitized.length === 0) {
|
||||
return undefined;
|
||||
}
|
||||
nextMessage = sanitized[0] as AgentMessage;
|
||||
nextMessage = sanitized[0];
|
||||
}
|
||||
const nextRole = (nextMessage as { role?: unknown }).role;
|
||||
|
||||
|
||||
@@ -114,11 +114,10 @@ export function repairToolCallInputs(messages: AgentMessage[]): ToolCallInputRep
|
||||
continue;
|
||||
}
|
||||
|
||||
const assistant = msg as Extract<AgentMessage, { role: "assistant" }>;
|
||||
const nextContent = [];
|
||||
let droppedInMessage = 0;
|
||||
|
||||
for (const block of assistant.content) {
|
||||
for (const block of msg.content) {
|
||||
if (isToolCallBlock(block) && !hasToolCallInput(block)) {
|
||||
droppedToolCalls += 1;
|
||||
droppedInMessage += 1;
|
||||
@@ -134,7 +133,7 @@ export function repairToolCallInputs(messages: AgentMessage[]): ToolCallInputRep
|
||||
changed = true;
|
||||
continue;
|
||||
}
|
||||
out.push({ ...assistant, content: nextContent });
|
||||
out.push({ ...msg, content: nextContent });
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user