fix-pdf-binary

Fix: PDF / binary attachment failure handling

Metadata

Statusdone
Assignedagent-986
Agent identityf51439356729d112a6c404803d88015d5b44832c6c584c62b96732b63c2b0c7e
Modelclaude:sonnet
Created2026-04-28T22:24:15.980418280+00:00
Started2026-04-28T22:40:20.513713784+00:00
Completed2026-04-28T23:29:14.500597722+00:00
Tagsbug,fix,executor, eval-scheduled
Eval score0.83
└ blocking impact0.85
└ completeness0.90
└ coordination overhead0.88
└ correctness0.85
└ downstream usability0.82
└ efficiency0.80
└ intent fidelity0.78
└ style adherence0.88

Description

Description

Implement the scope chosen in design-pdf-binary. Read that task's log first via wg show design-pdf-binary for the chosen scope (A only / A+C / A+B+C), schema additions, and file paths.

Bug being fixed: bug-read-tool-on-pdfs-burns-tokens-then-crashes.md — agents burn ~$1/agent on cached context before hitting Anthropic API HTTP 400 on malformed PDFs; failure_class is undifferentiated so retries waste the same money.

Validation (adapt to chosen scope)

  • Failing tests written first (TDD)
  • Option A: agent stdout containing api_error_status: 400 produces a distinct failure_class value visible in wg show <task>
  • Option A: wg service status summary surfaces api_error_400 failures distinctly from generic exit-1 failures
  • Option B (if in scope): preflight hook with pdfinfo validator marks task as blocked_on_input without spawning an agent for a malformed PDF
  • Option C (if in scope): task metadata forbid_tool_on_extension injects a system-prompt addendum and the agent does not call Read on forbidden extensions
  • Repro from bug doc reproduces the BAD behavior on main and the FIXED behavior on this branch (record evidence in task log — agent stdout snippets, wg show output)
  • cargo build + cargo test pass
  • Permanent smoke scenario added under tests/smoke/scenarios/ — must use a REAL malformed/encrypted PDF fixture (not stubbed). Owners list includes this task id.
  • cargo install --path . was run before claiming done

Depends on

Required by

Log