Match llama-server speed and context handling for images and multi-turn chat #48
Reference in New Issue
Block a user
Delete Branch "agent-image-and-context-fixes"
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?
Investigation into why asksimba was much slower and worse with context than the llama-server UI turned up three causes, fixed in two commits:
Commit 1 — images: one LLM call instead of two. Image messages ran a full non-streamed vision call to describe the image, then a second agent call with the description pasted in. The agent model (qwen3.8-27b on llama-server) is already vision-capable, so the image is now attached to the user message as multimodal content and the single agent call sees it directly. Roughly halves image-turn latency; tokens stream from the start.
Commit 2 — context fixes:
msg.speaker(aSpeakerenum) to the string"user"— always false — so every prior message, including the user's, was replayed with roleassistant. The model saw a transcript where it apparently said everything itself. Fixed in web, iMessage, WhatsApp, and email paths.speaker="tool"messages (capped at 4000 chars), replayed in history, and served to the UI as just their header line so the tool pill stays compact. No DB migration needed —speakeris a plain varchar and the frontend already knows thetoolspeaker.Measured context budget for reference: the agent's fixed overhead (system prompt + 26 tool schemas) is ~5.8k tokens of the 32k/slot window, hence the 4000-char cap on persisted tool results.
74/74 tests pass.
🤖 Generated with Claude Code