Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions agent/error_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,14 @@ def _classify_by_message(
should_fallback=True,
)

# Overloaded / server-busy patterns — must come BEFORE rate_limit check
# so that "overloaded" messages don't incorrectly trigger credential rotation.
if any(p in error_msg for p in ("overloaded", "temporarily overloaded", "service is temporarily overloaded")):
return result_fn(
FailoverReason.overloaded,
retryable=True,
)

# Billing patterns
if any(p in error_msg for p in _BILLING_PATTERNS):
return result_fn(
Expand Down
2 changes: 1 addition & 1 deletion gateway/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -11163,7 +11163,7 @@ def main():
# so systemd Restart=on-failure will retry on transient errors (e.g. DNS)
success = asyncio.run(start_gateway(config))
if not success:
sys.exit(1)
sys.exit(GATEWAY_SERVICE_RESTART_EXIT_CODE)


if __name__ == "__main__":
Expand Down
Loading