fix(jobs): make timeout messages tool-agnostic and CPU-aware (#596)

Replace the job timeout message that hardcoded "background-removal" for
every tool with a tool-agnostic one that sets the CPU-vs-GPU expectation,
the usual reason heavy AI times out on modest hardware. The client-side
SSE stall message gets the same treatment. Both stay under friendlyError's
280-char limit so the guidance reaches the user instead of collapsing to a
generic "Processing failed".

Refs #591
This commit is contained in:
SnapOtter
2026-07-21 15:22:57 +08:00
committed by GitHub
parent e6718ada71
commit 37c915c3da
4 changed files with 57 additions and 5 deletions
+3 -3
View File
@@ -147,7 +147,7 @@ export function useToolProcessor(toolId: string) {
if (elapsedRef.current) clearInterval(elapsedRef.current);
clearActiveJob();
setError(
"Processing timed out with no progress for 5 minutes. Try again or use a smaller file.",
"Processing timed out after 5 minutes without an update from the server. Heavy tools run much slower on CPU than a GPU; try a smaller file, or retry if the connection dropped.",
);
setProcessing(false);
setProgress(IDLE_PROGRESS);
@@ -167,7 +167,7 @@ export function useToolProcessor(toolId: string) {
if (elapsedRef.current) clearInterval(elapsedRef.current);
clearActiveJob();
setError(
"Processing timed out with no progress for 5 minutes. Try again or use a smaller file.",
"Processing timed out after 5 minutes without an update from the server. Heavy tools run much slower on CPU than a GPU; try a smaller file, or retry if the connection dropped.",
);
setProcessing(false);
setProgress(IDLE_PROGRESS);
@@ -329,7 +329,7 @@ export function useToolProcessor(toolId: string) {
error: "Processing timed out",
});
setError(
"Processing timed out with no progress for 5 minutes. Try again or use a smaller file.",
"Processing timed out after 5 minutes without an update from the server. Heavy tools run much slower on CPU than a GPU; try a smaller file, or retry if the connection dropped.",
);
setProcessing(false);
setProgress(IDLE_PROGRESS);