fix(codex): don't crash on startup when quota is exhausted (429) (#744)

A 429 usage_limit_reached response during verify_connection() caused the
server to refuse to start entirely. Quota exhaustion is not a configuration
error — the server should start and serve retain/recall requests normally,
it just can't make LLM calls until the quota resets.

Co-authored-by: Marco Rutsch <marco@rutimka.de>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Rutimka 2026-03-30 10:39:12 +02:00 committed by GitHub
parent d441ab814d
commit 111e8c70a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -166,6 +166,10 @@ class CodexLLM(LLMInterface):
)
logger.info(f"Codex LLM verified: {self.model}")
except Exception as e:
# 429 means quota exhausted, not a configuration error — warn but allow startup
if "429" in str(e) or "usage_limit_reached" in str(e):
logger.warning(f"Codex LLM quota exhausted for {self.model}, continuing startup: {e}")
return
raise RuntimeError(f"Codex LLM connection verification failed for {self.model}: {e}") from e
async def call(