llama.cpp
41c7a1b4 - ui: fix tool result media shown twice, uncapped and dropped after its run (#33010)

Commit
1 day ago
ui: fix tool result media shown twice, uncapped and dropped after its run (#33010) * ui: drop images of old turns from the context, read_media loads them again When read_media is offered and the model has vision, the images of user turns far behind leave the request. A note stays in their place with an "attachment:" path, and read_media resolves that path from the attachments the browser holds, with no call to the server. Without the tool, attachments are sent as before. The cut moves once per 4 turns, so the server keeps its cache between moves. The chat request, the pre-encode and the compaction summary read the same list. Images of a tool result now get the max resolution cap that attached images get. Assisted-by: Claude (Opus 5.5 Medium) * ui: store the media of a tool result once The tool result message was created with its extracted media, then onAttachments appended the same extras to it again, so the trace showed every read_media image twice. The callback had no other use and goes. Assisted-by: Claude (Opus 5.5 Medium) * ui: images of tool results follow the cut of old turns A stored tool result now sends its media to the model as the run that called the tool did, only what the model can read, through one helper, so the image stays in later turns and the server's cache stays valid. Before, it left the request once the run ended, with no note to load it again. The cut of old turns now covers tool results too, read_media's own included: their images leave with a note and an "attachment:" path. Media stored twice by the earlier bug is sent, noted and shown once. Assisted-by: Claude (Opus 5.5 Medium) * ui: keep attached images in the context Takes back the cut of old turns: images of turns far behind stay in the request, and read_media has no "attachment:" path. Each move of the cut made the server process everything after the removed image again, which costs far more than the tokens of the image it frees. The fixes stay: the media of a tool result is stored once, its images get the max resolution cap, and it goes along in later turns. Assisted-by: Claude (Opus 5.5 Medium) * ui: send the media of a stored tool result in agent requests The agent request turned a tool message with content parts into an empty string, so a stored tool result with media reached the model with no text and no image on later turns. Assisted-by: Claude (Opus 5.5 Medium)
Author
Parents
Loading