mirror of
https://github.com/dataelement/bisheng.git
synced 2026-08-29 01:22:31 +08:00
fix(chat): render a throttled file-parse failure as the red card
The busy notice offered a Retry button, but the turn is already lost by then — the attachment never made it into the prompt, so retrying just re-runs against the same throttled OCR service. Route `file_parse_busy` to the red failure card like every other terminal outcome; it keeps its own "service is busy" wording and the "view details" disclosure, and the user re-sends from the input box. Model-side throttling (12046) is untouched and still gets the calm notice.
This commit is contained in:
@@ -52,11 +52,15 @@ const KNOWN_TYPES = new Set([
|
||||
// they get the calm neutral ServiceBusyNotice (+ optional retry) rather than the red
|
||||
// failure card — a rate limit is the model vendor's availability blip, not a fault.
|
||||
// Mirrors the classifier's RETRYABLE bucket.
|
||||
//
|
||||
// `file_parse_busy` is deliberately NOT here despite being recoverable: the turn is
|
||||
// already lost (the attachment never made it into the prompt), so a Retry button
|
||||
// would re-run against the same throttled service. It keeps its own "busy" wording
|
||||
// but renders as the red card, and the user re-sends from the input box.
|
||||
const TRANSIENT_TYPES = new Set([
|
||||
'rate_limit',
|
||||
'network_timeout',
|
||||
'service_unavailable',
|
||||
'file_parse_busy',
|
||||
]);
|
||||
|
||||
/** Would this failure render as the calm busy notice rather than the red card?
|
||||
|
||||
Reference in New Issue
Block a user