fix: preserve timeout reason after idle-only profile rotations

Addresses Codex P3 review finding: when shouldRotateAssistant fires on
idleTimedOut alone (timedOut=false), mergeRetryFailoverReason was passed
timedOut: params.timedOut (false), so the accumulated retry reason did
not record 'timeout'. Pass timedOut || idleTimedOut so the timeout reason
survives idle-only rotations and downstream fallback_model receives the
correct reason.
This commit is contained in:
Jim Dawdy
2026-05-10 19:12:00 -05:00
committed by Ayaan Zaidi
parent b3ef14dbfc
commit a6e4132a8c
@@ -176,7 +176,7 @@ export async function handleAssistantFailover(params: {
lastRetryFailoverReason: mergeRetryFailoverReason({
previous: params.previousRetryFailoverReason,
failoverReason: params.failoverReason,
timedOut: params.timedOut,
timedOut: params.timedOut || params.idleTimedOut,
}),
};
}