feat: add codex review failover and suppress output hardening

This commit is contained in:
Eyejoker
2026-03-28 05:40:38 +09:00
parent d1c693fb17
commit ba9f6871b6
49 changed files with 3884 additions and 1763 deletions

View File

@@ -1,6 +1,9 @@
import { describe, expect, it } from 'vitest';
import { shouldResetSessionOnAgentFailure } from './session-recovery.js';
import {
shouldResetSessionOnAgentFailure,
shouldRetryFreshSessionOnAgentFailure,
} from './session-recovery.js';
describe('shouldResetSessionOnAgentFailure', () => {
it('matches many-image dimension limit errors', () => {
@@ -31,4 +34,45 @@ describe('shouldResetSessionOnAgentFailure', () => {
}),
).toBe(false);
});
it('matches thinking signature 400 errors', () => {
expect(
shouldResetSessionOnAgentFailure({
result:
'API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.11.content.0: Invalid `signature` in `thinking` block"}}',
error: undefined,
}),
).toBe(true);
});
});
describe('shouldRetryFreshSessionOnAgentFailure', () => {
it('matches stale session errors', () => {
expect(
shouldRetryFreshSessionOnAgentFailure({
result: null,
error: 'No conversation found with session ID: stale',
}),
).toBe(true);
});
it('matches thinking signature 400 errors', () => {
expect(
shouldRetryFreshSessionOnAgentFailure({
result:
'API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.11.content.0: Invalid `signature` in `thinking` block"}}',
error: undefined,
}),
).toBe(true);
});
it('does not retry image dimension limit errors', () => {
expect(
shouldRetryFreshSessionOnAgentFailure({
result:
'An image in the conversation exceeds the dimension limit for many-image requests (2000px). Start a new session with fewer images.',
error: undefined,
}),
).toBe(false);
});
});