Spaces:
Sleeping
Sleeping
Docs: add timing heuristic for spotting stuck tools
Browse filesIf a job sits in "processing" past ~10-15s (light tools) or ~60s (office/OCR/AI),
it's likely the stuck-worker bug, not real work.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
CLAUDE.md
CHANGED
|
@@ -120,6 +120,7 @@ A Sonnet diagnostic agent ran live E2E on the PDF tools. **Root cause is systemi
|
|
| 120 |
- **Issue 2:** ~42 workers use `conversion_helpers.start_file_job()` which sets status="processing" THEN downloads; if download throws, the caller's `job` is `None` so `fail_job(job=None)` no-ops β job **stuck in "processing" forever** (the 95% hang in the UI). The 13 older inline-style workers (merge, split, rotate, compress, protect, unlock, watermark, page_numbers, organize, pdf_to_jpg, pdf_to_text, ocr, sign_pdf) correctly set status="failed". **Fix:** ensure start_file_job sets the job to failed on download error (assign job before download / catch + mark failed).
|
| 121 |
- **Issue 3 (sign tool, frontend):** `pdfApi.ts signPdf()` sends `signature_text: signatureText || null`; empty "Your Name" field β null β backend 400 "signature_text required for typed mode". **Fix:** gate submission on non-empty signText in the UI.
|
| 122 |
- **Issue 4 (debuggability):** `GET /api/v1/jobs/{id}/status` doesn't return `error_message` β failed jobs are opaque from the API. **Fix:** add `error_message` to the status response for failed jobs.
|
|
|
|
| 123 |
- Once Issue 1 is fixed, re-run the full tool E2E sweep (Opus/Sonnet agents) β the other ~55 tools were NOT individually confirmed (diagnostic was interrupted at user's Claude limit). Some image/AI tools (remove-bg, upscale, image-to-anime/avatar/cartoon/sketch, handwriting) may still fail on missing heavy models (gfpgan/realesrgan not installed).
|
| 124 |
|
| 125 |
## β¬ NEXT PHASES (priority order)
|
|
|
|
| 120 |
- **Issue 2:** ~42 workers use `conversion_helpers.start_file_job()` which sets status="processing" THEN downloads; if download throws, the caller's `job` is `None` so `fail_job(job=None)` no-ops β job **stuck in "processing" forever** (the 95% hang in the UI). The 13 older inline-style workers (merge, split, rotate, compress, protect, unlock, watermark, page_numbers, organize, pdf_to_jpg, pdf_to_text, ocr, sign_pdf) correctly set status="failed". **Fix:** ensure start_file_job sets the job to failed on download error (assign job before download / catch + mark failed).
|
| 121 |
- **Issue 3 (sign tool, frontend):** `pdfApi.ts signPdf()` sends `signature_text: signatureText || null`; empty "Your Name" field β null β backend 400 "signature_text required for typed mode". **Fix:** gate submission on non-empty signText in the UI.
|
| 122 |
- **Issue 4 (debuggability):** `GET /api/v1/jobs/{id}/status` doesn't return `error_message` β failed jobs are opaque from the API. **Fix:** add `error_message` to the status response for failed jobs.
|
| 123 |
+
- **Debugging heuristic (timing tell):** a healthy job reaches `completed` fast. Rule of thumb when testing β if the job is still `processing` past **~10β15s for a light tool** (image ops, pdf rotate/split/merge/compress/watermark/page-numbers, data-format converters) it's almost certainly the stuck-worker bug, not real work. Heavier tools have higher honest ceilings: **office conversions via LibreOffice ~30β45s, OCR ~30s, AI/Groq tools ~20β30s** β only treat those as broken past ~60s. The *definitive* tell is status that NEVER leaves `processing` (vs. reaching `completed`/`failed`); the UI's 95% hang = this. While testing, poll with a per-tool timeout in that range instead of a flat 90s so the sweep isn't slow.
|
| 124 |
- Once Issue 1 is fixed, re-run the full tool E2E sweep (Opus/Sonnet agents) β the other ~55 tools were NOT individually confirmed (diagnostic was interrupted at user's Claude limit). Some image/AI tools (remove-bg, upscale, image-to-anime/avatar/cartoon/sketch, handwriting) may still fail on missing heavy models (gfpgan/realesrgan not installed).
|
| 125 |
|
| 126 |
## β¬ NEXT PHASES (priority order)
|