fix(core): retry on failed as well as timeout; only auth stops the run (#104)

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Yaowei Zheng
2026-07-29 16:57:05 +08:00
committed by GitHub
parent 8dc560eedd
commit 5b22ad06da
30 changed files with 603 additions and 174 deletions
+11 -3
View File
@@ -671,15 +671,23 @@ When done, open index.html in a browser and self-test once.`,
modelAuthDeadRetry: "Retry",
modelAuthDeadCta: "New Session",
modelAuthDeadPlaceholder: "Model authentication failed — update the API key first",
/** Reconnect hint line; `secondsLeft` (waiting state only) switches to the live-countdown wording. */
/**
* Reconnect hint line; `secondsLeft` (waiting state only) switches to the live-countdown
* wording. `failed` is in the union because the engine retries it like the other two —
* its cause names the provider rather than the transport, since that is where it came from.
*/
reconnect: (
status: "timeout" | "malformed",
status: "failed" | "timeout" | "malformed",
state: "waiting" | "retried" | "gaveUp",
attempt: number,
secondsLeft?: number,
) => {
const cause =
status === "timeout" ? "Connection timed out" : "Response incomplete or unparseable";
status === "timeout"
? "Connection timed out"
: status === "malformed"
? "Response incomplete or unparseable"
: "The model provider returned an error";
const action =
state === "gaveUp"
? "no further retries"