Repository navigation
A request keeps its newest pictures; older ones go as their words - #269
Conversation
… messages - A markdown link's underlined text is now a link too, not just the address drawn after it in brackets. Paths of files that exist (relative to the agent's folder, absolute, or under ~/, with :LINE or #L after them) open as file:// links. - Ctrl-H (0x08) deletes like Backspace, in the composer and pickers. - Each staged queued or steered message has a blank row above it, as in the history, and the last one a blank row before the status row. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGDNh4a2FzyND7nayar
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGDNh4a2FzyND7nayar
…s in the daemon Sonny attaches a picture from the clipboard on Ctrl-V, or an image file whose path is pasted or dropped on the terminal, behind an [Image #N] placeholder; PNGs are scaled to 1568px on their longest side. The daemon's submit takes `images` (base64 PNG, JPEG, GIF or WebP), checks them, keeps them with the turn, and sends them after the words in each provider family's own shape. `agent run --image PATH` sends one from the CLI. History reads leave the picture bytes out. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGDNh4a2FzyND7nayar
Ctrl-Y puts back what Ctrl-W, Ctrl-U, Ctrl-K or a word deletion took; Alt-D and Ctrl/Alt-Delete delete the next word; Ctrl-J and Alt-Enter start a new line; Ctrl-P/N move a row; Ctrl-Alt-H deletes a word. Ctrl-Y and Ctrl-N no longer answer a pending approval as `y` and `n` do. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGDNh4a2FzyND7nayar
…it plans Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGDNh4a2FzyND7nayar
…thout a force push Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGDNh4a2FzyND7nayar
…tores them once Ctrl-C (or Esc in a side chat) drops the pictures with the text. A /side question sends the pictures its placeholders name. Once a prompt is a node its pictures live there; the turn keeps their SHA-256, which a retry is checked against. History pages and reads leave pictures out in a subquery whose cheap guard spares items without any. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGDNh4a2FzyND7nayar
A PNG, JPEG, GIF or WebP file comes back as a line naming it and the picture, in each family's result shape. One longer than 1568 px on a side is scaled down, and one over 1 MiB re-encoded as a JPEG. Other binary files stay refused. History reads leave a result's picture bytes out, as they do a prompt's, and elision stubs a picture result as its text. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGDNh4a2FzyND7nayar
A picture counted by its base64 bytes, so a few large ones filled the context budget, brought compaction early, and made the pacer estimate a 1 MiB picture at ~350,000 tokens, which a pool with a learned limit refused before sending. Each picture now weighs four bytes per estimated token (width × height / 750 once the longest side fits 1568, at most 1600). Nodes record what their pictures add beyond that weight (`pictured`, schema 55), and `total_bytes` leaves it out, so every window, compaction and elision budget sees the weight with no change to its query. Only a request's length adds the bytes back: the window and compaction plans carry `pictured` per item for the Content-Length and read-ahead, and `Items.weight` is what the pacer estimates from. A picture result's stub saves what the result weighs over it, so only a large picture is elided. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGDNh4a2FzyND7nayar
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGDNh4a2FzyND7nayar
…mall ones at full cost - `read` scales a picture in a blocking worker, one at a time, so the daemon's one thread keeps serving every other bot meanwhile. - A picture that must be scaled and has more than 64 megapixels is `image_limit`, refused from its header before decoding, and decoding is capped at 256 MiB besides: a small PNG can claim 12000 × 12000. - A picture that compresses to less than its token cost counts at its cost: `pictured` may be negative, so a blank 1568 × 1568 PNG of a few KB weighs its 1600 tokens. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGDNh4a2FzyND7nayar
An absorption batch now reads a steer's pictures only while they fit an 8 MiB budget past its first steer's, and leaves the rest for the next batch. Sonny refuses a picture past 5 MB once scaled, PNG too, and one that would bring a message's pictures past 5 MB together. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGDNh4a2FzyND7nayar
# Conflicts: # src/store/db.rs
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGDNh4a2FzyND7nayar
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGDNh4a2FzyND7nayar
…heir words Anthropic takes 100 pictures and 32 MB in a request, and a long conversation can hold more. A prompt that came with pictures now gets a stub, its words and a line on the pictures, and a result's picture stub is made for any saving. Each node records how many pictures it has (schema 58), and the window counts them. Before a call, past 100 pictures or 20 MiB of their bytes beyond weight, the elision floor moves for any bot until at most 50 and 10 MiB remain. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGDNh4a2FzyND7nayar
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d17523e588
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
turn_usage and the compaction check counted a pinned prompt at its full size even when the elision floor sends it as its words. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGDNh4a2FzyND7nayar
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGDNh4a2FzyND7nayar
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGDNh4a2FzyND7nayar
|
@codex review Full Rust suite passes here except the three SandFS task tests that need fusermount3; the Python runtime suite passes (506 tests; the lookout tests that failed on a stale binary pass on a fresh build). Generated by Claude Code |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
This follows up on #242, from Codex's last finding there (George chose to merge #242 first and do this next).
Each message may carry 20 pictures, but nothing bounded a whole request. Anthropic takes at most 100 pictures and 32 MB in a request, so a long conversation with many screenshots could stop getting replies until it compacted. Now a request keeps its newest pictures, and older ones go as their words.
How
This reuses elision, the mechanism that already sends answered tool results as stubs below a floor.
[20 picture(s) sent with this message, elided from this request]. It's stored beside the node, like a result's stub, and counted with the pictures at their weight.nodes.picturescolumn (schema 58, with a migration). The window counts them, leaving out those that go as stubs.read, because a picture's stub names no tool.turn_usageand the compaction check count it that way.Ordinary elision at the compaction threshold now also stubs older prompts that carry pictures, as it does results. A full-size picture weighs 6,400 bytes, so that's room it gives back.
The same limits apply to every provider. OpenAI's are larger, so this only bites on Anthropic in practice.
Testing
a_request_keeps_its_newest_pictures_and_older_ones_go_as_their_words. Six prompts of 20 pictures each make 120. Planning for 50 keeps the newest two turns, and the oldest prompt goes as its words. A byte bound keeps only the newest turn. Each window streams exactly the bytes it counts.a_pinned_prompt_under_the_floor_counts_as_its_stub(fails without the fix: 2527 vs 1153 bytes).pictures_count_at_their_weight_and_go_wholenow also checks that an elided prompt goes as its words.tests/test_images.py:test_a_request_keeps_its_newest_pictures_and_older_ones_go_as_their_words. Six turns of 20 pictures each, through a real daemon: the sixth request sends pictures for only the newest two prompts.cargo test --workspacepasses, except three task tests that needfusermount3, which this machine lacks. The full runtime suite passes (506 tests). CI is green.docs/DAEMON_MEASUREMENTS.md("Request picture limits"): every difference is inside run-to-run range.🤖 Generated with Claude Code