mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#4489
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/3174
Author: @Lithivm
Created: 10/19/2026
Status: ❌ Closed
Base:
main← Head:fix/elastic-vision-tool-image📝 Commits (1)
fda5c95serve: start an elastic image encoder before encoding a tool-returned image📊 Changes
1 file changed (+2 additions, -0 deletions)
View changed files
📝
serve/server.py(+2 -0)📄 Description
Fixes #3171.
The bug
_note_unreadable_tool_images()encodes a picture that a tool returned (Claude Code'sReadof an image file, an MCP tool returning a plot) withself.vision.encode(src)— but unlikeprepare()'s own image path it never callsself._vision_up():With the elastic encoder (
vram_elastic: true+ vision"elastic": true) the encoder is not running between pictures, soVision.procisNoneandencode()'sself.proc.stdin.write(...)raisesAttributeError. That function'sexcept (ValueError, OSError)does not catch it, so it leavesprepare()and lands in_post's generic handler, which reports any of those as a client error:So an agent doing a normal tool call breaks the turn — and, because clients re-send history, possibly the turns after it as well.
Repro (0.1.44.1, no waiting needed)
A fresh elastic session never starts the encoder (it starts with the first picture), so the first request with a tool image fails:
"vram_elastic": trueand"vision": {"gpu": true, "elastic": true, ...}; start the server —strata-visionis not running (expected).user→assistant tool_use→user tool_resultwith animageblock).VRAM 3584 MiB kept free: the expert cache N -> M of N slotsin the engine log)."elastic": falsedoes not hit it (the encoder runs from the start), and a user-sent image was always fine — only the tool-returned path is affected.The change
Two lines, the same call the sibling path makes.
_vision_up()returns immediately when the encoder is not elastic or is already running (if not getattr(v, "elastic", False) or v.alive(): return), so nothing changes for non-elastic setups.\ No newline at end of file— no; the file's LF endings are unchanged (2 lines added, 0 removed).Two things I did not change (see #3171)
[image omitted: ...]instead of a 400; widening itsexcepttoAttributeErrorwould keep that promise for unexpected failures too. Kept out of this PR to keep it to the defect._postmaps anyAttributeErrorraised while preparing a request to400 invalid_request_error. That is why this looked like a client bug; an internal error arguably deserves a 500.Verified
--mmap-experts,--vram-elastic,elastic_mib3584)./v1/chat/completions), a user image via/v1/chat/completionsand via/v1/messages, and the tool image that used to fail.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.