fix(coding-agent): add 'terminated' to retryable error patterns

Codex API can send 'terminated' error mid-stream, which should be
retried like other transient server errors.
This commit is contained in:
Mario Zechner 2026-01-22 21:32:56 +01:00
parent 5e079e2ea8
commit 9b84857b83
2 changed files with 6 additions and 2 deletions

View file

@ -18,6 +18,10 @@
- Skill, prompt template, and theme discovery now use settings and CLI path arrays instead of legacy filters ([#645](https://github.com/badlogic/pi-mono/issues/645))
### Fixed
- Auto-retry now handles "terminated" errors from Codex API mid-stream failures
## [0.49.3] - 2026-01-22
### Added

View file

@ -1862,8 +1862,8 @@ export class AgentSession {
if (isContextOverflow(message, contextWindow)) return false;
const err = message.errorMessage;
// Match: overloaded_error, rate limit, 429, 500, 502, 503, 504, service unavailable, connection errors, fetch failed
return /overloaded|rate.?limit|too many requests|429|500|502|503|504|service.?unavailable|server error|internal error|connection.?error|connection.?refused|other side closed|fetch failed|upstream.?connect|reset before headers/i.test(
// Match: overloaded_error, rate limit, 429, 500, 502, 503, 504, service unavailable, connection errors, fetch failed, terminated
return /overloaded|rate.?limit|too many requests|429|500|502|503|504|service.?unavailable|server error|internal error|connection.?error|connection.?refused|other side closed|fetch failed|upstream.?connect|reset before headers|terminated/i.test(
err,
);
}