diff --git a/wechat-mp.mjs b/wechat-mp.mjs index 51ac35c..413027a 100644 --- a/wechat-mp.mjs +++ b/wechat-mp.mjs @@ -1012,6 +1012,7 @@ export function isRecoverableWechatAgentSessionError(message) { if (/stale_session_poisoned_completion/i.test(normalized)) return true; if (/403|404|not found|无权访问/i.test(normalized)) return true; if (/tool_calls|tool_call_id|insufficient tool messages/i.test(normalized)) return true; + if (/session already has an active request|active request.*cancel/i.test(normalized)) return true; if (/wechat_agent_incomplete_reply/i.test(normalized)) return true; return false; } diff --git a/wechat-mp.test.mjs b/wechat-mp.test.mjs index 786caba..cb96f50 100644 --- a/wechat-mp.test.mjs +++ b/wechat-mp.test.mjs @@ -2714,6 +2714,10 @@ test('isRecoverableWechatAgentSessionError detects poisoned tool_calls history', ); assert.equal(isRecoverableWechatAgentSessionError('stale_session_poisoned_completion'), true); assert.equal(isRecoverableWechatAgentSessionError('无权访问该会话'), true); + assert.equal( + isRecoverableWechatAgentSessionError('Session already has an active request. Cancel it first.'), + true, + ); assert.equal(isRecoverableWechatAgentSessionError('network timeout'), false); });