Dashboard › opencode › Distillation
ed8dd6ac-3688-415d-b6c8-5da46d3cfe0a["lore_tm_v1_4Hm64mtFiSWbQrYcSB89VDfCgJkfia_xvuQKyVL_B-E"]
/home/byk/Code/opencode-v2-pilot/packages/core/test/session-model-request.test.ts imports Message and ToolResultPart from @opencode/ai, and boundImages and unsupportedParts from @opencode/core/session/model-request; helper capabilities(input: string[]) returns { tools: true, input, output: ["text"] }.SessionModelRequest.unsupportedParts test "replaces unsupported user media with a visible error" passes a user message containing Message.text("Describe these files"), logo.png as image/png with base64 "aGVsbG8=", and document.pdf as application/pdf with base64 "JVBERg==" to a text-only model; it preserves the initial text and replaces the files with ERROR: Cannot read "logo.png" (this model does not support image input). Inform the user. and ERROR: Cannot read "document.pdf" (this model does not support pdf input). Inform the user..SessionModelRequest.unsupportedParts test "replaces unsupported media nested in tool results" uses tool call ID "call_1" and name "read" with content text "Image read successfully" plus a logo.png file at data:image/png;base64,aGVsbG8=; for text-only capabilities, the tool-result retains the successful-read text and replaces the file with ERROR: Cannot read "logo.png" (this model does not support image input). Inform the user..SessionModelRequest.unsupportedParts test "preserves supported media" verifies an image/png user media part with data "aGVsbG8=" remains equal to the original message content when capabilities include ["text", "image"].SessionModelRequest.boundImages test "preserves images below the trigger" verifies a single image/png user message with data "aGVsbG8=" causes boundImages(messages) to return the exact same messages array reference.SessionModelRequest.boundImages test "replaces oldest images until the retained payload reaches the target" creates 3 images of exactly 9 * 1024 * 1024 characters named first.png, second.png, and third.png; boundImages replaces the first 2 images with text parts and retains third.png as media.SessionModelRequest.boundImages test "replaces images nested in tool results" creates 2 images of exactly 13 * 1024 * 1024 characters in tool call ID "call_1" named "read"; both are image/png data-URI files named first.png and second.png, and boundImages replaces first.png with a text part while retaining second.png as a file in the tool result.