Commit 70ccb3e
fix(litellm): fail fast on dead codex auth instead of blocking startup
When auth.json is expired and the refresh token is dead, litellm's chatgpt
authenticator (get_access_token) drops into _login_device_code(), which prints
a device code and BLOCKS up to 15 min polling for an operator to approve. The
litellm pod is headless, so startup hangs past the startup probe -> SIGKILL ->
crash loop, and each restart re-requests a device code, hammering the endpoint
into a 429.
This turned a routine ~2-week ChatGPT token expiry into a ~10-day litellm
OUTAGE (2026-06-24): the proxy never bound :4000, so the router's existing
codex->nemotron fallback never got a turn (fallbacks only apply to in-flight
requests on a running proxy).
Fix: a startup monkeypatch (matching the existing responses-input / tool-index
patches) makes get_access_token() raise GetAccessTokenError instead of the
interactive device-login when CHATGPT_DISABLE_DEVICE_LOGIN is set (now set on
the litellm container). Dead auth -> litellm boots, marks codex unhealthy, and
the router falls back to nemotron until an operator re-auths OUT OF BAND via
the codex-cli sidecar (a separate codex process, unaffected by this patch).
Idempotent; no-ops if the upstream signature changes. Validated: patch matches
exactly once + py_compile-clean against the deployed authenticator.py.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 0d0f681 commit 70ccb3e
1 file changed
Lines changed: 36 additions & 0 deletions
Lines changed: 36 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
171 | 199 | | |
172 | 200 | | |
173 | 201 | | |
| |||
221 | 249 | | |
222 | 250 | | |
223 | 251 | | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
224 | 260 | | |
225 | 261 | | |
226 | 262 | | |
| |||
0 commit comments