Skip to content

Commit c8e70fc

Browse files
committed
fix(failover): allow model fallback on harness transport timeout
When a harness-owned transport provider (Ollama, etc.) times out, resolveRunFailoverDecision immediately surfaced the error without attempting the configured fallback chain. This is inconsistent with the behavior for auth and billing failures, which both trigger fallback_model when fallbacks are configured. Fix: check fallbackConfigured before surfacing timeout errors from harness-owned transports, matching the existing flow for other failure modes. Closes #95574
1 parent 63fdc57 commit c8e70fc

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/agents/embedded-agent-runner/run/failover-policy.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,16 @@ export function resolveRunFailoverDecision(params: RunFailoverDecisionParams): R
178178
reason: params.failoverReason,
179179
};
180180
}
181+
// Timeouts from harness-owned transports (Ollama, etc.) should still
182+
// attempt the configured fallback chain before surfacing the error,
183+
// consistent with the behavior for auth and billing failures.
181184
if (params.harnessOwnsTransport && params.failoverReason === "timeout") {
185+
if (params.fallbackConfigured) {
186+
return {
187+
action: "fallback_model",
188+
reason: "timeout",
189+
};
190+
}
182191
return {
183192
action: "surface_error",
184193
reason: params.failoverReason,

0 commit comments

Comments
 (0)