fix: give remove-background job timeouts an actionable failure message (#518)

Extends the worker.ts timeout failure detail with actionable guidance (first-run model download, input too large for CPU inference, or busy/unavailable worker) while preserving the "Timed out after Ns" prefix so error_code classification, SSE terminal replay, and existing timeout assertions keep working. Adds a test assertion for the guidance.

Fixes #494
This commit is contained in:
Matt Van Horn
2026-07-14 22:43:08 +08:00
committed by GitHub
parent 73e48c24d1
commit 58121f205f
2 changed files with 5 additions and 1 deletions
@@ -116,6 +116,10 @@ describe("Worker timeout classification", () => {
// Error message must mention timeout
const error = finalRow?.error as { message: string };
expect(error.message).toMatch(/timed out after 1s/i);
// Fail-fast message must include actionable guidance (issue #494)
expect(error.message).toMatch(
/model may still be downloading|too large for CPU|worker may be busy/i,
);
// Both attempts ran (attempts column is set at the start of each attempt)
expect(finalRow?.attempts).toBe(2);