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:
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user