feat: 话题内智能响应判断 + thinking 泄漏修复 + 空输出静默 - #121
Conversation
- 新增 thread-relevance.ts: Qwen 语义判断话题内无 @mention 消息是否跟 bot 对话 - threadBypass 路径接入语义判断,策略为"宁可不回" - 话题内跳过 quick-ack,避免隐式触发时抢答 - thinking 剥离: 修复 resultMessage.result fallback 路径未剥离的漏洞 - thinking 剥离: 增加未闭合标签处理 - direct 模式空输出静默跳过,不发"(无输出)" - quick-ack 导出 getClient 供 thread-relevance 复用 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Claude finished @lishuceo's task in 3m 16s —— View job PR Review: feat: 话题内智能响应判断 + thinking 泄漏修复 + 空输出静默
|
| Severity | File | Confidence | Description |
|---|---|---|---|
| 🟡 warning | src/feishu/event-handler.ts:558 |
78 | Comment says "没有 @任何 bot 或人类" but guard only checks bot IDs; human mentions are handled by Qwen check, not the guard condition |
Overall Assessment
Solid PR with well-scoped changes. The four features work together coherently:
-
Thread relevance check (
thread-relevance.ts): Clean implementation with proper timeout (2s), fail-safe defaults, and good separation between the API call layer ("宁可不回" on failure) and the parser layer ("宁可多回" on ambiguous responses). The two-tier fallback strategy is explicitly documented in JSDoc — intentional design. -
Thinking tag leak fix (
executor.ts): The two-pass regex approach (closed tags first, then unclosed) is correct and handles edge cases well. Applying the same fix to theresultMessage.resultfallback path closes the remaining leak vector. -
Empty output silent skip (
event-handler.ts:sendDirectReply): Correctly catchessuccess: true+ empty output after thinking-only responses. The check aligns with executor return types (output: string, non-optional). -
Thread quick-ack skip: Appropriate — avoids sending "收到" for implicitly triggered responses.
Tests cover parseRelevanceResponse thoroughly (9 cases) and checkThreadRelevance integration with mocked client (6 cases). Architecture follows existing patterns (ESM imports, singleton reuse via getClient(), Pino logging).
One minor inline comment posted about a misleading code comment.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Claude finished @lishuceo's task in 1m 34s —— View job PR Review: feat/thread-relevance (re-review after sync)
✅ Approved1 previous issue fixed — misleading comment about bot vs human @mention guard now accurately describes the logic. No new issues found (confidence threshold ≥ 75). AssessmentClean, well-scoped PR. All four changes work together coherently:
Tests cover
|
* feat: 话题内智能响应判断 + thinking 泄漏修复 + 空输出静默 - 新增 thread-relevance.ts: Qwen 语义判断话题内无 @mention 消息是否跟 bot 对话 - threadBypass 路径接入语义判断,策略为"宁可不回" - 话题内跳过 quick-ack,避免隐式触发时抢答 - thinking 剥离: 修复 resultMessage.result fallback 路径未剥离的漏洞 - thinking 剥离: 增加未闭合标签处理 - direct 模式空输出静默跳过,不发"(无输出)" - quick-ack 导出 getClient 供 thread-relevance 复用 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: 修正 threadBypass 注释 — 仅 bot @mention 在 guard 中检查 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
resultMessage.resultfallback 路径未剥离 + 未闭合标签处理Test plan
npx vitest run相关测试通过(thread-relevance 15 tests + executor 33 tests)🤖 Generated with Claude Code