fix(agents): skip auth profile cooldown for timeout failures

A timeout is model/network-specific, not an auth issue. Marking the
auth profile as failed on timeout poisons fallback models on the same
provider (e.g. gpt-5.3 timeout would block gpt-5.2 via shared profile
cooldown). The prompt-phase path already guards against this; this
aligns the post-response timeout path to match.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Vageesh Kumar
2026-02-21 04:12:56 -08:00
committed by Peter Steinberger
parent c5be45dfd2
commit 71d0b86352

View File

@@ -960,6 +960,10 @@ export async function runEmbeddedPiAgent(
timedOut || assistantFailoverReason === "timeout" timedOut || assistantFailoverReason === "timeout"
? "timeout" ? "timeout"
: (assistantFailoverReason ?? "unknown"); : (assistantFailoverReason ?? "unknown");
// Skip cooldown for timeouts: a timeout is model/network-specific,
// not an auth issue. Marking the profile would poison fallback models
// on the same provider (e.g. gpt-5.3 timeout blocks gpt-5.2).
if (reason !== "timeout") {
await markAuthProfileFailure({ await markAuthProfileFailure({
store: authStore, store: authStore,
profileId: lastProfileId, profileId: lastProfileId,
@@ -967,6 +971,7 @@ export async function runEmbeddedPiAgent(
cfg: params.config, cfg: params.config,
agentDir: params.agentDir, agentDir: params.agentDir,
}); });
}
if (timedOut && !isProbeSession) { if (timedOut && !isProbeSession) {
log.warn( log.warn(
`Profile ${lastProfileId} timed out (possible rate limit). Trying next account...`, `Profile ${lastProfileId} timed out (possible rate limit). Trying next account...`,