From 2ce1527eddab6251e1b6e6ba24051ae85885eb7c Mon Sep 17 00:00:00 2001 From: john Date: Sat, 18 Jul 2026 21:20:56 +0800 Subject: [PATCH] feat: enable WeChat media for all users --- wechat-mp.mjs | 1 + wechat-mp.test.mjs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wechat-mp.mjs b/wechat-mp.mjs index 5a386e8..5423846 100644 --- a/wechat-mp.mjs +++ b/wechat-mp.mjs @@ -1198,6 +1198,7 @@ function isWechatMediaGrayUser(user, configuredUsers = []) { ? configuredUsers.map((value) => String(value ?? '').trim().toLowerCase()).filter(Boolean) : []; if (allowlist.length === 0) return false; + if (allowlist.includes('*')) return true; const identities = [ user?.userId, user?.username, diff --git a/wechat-mp.test.mjs b/wechat-mp.test.mjs index bdf9693..aacc762 100644 --- a/wechat-mp.test.mjs +++ b/wechat-mp.test.mjs @@ -3697,7 +3697,7 @@ test('wechat mp service falls back to ASR when voice recognition is empty', asyn } }); -test('wechat mp service persists image and routes image url into agent prompt', async () => { +test('wechat mp wildcard media access persists image and routes image url into agent prompt', async () => { const token = 'token'; const timestamp = '1710000000'; const nonce = 'nonce'; @@ -3719,7 +3719,7 @@ test('wechat mp service persists image and routes image url into agent prompt', unboundTextPrefix: '请先绑定', progressDelayMs: 0, maxImageBytes: 1024 * 1024, - mediaAnalysisGrayUsers: [testUserId], + mediaAnalysisGrayUsers: ['*'], }, userAuth: { async findWechatUserByOpenid() {