Skip to content

fix(im): use tenant token for message history list#453

Open
xfcycc wants to merge 1 commit into
larksuite:mainfrom
xfcycc:fix/message-list-tenant-auth
Open

fix(im): use tenant token for message history list#453
xfcycc wants to merge 1 commit into
larksuite:mainfrom
xfcycc:fix/message-list-tenant-auth

Conversation

@xfcycc
Copy link
Copy Markdown

@xfcycc xfcycc commented Apr 30, 2026

Summary

Fix Feishu IM message history reads by using tenant access token for im.v1.message.list.

  • Switch conversation history and thread history list calls to tenant token
  • Remove obsolete user-level get_as_user scopes from feishu_im_user_get_messages
  • Keep feishu_im_user_search_messages on user token
  • Document the bot-membership limitation for history reads

Closes #356

Why

im.v1.message.list only supports tenant access token. Calling it with user access token can fail with:

The app type is not supported

After switching to tenant token, the API still requires the bot to be in the target chat. This PR keeps that limitation explicit in tool descriptions.

Test plan

  • pnpm build
  • pnpm lint — no errors, 21 pre-existing warnings
  • Manual: feishu_im_user_get_messages can read group history with tenant token in local patched runtime
  • Manual/code review: feishu_im_user_search_messages remains user-token based

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 30, 2026

CLA assistant check
All committers have signed the CLA.

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.

Bug: feishu_im_user_get_messages 无法读取用户私聊消息 — PR #58 修复不完整 + 飞书 API 限制

2 participants