fix(webui): recover model failures and align chat controls

This commit is contained in:
Xubin Ren committed 2026-10-21 02:34:09 +08:00
1 parent 688976bcb9
commit 28f6c26946
42 files changed
+646 -82

No files matched your search

+12
View File
@@ -818,8 +818,14 @@ export function useNanobotStream(
...(typeof ev.can_continue === "boolean"
? { can_continue: ev.can_continue }
: {}),
...(typeof ev.failure_error_kind === "string"
? { failure_error_kind: ev.failure_error_kind }
: {}),
};
setRecoveryState(next);
if (ev.reason === "model_request_failed" || ev.status === "resuming") {
setStreamError(null);
}
if (ev.status === "resuming") {
setRunStartedAt((current) => current ?? Date.now() / 1000);
setIsStreaming(true);
@@ -846,6 +852,12 @@ export function useNanobotStream(
if (ev.event === "attached") {
setRecoveryState(ev.recovery_state ?? null);
if (
ev.recovery_state?.reason === "model_request_failed"
|| ev.recovery_state?.status === "resuming"
) {
setStreamError(null);
}
if (ev.recovery_state?.status === "resuming") {
setRunStartedAt((current) => current ?? Date.now() / 1000);
setIsStreaming(true);