fix(im): add im:message scope for user identity send/reply#237
fix(im): add im:message scope for user identity send/reply#237MaxHuang22 merged 1 commit intolarksuite:mainfrom
Conversation
Change-Id: I99be906896da9ebe9d5951d14f3e7da0bcd2b3ad Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Greptile SummaryThis PR adds the Key changes:
Observations:
Confidence Score: 4/5Safe to merge — the change is a targeted, low-risk scope addition with matching documentation updates. All four changed files are consistent with each other and with the rest of the codebase's scope patterns. The only open question is whether No files require special attention; the optional follow-up is in Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant CLI as lark-cli
participant Runner as Runner (ScopesForIdentity)
participant API as Lark API
User->>CLI: im +messages-send --as user ...
CLI->>Runner: identity = "user"
Runner-->>CLI: UserScopes: ["im:message.send_as_user", "im:message"]
CLI->>User: Prompt: authorize im:message.send_as_user + im:message
User-->>CLI: Authorized
CLI->>API: POST /open-apis/im/v1/messages (UAT)
API-->>CLI: 200 OK (message_id, chat_id)
CLI-->>User: Output result
Note over CLI,Runner: Before fix: only im:message.send_as_user was in UserScopes
Note over CLI,Runner: After fix: im:message also required (matches Lark API requirement)
Reviews (1): Last reviewed commit: "fix(im): add im:message scope for user i..." | Re-trigger Greptile |
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@449ab57a464b104c3db27d9f125a5250d7a4fd23🧩 Skill updatenpx skills add sammi-bytedance/larksuite-cli#fix/send_msg_scope -y -g |
Summary
im:messageas a required scope for user identity (--as user) in+messages-sendand+messages-replyshortcutsim:message.send_as_userandim:messagescopes for user identityChanges
shortcuts/im/im_messages_send.go: addim:messagetoUserScopesshortcuts/im/im_messages_reply.go: addim:messagetoUserScopesskills/lark-im/references/lark-im-messages-send.md: documentim:messagerequirement for--as userskills/lark-im/references/lark-im-messages-reply.md: documentim:messagerequirement for--as userTest Plan
lark-cli im +messages-send --user-id <ou_xxx> --text "test" --as userand verify the scope prompt includesim:messagelark-cli im +messages-reply --message-id <om_xxx> --text "test" --as userand verify the scope prompt includesim:message🤖 Generated with Claude Code