Merge pull request #3972 from MoerAI/fix/circuit-breaker-tool-input-fallback

fix(background-agent): fall back to partInfo.input when state.input is unavailable for circuit breaker (fixes #3962)
This commit is contained in:
YeonGyu-Kim
2026-05-15 19:20:36 +09:00
committed by GitHub
2 changed files with 103 additions and 1 deletions
+3 -1
View File
@@ -153,6 +153,7 @@ interface MessagePartInfo {
sessionID?: string
type?: string
tool?: string
input?: Record<string, unknown>
state?: { status?: string; input?: Record<string, unknown> }
}
@@ -1694,11 +1695,12 @@ The fallback retry session is now created and can be inspected directly.
const circuitBreaker = this.cachedCircuitBreakerSettings ?? resolveCircuitBreakerSettings(this.config)
this.cachedCircuitBreakerSettings = circuitBreaker
if (partInfo.tool) {
const toolInput = partInfo.state?.input ?? partInfo.input
task.progress.toolCallWindow = recordToolCall(
task.progress.toolCallWindow,
partInfo.tool,
circuitBreaker,
partInfo.state?.input
toolInput
)
if (circuitBreaker.enabled) {