# fix\(grok\): fail hung prompts on xAI rate-limit completions \(\#8358, partial\) · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/commit/1672ad3c5e73c2534e74a6f5bc1edbccebe34809)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

Requested revision: 1672ad3c5e73c2534e74a6f5bc1edbccebe34809

Requested commit: 1672ad3c5e73c2534e74a6f5bc1edbccebe34809

Commit: 1672ad3c5e73c2534e74a6f5bc1edbccebe34809

Tree: 653945d923caf5e46c9203a0e670a910f6a59b9d

Author: Julius Marminge

Committer: Julius Marminge

## Message

```
fix(grok): fail hung prompts on xAI rate-limit completions (#8358, partial)

Ports the rate-limit half of main's #8358 into the branch's reworked XAi
extension: a prompt_complete carrying stopReason rate_limit now fails the
hung prompt with the -32003 usage-limit error instead of settling it as a
normal end_turn, so the turn surfaces "usage limit reached" rather than
silently ending. The prompt-completion deferreds carry the error channel
end to end.

The exit_plan_mode approval gate from #8358 is NOT ported here: it needs
a v2 plan-flow design in AcpAdapterV2 (the v1 GrokAdapter it lived in is
gone) and is tracked separately.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

```

## Parents

- [8622f36fbb8098569023342ec42e1a68ca29e193](https://git.cafe/pingdotgg/t3code/commit/8622f36fbb8098569023342ec42e1a68ca29e193?format=markdown)

[Source at this commit](https://git.cafe/pingdotgg/t3code/tree/1672ad3c5e73c2534e74a6f5bc1edbccebe34809?format=markdown)
