fix(background-agent): prevent circuit breaker false positives on flat-format events

This commit is contained in:
Mou
2026-03-24 16:20:10 +08:00
committed by guazi04
parent 500784a9b9
commit b9fa2a3ebc
3 changed files with 51 additions and 18 deletions
@@ -36,6 +36,14 @@ export function recordToolCall(
settings: CircuitBreakerSettings,
toolInput?: Record<string, unknown> | null
): ToolCallWindow {
if (toolInput === undefined || toolInput === null) {
return {
lastSignature: `${toolName}::__unknown-input__`,
consecutiveCount: 1,
threshold: settings.consecutiveThreshold,
}
}
const signature = createToolCallSignature(toolName, toolInput)
if (window && window.lastSignature === signature) {