Repository navigation
fix: readable provider errors and overload backoff retry (#429) - #432
Merged
Merged
Conversation
An iOS user on Gemini saw a solid red box instead of an error. The chat
error toast painted --text-error on --background-modifier-error, which
Obsidian defines as the same red, and dismissed itself after 5 seconds.
Google's free tier was returning 503/429 underneath.
- Tint error backgrounds so the text is readable; the chat error now
stays until dismissed or the next turn starts.
- Word provider failures for people ("Google AI is overloaded right
now... (HTTP 503)") on HTTP errors, in-stream error frames and the
non-streaming handleError path. The raw text stays on
technicalMessage; LM Studio's draft fallback now matches on it.
- streamWithOverloadRetry wraps every adapter stream (turn, tool
continuation, recursive continuation): exponential backoff with
jitter on 503/529 or an overload frame, honouring Retry-After and
Google RetryInfo, only until the first output chunk. Never retries 429.
- Show "<Provider> is overloaded. Retrying X/Y..." on the status line
via a new provider.retrying runtime event.
- Pass the abort signal to Google streaming requests.
Closes #429
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #429.
What was wrong
On iOS with Gemini, a failed reply showed a solid red rectangle with no text. The chat error toast set
background: var(--background-modifier-error)andcolor: var(--text-error), and Obsidian defines both asvar(--color-red). The provider's real message was there, red on red, and it removed itself after 5 seconds. The failures underneath were Google free-tier 503 (overloaded) and 429 (quota) responses. The request path itself is fine: six live calls togemini-3.8-flashwith medium thinking all succeeded on a paid key.Changes
Readable errors
rgba(var(--background-modifier-error-rgb), 0.1)) in.chat-error,.nexus-error,.nexus-instruction-errorand.dimension-warning-container.ProviderHttpError), in-stream error frames (Anthropicoverloaded_error, google.rpc.Status, OpenAI codes) and the non-streaminghandleErrorpath.technicalMessagefor logs.services/llm/providers/providerDisplayNames.ts, so the adapter layer can use them without importing UI code.Overload backoff retry
streamWithOverloadRetrywraps every adapter stream: the main turn, the tool continuation and the recursive continuation.retry-after,retry-after-msand GoogleRetryInfo. If the provider asks for more than 20s, the error is shown instead.provider.retryingruntime event shows "Google AI is overloaded. Retrying 2/4…" on the chat status line. It clears when output starts or the turn ends.Regressions found and fixed along the way
err.message. Rewording would have broken it, so it now readstechnicalMessage. A new status-coded fixture covers it.EvalRunnerBudget). Held chunks are now flushed before rethrowing.Verification
npm run buildpasses, including lint and the mobile Node-import reachability check.check_stream_error_wiring.py: clean on all 14 streaming adapters.RUN_GOOGLE_REASONING_SMOKE=1passes through the changed path. Google's real error body shape was confirmed with a live invalid-key call.MessageManagerpass-through of the retry notice, or reverting LM Studio toerr.messageeach fails its test.🤖 Generated with Claude Code