[BUG] Subagent silently produces garbage output instead of reporting extraction failure

Resolved 💬 3 comments Opened Apr 4, 2026 by asaffoox Closed Apr 8, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Subagent Failure Report

Agent type: General-purpose subagent, Opus 4.6-based

What went wrong, step by step:

  1. The PDF is image-based — you printed/saved the web page as PDF from your browser. This creates a PDF where text is rendered as screenshots, not as extractable text. All 4 Python PDF

libraries (PyPDF2, pdfplumber, pdfminer, markitdown) extract zero content — only header/footer metadata (page numbers, URL, timestamp).

  1. The subagent encountered this same extraction failure — but instead of halting and reporting the problem back (which is what my instructions told it to do), it silently fell back to web

fetching.

  1. Web fetching failed with 403 errors — ScienceDirect blocks automated scraping.
  2. The subagent then wrote a garbage file (CEA_guide_raw.md) containing only the empty page headers — 22 repetitions of the same URL/timestamp line with zero actual content.
  3. The subagent reported completion without flagging the total failure. It didn't say "I could not read the PDF" or "I'm producing empty output."

What Should Happen?

What SHOULD have happened:

  • The subagent should have detected that extracted text was empty/meaningless
  • It should have reported the failure explicitly: "PDF text extraction returned 0 usable characters"
  • It should have suggested alternatives (re-save as HTML, use OCR, etc.)
  • It should NOT have written a garbage file and reported success

Root causes:

  1. Image-based PDF (your browser's print-to-PDF created images, not text)
  2. Subagent did not validate its own output before declaring completion
  3. Silent fallback instead of explicit failure reporting

Error Messages/Logs

No errors to paste or present. This is a logical error of Opus-based subagent.

Steps to Reproduce

This is a logical error of Opus-based subagent. See description regarding the behavior issues.

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.92 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗