Skip to content

fix: use isGroupMessage for replyTo, consistent with allowlist logic#23

Merged
LinekForge merged 2 commits into
LinekForge:mainfrom
AmberCXX:main
May 8, 2026
Merged

fix: use isGroupMessage for replyTo, consistent with allowlist logic#23
LinekForge merged 2 commits into
LinekForge:mainfrom
AmberCXX:main

Conversation

@AmberCXX
Copy link
Copy Markdown
Contributor

@AmberCXX AmberCXX commented May 8, 2026

动机

handleMessage 底部的 replyTo 赋值仍在使用 chatId.startsWith("oc_") 判断是否为群聊,而 isGroupMessage 变量已在 #21 修正为使用 chat_type === "group"。两处判断逻辑不一致。

改动概要

hub-server/channels/feishu.ts:将 replyTo 赋值改为使用 isGroupMessage,消除重复的前缀启发式判断。

影响范围

仅改 feishu.ts 一处赋值,1 行变更。不涉及其他 channel、Hub 核心逻辑或接口。

Self-test 结果

bun hub-test-harness/harness.ts
  ✅ 1. happy allow (yes + yes_id)
  ✅ 2. happy deny (no + no_id)
  ✅ 3. mismatch (yes + no_id)
  ✅ 4. malformed (yes + 6 字母)
  ✅ 5. 非主人触发第二道防线
  ✅ 6. 无关聊天(没 pending 时 yes/no 不干预)
  ✅ 7. channel crash: sync uncaughtException 不崩 Hub
  ✅ 8. channel crash: unhandledRejection 不崩 Hub
📊 8/8 通过

fh hub self-test
📊 8/8 通过

全量验证:hub-server tsc ✅ · 64/64 tests ✅ · hub-client tsc ✅ · forge-engine 5/5 ✅ · forge-cli 19/19 ✅ · hub-dashboard lint+build ✅

🤖 Generated with Claude Code

Xuxian Chen and others added 2 commits May 8, 2026 08:08
chatId.startsWith("oc_") was duplicated at replyTo; now uses the
isGroupMessage variable (already fixed to use chat_type === "group").

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@LinekForge LinekForge merged commit a61c029 into LinekForge:main May 8, 2026
@LinekForge
Copy link
Copy Markdown
Owner

Merged — thanks @AmberCXX!

This was a leftover from #21 that we missed. The chatId.startsWith("oc_") heuristic at L268 was the second place using the old prefix check (the first was the allowlist check at L203, fixed in #21). Now both use isGroupMessage consistently.

Good eye catching the inconsistency. The self-test coverage is also appreciated — 8/8 harness + full tsc across all packages is thorough.

— Forge (maintainer)

LinekForge added a commit that referenced this pull request May 8, 2026
Co-authored-by: Forge <270260515+ForgeLinek@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants