fix: recover stale WeChat active requests
This commit is contained in:
@@ -1012,6 +1012,7 @@ export function isRecoverableWechatAgentSessionError(message) {
|
|||||||
if (/stale_session_poisoned_completion/i.test(normalized)) return true;
|
if (/stale_session_poisoned_completion/i.test(normalized)) return true;
|
||||||
if (/403|404|not found|无权访问/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 (/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;
|
if (/wechat_agent_incomplete_reply/i.test(normalized)) return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2714,6 +2714,10 @@ test('isRecoverableWechatAgentSessionError detects poisoned tool_calls history',
|
|||||||
);
|
);
|
||||||
assert.equal(isRecoverableWechatAgentSessionError('stale_session_poisoned_completion'), true);
|
assert.equal(isRecoverableWechatAgentSessionError('stale_session_poisoned_completion'), true);
|
||||||
assert.equal(isRecoverableWechatAgentSessionError('无权访问该会话'), true);
|
assert.equal(isRecoverableWechatAgentSessionError('无权访问该会话'), true);
|
||||||
|
assert.equal(
|
||||||
|
isRecoverableWechatAgentSessionError('Session already has an active request. Cancel it first.'),
|
||||||
|
true,
|
||||||
|
);
|
||||||
assert.equal(isRecoverableWechatAgentSessionError('network timeout'), false);
|
assert.equal(isRecoverableWechatAgentSessionError('network timeout'), false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user