fix: stop @_all from triggering bot mention; coerce MCP enum types - #72607
fix: stop @_all from triggering bot mention; coerce MCP enum types#72607Keithin wants to merge 1 commit into
Conversation
- Remove @_all short-circuit in Feishu mention detection: @所有人都 no longer treated as mentioning the bot. Only individual @ with bot's open_id in mentions[] counts. - Add no-op handler for user_status_change events to suppress 56/day 'processor not found' ERROR log spam. - Coerce MCP enum values to match declared property type (string '10' -> int 10) for Kimi/Moonshot compatibility.
Related: the Feishu @_all hunk overlaps open #59347, while this PR also carries a distinct MCP enum-schema coercion fix. The bundled scopes should be reviewed independently. |
teknium1
left a comment
There was a problem hiding this comment.
Thanks for addressing two current-main defects. The Feishu premise is confirmed at plugins/platforms/feishu/adapter.py:4399-4413, where raw @_all currently returns a self-mention; MCP normalization likewise has no enum coercion at tools/mcp_tool.py:5330-5340.
Problems
- The new
user_status_changeregistration will make the exact expected call list fail intests/gateway/test_feishu.py:434-450; addcustomized:user_status_changebeforebuild. tests/gateway/test_feishu.py:1664-1677currently asserts the opposite@_allbehavior. Update it to cover@_allalone being rejected under mention gating, while explicit bot mentions still pass.- Add MCP regression coverage: current schema tests cover definitions and nullable unions (
tests/tools/test_mcp_tool.py:290-353), not recursive integer/number enum coercion.
The member note on #72607 correctly identifies the Feishu overlap with #59347 and the MCP repair as distinct scopes; preserve test coverage for both when salvaging. This is an automated hermes-sweeper review.
| self._on_meeting_invited_event, | ||
| ) | ||
| .register_p2_customized_event( | ||
| "user_status_change", |
There was a problem hiding this comment.
Please update TestAdapterBehavior.test_build_event_handler_registers_reaction_and_card_processors: its exact expected call list at tests/gateway/test_feishu.py:434-450 currently omits this registration, so this hunk will fail that test.
|
补充复现证据(2026-08-14,v0.20.1 仍受影响): 影响持续:此 bug 已导致我们本地第 5 次回归( 复现步骤(v0.20.1 / origin/main 当前代码):
根因定位: 附加发现(供参考):上游 PR 修复经过本地 2 周生产验证,恳请维护者 review/merge。 |
What
Two fixes in this PR:
@_all false-positive fix — Removed the
@_allshort-circuit in the Feishu gateway adapter that was causing bot mention detection to fire on@_allmessages. Now only explicit personal@mentions trigger bot reply.MCP enum type coercion — Added
_coerce_enum_types()inmcp_tool.pyto handle MCP tool schemas where enum values are strings (e.g."10") but the declared type isinteger. Oceanengine MCP tools send schemas like{enum: ["10","20"], type: integer}; this fix recursively coerces enum values to match the declared type.Testing