fix: #2606 better user experience with unrecoverable errors

This commit is contained in:
Kazuhiro Sera
2025-08-23 13:04:06 +09:00
parent 09819d9b47
commit efd82025a5
4 changed files with 102 additions and 1 deletions

View File

@@ -1566,7 +1566,14 @@ async fn run_turn(
Ok(output) => return Ok(output),
Err(CodexErr::Interrupted) => return Err(CodexErr::Interrupted),
Err(CodexErr::EnvVar(var)) => return Err(CodexErr::EnvVar(var)),
Err(e @ (CodexErr::UsageLimitReached(_) | CodexErr::UsageNotIncluded)) => {
Err(
e @ (CodexErr::UsageLimitReached(_)
| CodexErr::UsageNotIncluded
| CodexErr::UnexpectedStatus(_, _)
| CodexErr::RetryLimit(_)
| CodexErr::UnauthorizedError
| CodexErr::InternalServerError),
) => {
return Err(e);
}
Err(e) => {