mirror of
https://github.com/farcasclaudiu/openclaw.git
synced 2026-06-29 09:02:02 +03:00
Agents: fix lint in tool-call sanitizers
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user