GeezerVison is showing github.com — fix(grok): failed Grok text generation explains usage limit, sign-in, and model errors by saphid · Pull Request #29800 · pingdotgg/t3code
Conversation
saphid
commented
Nov 3, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Problem
When Grok writes commit messages, PR text, branch names, or thread titles and its ACP request fails, the error only says Text generation failed in <operation>: Grok ACP request failed. Users can't tell whether to wait, sign in again, or pick another model. The same happens when switching to the selected model fails: Failed to set Grok ACP base model for text generation.
Change
Text generation now maps the ACP JSON-RPC error code to fixed details:
| ACP error code |
Detail |
-32003 (xAI rate limited, xAiRateLimitedErrorCode, the code the Grok adapter already classifies as usage_limit) |
Grok usage limit reached. Try again later. |
-32000 (ACP authRequired) |
Grok authentication is required. |
-32602 (invalid params), model switch only |
Grok rejected the text generation model settings. |
| anything else |
the existing generic detail |
Grok's raw error text stays only in cause. It never goes into detail or the message. This follows the "Errors" section of docs/internals/effect-services.md: messages are fixed or built from structured attributes, never from provider text.
Scope and approval
Very small, focused fix for an obvious bug, so no prior issue: one file's two mapErrors, which threw away a structured signal the error already carries. The first version of this PR copied Grok's raw message into the detail, which goes against the rule above. That was reworked to the code mapping above (thanks @maria-rcks).
Verification
GrokTextGeneration.test.ts: the mock agent fails session/prompt with a 4 KB private payload. Codes -32003 and -32000 give their fixed details, -32603 and -32602 give Grok ACP request failed., and cause keeps the code and the full payload. The detail is asserted exactly (toBe), so raw text there would fail the test. A model-switch case asserts that Unknown Grok model (-32602) shows the fixed model-settings detail and that the provider text stays only in cause.
- CI is green at
64489be.
- Not checked: a live Grok account that hits a real usage limit.
Created with Claude Opus 5.5 in Claude Code (T3 Code).
🤖 Generated with Claude Code
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
macroscopeapp
Bot
commented
Nov 3, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Approvability
Verdict: Approved at 879b759
Macroscope's review found this PR approvable — Grok text-generation errors now explain usage limits, authentication requirements, and rejected model settings using fixed messages. The change preserves existing request behavior and does not newly expose raw provider text in error details.
You can add or adjust custom eligibility rules. Learn more.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Nov 3, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

Note
Reviews paused
It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.
Use the following commands to manage reviews:
@coderabbitai resume to resume automatic reviews.
@coderabbitai review to trigger a single review.
Use the checkboxes below for quick actions:
- Resume reviews
- Trigger review
No actionable comments were generated in the recent review.
Walkthrough
-
The Grok provider maps selected ACP errors to specific details for rate limits, authentication failures, and rejected model settings. The mock agent can return configured prompt errors, and tests verify mapped details and preserved error causes.
Changes: Grok ACP error details
| Layer / File(s) |
Summary |
Map ACP errors packages/provider-grok/src/server/textGeneration.ts |
The provider maps rate-limit, authentication, and invalid-settings ACP errors to specific details for model-selection and general request failures. Other errors retain fallback details. |
Exercise ACP error details apps/server/src/provider/testFixtures/grok-text-mock-agent.mjs, apps/server/src/textGeneration/GrokTextGeneration.test.ts |
The mock agent can return a configured JSON-RPC error for prompt requests. Tests check mapped details and verify that causes retain provider error codes and messages. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers: juliusmarminge
Merge Risk: Minimal · previous review 879b7
-
Grok text-generation failures now show clear fixed messages for usage limits, authentication, and rejected model settings, and the raw provider text stays out of the user-facing detail. No merge-blocking risk remains.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title names the main change: failed Grok text generation now gives specific messages for usage limit, sign-in, and model errors. It follows the conventional commit format and matches the changeset… |
| Description check |
 |
The description covers the problem, the change, scope, and verification, so it follows the repository template. It explains the ACP code mapping, the fixed details, and why raw provider text stays in … |
| Linked Issues check |
 |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
 |
Check skipped because no linked issues were found for this pull request. |
Full details: Title check
-
Explanation
The title names the main change: failed Grok text generation now gives specific messages for usage limit, sign-in, and model errors. It follows the conventional commit format and matches the changeset, which maps ACP codes -32003, -32000, and -32602 to fixed details. The objectives also describe a test-focused commit, but the title still reflects the behavior change.
Full details: Description check
-
Explanation
The description covers the problem, the change, scope, and verification, so it follows the repository template. It explains the ACP code mapping, the fixed details, and why raw provider text stays in cause. It also links the docs rule it follows and reports the tests and CI result. It does not check a live Grok usage-limit case, and it says so. The Scope section has no linked issue, but it gives a reason for omitting one, as the template allows. The Verification section names the model used, as the template asks.
Finishing Touches
-
Generate unit tests (beta)
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
-
Run configuration
-
Commits
-
Reviewing files that changed from the base of the PR and between 64489be and 879b759.
Files selected for processing: 2
-
apps/server/src/textGeneration/GrokTextGeneration.test.ts
packages/provider-grok/src/server/textGeneration.ts
Limit details: You’ve used all 10 included reviews currently available.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
left a comment
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Fix comments: Fix CodeRabbit comments on this PR
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
left a comment
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Fix comments: Fix CodeRabbit comments on this PR
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
saphid
changed the title
fix(grok): failed Grok text generation shows Grok's error message
fix(grok): failed Grok text generation explains usage limit, sign-in, and model errors
Nov 3, 2026
…h error
When session/new returned auth_required and the agent did not advertise the
configured authentication method, the runtime replaced the agent's structured
-32000 error with a transport error, so Grok text generation showed the
generic 'Grok ACP request failed.' The runtime now logs the mismatch and
fails with the agent's own error.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Evidence
On both commits: fresh database, real signed-out Grok 1.0.77 selected for text generation, synthetic repository with one staged README change. Opened its thread and clicked Commit. Chromium web client, dark appearance, 1280×800 CSS viewport; private machine-name label hidden on both sides.
Base reports “Grok ACP request failed.” Head reports “Grok authentication is required.”
Synthetic seed script · Browser driver steps
Not shown:
- Permanent blocker: the usage-limit case requires an exhausted Grok account, which is unavailable on the workers.
- Rejected-model handling was not exercised: the signed-out reproduction fails at session/new before model selection.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This branch has not been deployed
No deployments
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|