Stop paying the multimodal tax. Your AI agent keeps every image it has seen but only sends the ones it needs: lighter chats, no endless reconnecting, no starting over. Works with Codex, Claude Code, Cline, Gemini CLI, OpenCode, WorkBuddy and more. Install once, forget it.
TypeScript ai-agentsai-imageclaude-codeclaude-code-pluginclinecodexcodex-plugincomputer-usecontext-engineeringcontext-managementdeveloper-toolsgemini-cliimage-generationmcpmultimodalmultimodal-aiopencodeqwen-codetoken-optimizationvision-language-model
test(indexer): PDF 评论的测试数据改成真实记录的排版
chipfighterc078e296372d
diff --git a/spike/scripts/panel-dev.ts b/spike/scripts/panel-dev.tsindex 20abdad..f424858 100644--- a/spike/scripts/panel-dev.ts+++ b/spike/scripts/panel-dev.ts@@ -73,8 +73,11 @@ writeFileSync(join(day, `rollout-2026-09-24T10-00-00-${THREAD}.jsonl`),turn("t4") + upload("msg_4", "t4", [["settings-screenshot.png", screenshot]]) +line("response_item", { type: "image_generation_call", id: "ig_1", status: "completed", result: png(256, 256, (x, y) => [x, y, 180]).toString("base64") }) + say("需要 IMG-001 才能回答。", "t4") +turn("t5") + commented("msg_5", "t5", [- { type: "input_text", text: "按评论改一下宣传册" },- { type: "input_text", text: "Comment 1: 标题再大一点\nPDF path: C:\\docs\\宣传册.pdf\nPDF page: 3/12\n\nComment 2: 这张表的数字对不上\nPDF path: C:\\docs\\宣传册.pdf\nPDF page: 5/12\n" },+ // Laid out as Codex desktop 26.924 writes PDF comments (seen in a real one on 2026-09-29).+ { type: "input_text", text: "\n# Diff comments:\n\n" ++ "## User Comment 1\nFile: pdf:宣传册.pdf\nSide: R\nLines: 1\nPDF path: C:/docs/宣传册.pdf\nPDF page: 3/12\nPDF annotation: region at top-left (60, 90) on 595x842 page\nAnnotated PDF screenshot: attached as a labeled image for Comment 1\nComment:\n标题再大一点\n\n" ++ "## User Comment 2\nFile: pdf:宣传册.pdf\nSide: R\nLines: 1\nPDF path: C:/docs/宣传册.pdf\nPDF page: 5/12\nPDF annotation: point at top-left (300, 420) on 595x842 page\nAnnotated PDF screenshot: attached as a labeled image for Comment 2\nComment:\n这张表的数字对不上\n\n" ++ "## My request:\n按评论改一下宣传册\n" },{ type: "input_text", text: "The next image shows PDF page 3 at the time of Comment 1. The selected region is outlined in blue and marked by comment marker 1." },{ type: "input_image", image_url: url(pdfPage(3)) },{ type: "input_text", text: "The next image shows PDF page 5 at the time of Comment 2. The selected point is marked in blue by comment marker 2." },diff --git a/spike/src/images.test.ts b/spike/src/images.test.tsindex 829e61c..665fff5 100644--- a/spike/src/images.test.ts+++ b/spike/src/images.test.ts@@ -84,17 +84,19 @@ test("view_image through a variable path is still a viewed image; single-quotedassert.deepEqual(findImages(items).map((r) => [r.kind, r.name]), [["view", null], ["view", "e.png"]]);});-// v0.2 — Codex desktop (26.924) comments on a PDF or a web page: the comment's text (with "PDF path:" and "PDF page:"-// lines for a PDF), then per comment a caption and the screenshot, a plain image without tags. The captions and the two-// lines are Codex's own wording; how the rest of the comment text is laid out is assumed here.+// v0.2 — Codex desktop (26.924) comments on a PDF or a web page: one text part with the comments (for a PDF with+// "PDF path:" and "PDF page:" lines), then per comment a caption and the screenshot, a plain image without tags. Laid out+// as in a real PDF comment the user made on 2026-09-29; the content here is made up.const text = (value: string) => ({ type: "input_text", text: value });const plain = (bytes: Buffer) => ({ type: "input_image", image_url: url(bytes), detail: "high" });const comments = (parts: Array<Record<string, any>>) => ({ type: "message", id: "msg_c", role: "user", content: parts, internal_chat_message_metadata_passthrough: { turn_id: "turn-1" } });+const pdfComment = (n: number, path: string, page: number, comment: string) =>+ `## User Comment ${n}\nFile: pdf:${path.split(/[\\/]/).pop()}\nSide: R\nLines: 1\nPDF path: ${path}\nPDF page: ${page}/12\nPDF annotation: point at top-left (175, 669) on 595x842 page; coordinates use top-left page origin; bottom-left PDF drawing point is (175, 173)\nAnnotated PDF screenshot: attached as a labeled image for Comment ${n}\nComment:\n${comment}\n\n`;+const diffComments = (...blocks: string[]) => `\n# Diff comments:\n\n${blocks.join("")}## My request:\n\n`;test("Codex's PDF comment screenshots are PDF pages, with the page, and the PDF's name when the message names one PDF", () => {const refs = findImages([comments([- text("Comment 1: 标题改大一点\nPDF path: C:\\docs\\report.pdf\nPDF page: 3/12\n"),- text("Comment 2: 这张表\nPDF path: C:\\docs\\report.pdf\nPDF page: 5/12\n"),+ text(diffComments(pdfComment(1, "C:/docs/report.pdf", 3, "标题改大一点"), pdfComment(2, "C:/docs/report.pdf", 5, "这张表"))),text("The next image shows PDF page 3 at the time of Comment 1. The selected region is outlined in blue and marked by comment marker 1."),plain(red),text("The next image shows the PDF page at the time of Comment 2. The selected point is marked in blue by comment marker 2."),@@ -108,8 +110,7 @@ test("Codex's PDF comment screenshots are PDF pages, with the page, and the PDF'test("a message about two PDFs names neither", () => {const refs = findImages([comments([- text("PDF path: C:\\docs\\a.pdf\nPDF page: 1/2\n"),- text("PDF path: /home/u/b.pdf\nPDF page: 2/2\n"),+ text(diffComments(pdfComment(1, "C:\\docs\\a.pdf", 1, "一"), pdfComment(2, "/home/u/b.pdf", 2, "二"))),text("The next image shows PDF page 1 at the time of Comment 1. The selected point is marked in blue by comment marker 1."),plain(red),])]);