Classify Codex app-server chatgpt-auth-required as an auth error#8765
Conversation
When auth.json holds only an OPENAI_API_KEY (no ChatGPT tokens), the app-server RPC rejects account/rateLimits/read with "chatgpt authentication required to read rate limits". That string matched none of CODEX_AUTH_ERROR_PATTERNS, so fetchCodexRateLimits fell through to the hidden PTY /status probe, which cannot render usage for such accounts and burned the full 15s PTY timeout on every refresh cycle, surfacing as a permanent "Refresh failed — PTY timeout" status chip. Classify the message as an auth error so the RPC result is returned directly (fast, accurate) and no PTY is spawned.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdded a case-insensitive Codex authentication error pattern for “chatgpt authentication required.” Added a rate-limit fetcher test covering the app-server 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…d label The new Codex app-server error 'chatgpt authentication required to read rate limits' mentions rate limits only as the object it failed to read, but the status bar's rate-limit classifier matched the phrase and labeled the chip 'Limited'. Classify authentication-required messages as auth failures so they get the standard softened refresh copy instead.
Problem
When the Codex home's
auth.jsonholds only anOPENAI_API_KEY(no ChatGPT tokens), the app-server RPC rejectsaccount/rateLimits/readwith:That string matches none of
CODEX_AUTH_ERROR_PATTERNS, sofetchCodexRateLimitstreated it as a generic RPC failure and fell through to the hidden PTY/statusprobe — which cannot render usage for such accounts and burned the full 15s PTY timeout on every refresh cycle. The status bar showed a permanent "Refresh failed — PTY timeout" chip, and each background retry spawned a doomed hiddencodexPTY for 15 seconds.Repro
auth.json(no ChatGPT sign-in).codex -s read-only -a untrusted app-server+initialize/initialized/account/rateLimits/read→ the error above in ~0.2s.Fix
Add the message to
CODEX_AUTH_ERROR_PATTERNSso the existing auth-error short-circuit infetchCodexRateLimitsreturns the RPC result directly: fast, accurate error copy, and no hidden PTY spawn.Testing
vitest run src/main/rate-limits src/shared— 249 files / 2443 tests pass.