Skip to content

xAI: fix duplicated replies; handle provider capacity errors - #34

Merged
robdevops merged 3 commits into
mainfrom
claude/compassionate-heisenberg-pz23nq
Oct 13, 2026
Merged

robdevops merged 3 commits into
mainfrom
claude/compassionate-heisenberg-pz23nq

Conversation

@robdevops

Copy link
Copy Markdown
Owner
  • Duplicate reply: an xAI response with server-side search can hold a draft, a search call and the answer; output_text joined them so the reply showed the list twice. The answer is now the last non-empty message, the streamed draft restarts when a new message begins, and a log line records when earlier messages are dropped.
  • Capacity errors: a failed xAI response with server_error raises Overloaded. Chat users get "The AI provider is at capacity right now. Please try again in a few minutes."; the retry-without-tools ladder skips it; it is logged as a single warning line, no traceback (HTTP 429/503/529 count too).
  • Holding news: nothing is sent to chat on a capacity error; the daily check is retried every 30 min for up to 12 h, only for the people it failed for, with one log line when it gives up.

make check passes on Python 3.13 (288 tests). Not tried against the live xAI API.

🤖 Generated with Claude Code

https://claude.ai/code/session_014k4kywyN5dAo39izUPvxbw


Generated by Claude Code

With server-side search one response can hold a draft, a search call and the
answer; output_text joined them, so the reply showed the list twice. Keep the
last non-empty message, restart the streamed draft when a new message begins,
and log when earlier messages are dropped.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014k4kywyN5dAo39izUPvxbw
An xAI response that fails with server_error ("model is currently at capacity")
now raises Overloaded. Handlers answer with a plain retry-later message instead of
the raw exception, the retry ladder doesn't retry it without tools, and both the
handler and the automated holding-news check log it as a single warning line
without a traceback. Holding news still sends nothing to chat.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014k4kywyN5dAo39izUPvxbw
…vider is busy

Only the people whose check hit a capacity error are retried; nothing is sent to
chat meanwhile, and the final give-up is a single log line.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014k4kywyN5dAo39izUPvxbw
@robdevops
robdevops merged commit bae9264 into main Oct 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants