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