Skip to content

text mode: skip image-only files; add per-run logging - #4

Merged
ridaken merged 2 commits into
mainfrom
text-mode-skip-images
Jun 27, 2026
Merged

text mode: skip image-only files; add per-run logging#4
ridaken merged 2 commits into
mainfrom
text-mode-skip-images

Conversation

@ridaken

@ridaken ridaken commented Jun 27, 2026

Copy link
Copy Markdown
Owner

Fixes a bug where extraction.send_mode: text still rasterized and sent image-only files (PNG/JPG) to the model, which errors against a text-only endpoint.

Change

  • extract_image returns no content in text mode (without even decoding the image) — nothing to send.
  • The pipeline now distinguishes nothing-to-send-in-this-mode (a skip) from a genuine extraction failure (an error). Image-only files in text mode are skipped without a terminal ledger status, so they're reconsidered if vision is later enabled.
  • New skipped_no_content stat surfaced in plan/run output (factored the stats line into one helper).
  • Clarified the send_mode docs in both config templates.

Verified live

Against a text-only llama-server (Qwen3.6-35B), a PNG drawing now reports skipped_no_content=1, errors=0 — previously errors=1 from a rejected image request. The two text-bearing samples still produce proposals.

96 tests pass, 96% coverage, ruff clean.

🤖 Generated with Claude Code

Tom and others added 2 commits June 27, 2026 01:18
send_mode text now never ships an image. extract_image returns no content in text mode without decoding, and the pipeline separates nothing-to-send-in-this-mode (a skip) from a genuine extraction failure (an error). Adds a skipped_no_content stat in plan/run output; image-only files in text mode are skipped without a terminal ledger status, so they are reconsidered if vision is later enabled.

Verified live against a text-only llama-server: a PNG drawing now reports skipped_no_content=1, errors=0 (previously errors=1 from a rejected image request).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Each plan/run writes a fresh timestamped log file (logging.enabled true by default, logging.log_dir for location). It records per file whether it was sent to the LLM, skipped (already judged, already named / criteria, or nothing-to-send in this mode), processed successfully, or failed, plus an end-of-run summary of the counts.

Failures log full diagnostics: the AI client now raises AIError carrying status code, URL, attempts, the request (base64 image data redacted to a size summary), and the response body. Selection skips (already-named, ignored, too-new files) are now counted, not silently dropped. New runlog module; new sent and proper skipped_selection accounting in PlanStats.

Verified live against a text-only llama-server: log shows SEND/OK/SKIP lines and the summary. 105 tests, 96% coverage.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ridaken ridaken changed the title text mode: skip image-only files instead of erroring text mode: skip image-only files; add per-run logging Jun 27, 2026
@ridaken

ridaken commented Jun 27, 2026

Copy link
Copy Markdown
Owner Author

Added per-run logging to this PR (config toggle logging.enabled, on by default). Each run writes a timestamped log recording per-file sent/skipped/processed/failed plus a summary; failures include status code, URL, redacted request, and response body. The AI client now raises AIError with that detail, and selection skips (already-named/ignored/too-new) are now counted rather than silently dropped. Verified live against a text-only llama-server. 105 tests, 96% coverage.

@ridaken
ridaken merged commit e57913e into main Jun 27, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant