chat_image: test that fails if the take(MAX+1) read bound is removed #12

Merged
eureka merged 1 commit from eureka/chat-image-read-bound into main 2026-11-08 09:36:07 +00:00

2026-11-08

chat_image: the bounded read is its own function, with a test that fails without the take bound
load() refuses an over-cap file on its length first, so the take(MAX_BYTES + 1) on the read was
reachable only by a file that grew after that check and no test could see it. read_bounded holds the
read; its test grows a file past the cap and requires the read to stop at MAX_BYTES + 1.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 08:13:35 +00:00