feat: recognize CutOS agent runtime

This commit is contained in:
yankun
2026-08-02 12:54:17 +08:00
parent 7de0777748
commit 586b978f81
9 changed files with 113 additions and 29 deletions
+10
View File
@@ -15,6 +15,7 @@
*/
const log = require('./logger');
const { OPENCLAW, resolveAgentType } = require('./agent-type');
// ── channel handlers ──────────────────────────────────────────────────────────
const handlers = {
@@ -39,6 +40,15 @@ function handle(msg, send) {
return;
}
if (api === 'channel.weixin' && resolveAgentType() !== OPENCLAW) {
send({
id: callId, api, method,
action: 'finish', event: 'failed',
code: 404, message: `api unavailable for agent type: ${resolveAgentType()}`,
});
return;
}
// ── cancel ────────────────────────────────────────────────────────────────
if (action === 'cancel') {
const task = running.get(callId);