fix: 传图修复

This commit is contained in:
ZyGuo committed 2026-06-03 11:12:10 +08:00
1 parent 5d39aa55bd
commit 8ba3a67401
2 files changed
+26 -2

No files matched your search

@@ -32,6 +32,7 @@ test("parses iframe text, page context, and screenshot into a prompt message", (
assert.equal(result.submitText, [
"提取并翻译",
"<attached_image_priority>\nA screenshot image is attached for this message.\nUse the attached image as the primary source of truth.\nUse page context and text prompt only as supporting context.\nIf the image conflicts with page context or text, trust the image.\n</attached_image_priority>",
"<extension_prompt>\n提取图片中的文字并翻译成简体中文\n</extension_prompt>",
"<page_context>\n<title>\nUN News\n</title>\n\n<url>\nhttps://news.un.org/example\n</url>\n\n<content>\nBanning children from social media is not the answer.\n</content>\n</page_context>",
].join("\n\n"));
@@ -64,7 +65,10 @@ test("keeps screenshot-only iframe submissions in the conversation flow", () =>
},
});
assert.equal(result.submitText, "");
assert.equal(
result.submitText,
"<attached_image_priority>\nA screenshot image is attached for this message.\nUse the attached image as the primary source of truth.\nUse page context and text prompt only as supporting context.\nIf the image conflicts with page context or text, trust the image.\n</attached_image_priority>",
);
assert.equal(result.files.length, 1);
assert.equal(result.files[0]?.filename, "shot.jpg");
assert.equal(result.files[0]?.mediaType, "image/jpeg");