fix(feishu): correct identity model docs and prefer tenant-scoped user_id
Feishu's open_id is app-scoped (same user gets different open_ids per bot app), not a canonical identity. Functionally correct for single-bot mode but semantically misleading. - Add comprehensive Feishu identity model documentation to module docstring - Prefer user_id (tenant-scoped) over open_id (app-scoped) in _resolve_sender_profile when both are available - Document bot_open_id usage for @mention matching - Update user_id_alt comment in SessionSource to be platform-generic Ref: closes analysis from PR #8388 (closed as over-scoped)
This commit is contained in:
@@ -1537,7 +1537,7 @@ class TestAdapterBehavior(unittest.TestCase):
|
||||
adapter._dispatch_inbound_event.assert_awaited_once()
|
||||
event = adapter._dispatch_inbound_event.await_args.args[0]
|
||||
self.assertEqual(event.message_type, MessageType.TEXT)
|
||||
self.assertEqual(event.source.user_id, "ou_user")
|
||||
self.assertEqual(event.source.user_id, "u_user") # tenant-scoped user_id preferred over app-scoped open_id
|
||||
self.assertEqual(event.source.user_name, "张三")
|
||||
self.assertEqual(event.source.user_id_alt, "on_union")
|
||||
self.assertEqual(event.source.chat_name, "Feishu DM")
|
||||
|
||||
Reference in New Issue
Block a user