fix(ocr): Test connection sent a corrupt probe PNG — Ollama answered HTTP 400 #38
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
daniel/obsidian-remarkable-round-trip!38
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/fix-ocr-probe-png"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of #14. This fixes the "Test connection → HTTP 400, invalid args" error the owner reported in #14, note 45419. The run that should have answered that note was OOMKilled.
Root cause
PROBE_PNG_BASE64insrc/transport/ocr.tswas malformed. Its IDAT chunk declared 11 bytes (…AAAAC0lE…) but held 13, so:1fa2b2f0, expected018084a9);Error -5).pngcheckreportsCRC error in chunk IDAT. Ollama decodes the image and rejects the request with 400. Imports send real renders, which is why the owner's test sheet read fine through the same endpoint (18 of 18 lines answered).Change
checkConnection > probes with a well-formed PNG a vision model can read. It takes the probe out of the real request body and checks the PNG signature, every chunk's CRC, that IHDR comes first and IEND last, that both sides are at least 28 px, and that IDAT inflates.Verification
npx vitest run src/__tests__/ocr.test.ts: 11 passed.npx tsc --noEmit -skipLibCheck: clean.npx eslinton both files: clean.prettier --checkflags both files, but it already flags them onmain, so this change doesn't introduce it.🤖 Generated with Claude Code
🤖 Agent has finished this run — session idle after turn 28. It resumes automatically on the next comment or event.
Last activity: round idle — updated 23:05:54 UTC
Last message:
claude referenced this pull request2026-10-21 01:04:37 +02:00
What changed
f31ca07(valid 64×64 grayscale probe PNG, plus the probe-validity test) is already on the branch and up to date withmain.Verify
vitestsuite: 839 passed, 1 skipped.tsc --noEmit -skipLibCheckandeslinton both files: clean.zlib.crc32, which needs Node ≥ 22.2.release.ymluses Node 22, so that's fine.Follow-ups