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:
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user