fix(wechat): avoid image_url session poison on report follow-ups

Store image-only WeChat messages without running Agent, scrub assistant image_url history, and retry historical-image failures with text-only prompts.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-08-15 08:21:28 +08:00
parent 4c2bc95462
commit 67b9478155
6 changed files with 147 additions and 127 deletions
+11
View File
@@ -2009,6 +2009,17 @@ export function createTkmindProxy({
error.code = 'HISTORICAL_IMAGE_SESSION_UPDATE_UNSUPPORTED';
throw error;
}
if (
requireHistoricalImageIsolation
&& imageIsolation.hasImageUrlContent
&& !imageIsolation.updated
) {
const error = new Error(
`historical_image_session_update_unsupported:${imageIsolation.status ?? 'image_url_content_present'}`,
);
error.code = 'HISTORICAL_IMAGE_SESSION_UPDATE_UNSUPPORTED';
throw error;
}
}
let finalUserMessage = userMessage;
if (llmProviderService && messageHasImages(userMessage) && await llmProviderService.hasVisionKey()) {