Repository navigation
fix(server): report actionable Grok usage-limit probe failures - #17062
jieyuexing wants to merge 2 commits into
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a focused Grok diagnostics fix that preserves the existing usage-limit contract and successful behavior while distinguishing credential, HTTP, timeout, transport, and malformed-response failures with sanitized messages. The production change is self-contained and covered by expanded tests, with no product-default, schema, authentication-flow, or billing-decision changes. You can add or adjust custom eligibility rules. Learn more. |
Co-Authored-By: Codex (gpt-6-astra) <noreply@openai.com>
Co-Authored-By: Codex (gpt-6-astra) <noreply@openai.com>
15852fb to
e3b533d
Compare
|
Note Drafted by GPT-6 Astra in Codex and Claude Opus 5.5 in Claude Code (both running inside T3 Code); reviewed and posted by @jieyuexing Rebased onto current
Not covered: no live Grok billing request. |
Dismissing prior approval to re-evaluate e3b533d
|
Note Written by Thanks for improving the Grok diagnostics. The patch classifies existing failure messages while leaving credential reads and usage-probe outcomes unchanged. Right now we are only taking focused bug fixes from outside contributors because of our limited review capacity. If the generic message blocks recovery, please open an issue with that reproduction so we can agree on a focused fix for reconsideration. |
Problem
Every failed Grok usage probe currently displays “Grok could not read usage limits.” A network timeout, a rejected login, an unreadable credential file, and an invalid billing response therefore look identical, even though they require different recovery steps.
Change
Return bounded diagnostic messages for credential-read errors, request timeouts, transport failures, invalid responses, and HTTP failures. Only 401 recommends reconnecting; 403 does not claim that the login has expired. Keep the account and the existing unavailable reason, without returning response bodies, tokens, or raw exception details.
Scope and approval
This is a focused diagnostic fix at the existing Grok usage-probe boundary. It changes the text of already-reported failures and does not introduce a setting, retry policy, authentication flow, or wire-schema change.
Verification
vp test run apps/server/src/provider/GrokProvider.test.ts: 34 passed on this branch.TimeoutErrortag. The existing ten-second timer itself was not exercised.Implemented with GPT-6 Astra via Codex in T3 Code.