Repository navigation
feat(widget): say why a reply failed: rate limit, budget, unavailable, cut off - #319
Merged
Merged
Conversation
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.
F-02 task 6 and F-04 task 10: the widget says why a reply failed, instead of showing "Something went wrong" for everything. The maintainer approved raising the size budget for this.
{ error: { code, retryAfterMs } }) on any non-2xx. A429withretryAfterMsshows "Too many messages. Please try again in 42 seconds." and a503 provider_unavailableshows "The assistant is unavailable right now". Bodies that aren't JSON (0.5 servers, proxy pages) keep the old behavior.budget_exceededwith scopeconversationshows "This chat has reached its limit." Any other scope (IP, or the site's daily total) shows "The assistant has reached its limit for today". A v1 stream that ends withoutfinishnow says "The reply was cut off." instead of the network error.stringskeys (errorRateLimitWait,errorBudget,errorBudgetDaily,errorUnavailable,errorCutOff), so sites can translate them. The i18n page has a table of every error message.scopeon the error part, with atest-dcheck against core.Checks: build, typecheck,
pnpm test:coverage(1152 passed; new client tests for every mapping and for non-JSON refusals, plus widget tests for each visible message and astringsoverride), lint at the dev baseline, size, publint, website build.