fix: handoff to codex on persistent session failure

When Claude reviewer hits retryable session failure twice, hand off
to codex instead of silently failing. Adds 'session-failure' to
AgentTriggerReason and shouldHandoffToCodex check.
This commit is contained in:
Eyejoker
2026-04-01 05:15:24 +09:00
parent f4410be779
commit 5420fa2ee8
2 changed files with 5 additions and 3 deletions

View File

@@ -101,7 +101,8 @@ export type AgentTriggerReason =
| 'org-access-denied'
| 'overloaded'
| 'network-error'
| 'success-null-result';
| 'success-null-result'
| 'session-failure';
export type ClaudeRotationReason = Extract<
AgentTriggerReason,

View File

@@ -295,7 +295,8 @@ export async function runAgentForGroup(
reason === '429' ||
reason === 'usage-exhausted' ||
reason === 'auth-expired' ||
reason === 'org-access-denied'
reason === 'org-access-denied' ||
reason === 'session-failure'
);
};
@@ -781,7 +782,7 @@ export async function runAgentForGroup(
log.error(
'Retryable Claude session failure persisted after fresh retry',
);
return 'error';
return maybeHandoffAfterError('session-failure', primaryAttempt);
}
}