fix(feishu): fix webhook mode silent exit and receive_id_type default

- monitor.ts: throw error for webhook mode instead of silently returning,
  so gateway properly marks channel as failed
- targets.ts: default receive_id_type to "user_id" instead of "open_id"
  for non-prefixed IDs, fixing message delivery for enterprise user IDs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
main
Yifeng Wang 2026-02-05 18:52:49 +08:00 committed by cpojer
parent 7e32f1ce20
commit 8ba1387ba2
No known key found for this signature in database
GPG Key ID: C29F94A3201118AF
2 changed files with 5 additions and 2 deletions

View File

@ -55,7 +55,9 @@ export async function monitorFeishuProvider(opts: MonitorFeishuOpts = {}): Promi
}); });
} }
log("feishu: webhook mode not implemented in monitor, use HTTP server directly"); throw new Error(
"feishu: webhook mode not implemented in monitor. Use websocket mode or configure an external HTTP server.",
);
} }
async function monitorWebSocket(params: { async function monitorWebSocket(params: {

View File

@ -57,7 +57,8 @@ export function resolveReceiveIdType(id: string): "chat_id" | "open_id" | "user_
if (trimmed.startsWith(OPEN_ID_PREFIX)) { if (trimmed.startsWith(OPEN_ID_PREFIX)) {
return "open_id"; return "open_id";
} }
return "open_id"; // Default to user_id for other alphanumeric IDs (e.g., enterprise user IDs)
return "user_id";
} }
export function looksLikeFeishuId(raw: string): boolean { export function looksLikeFeishuId(raw: string): boolean {