fix(wechat): rotate image_url-poisoned sessions for report follow-ups
Memind CI / Test, build, and release guards (push) Has been cancelled

Goose cannot persist historical image scrub (PUT 405), so DeepSeek rejects
image_url on the next turn. Reattach the recent report image and rotate to a
fresh session instead of treating the follow-up as a missing page source.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-08-14 21:45:02 +08:00
parent fe2d5d7aa1
commit 41f245c88a
7 changed files with 370 additions and 19 deletions
+8 -1
View File
@@ -111,12 +111,14 @@ test('buildVisionPayload sends all current-turn images to Qwen in order', async
assert.equal(analyzedImages.length, 2);
assert.deepEqual(analyzedImages.map((item) => item.rawUrl), imageUrls);
assert.deepEqual(result?.userMessage?.metadata?.imageUrls, [
assert.equal(result?.userMessage?.metadata?.imageUrls, undefined);
assert.deepEqual(result?.userMessage?.metadata?.archivedImageUrls, [
'/MindSpace/user-1/public/wechat-mp/first.jpg',
'/MindSpace/user-1/public/wechat-mp/second.jpg',
]);
assert.match(result?.userMessage?.content?.[0]?.text ?? '', /本轮用户仅上传 2 张图片/);
assert.match(result?.userMessage?.content?.[0]?.text ?? '', /图片2/);
assert.doesNotMatch(result?.userMessage?.content?.[0]?.text ?? '', /\[图片\d+\]:/);
});
test('buildVisionPayload does not mark billable usage when vision analysis fails', async () => {
@@ -171,4 +173,9 @@ test('buildVisionPayload strips image_url content parts for text-only Goose prov
false,
);
assert.match(result?.userMessage?.content?.[0]?.text ?? '', /蓝色方块/);
assert.equal(result?.userMessage?.metadata?.imageUrls, undefined);
assert.deepEqual(result?.userMessage?.metadata?.archivedImageUrls, [
'/api/mindspace/v1/assets/asset-7/download?inline=1',
]);
assert.doesNotMatch(result?.userMessage?.content?.[0]?.text ?? '', /\[图片\d+\]:/);
});