Skip to content

feat(im): add UAT support for +messages-send and +messages-reply#180

Merged
YangJunzhou-01 merged 1 commit intolarksuite:mainfrom
sammi-bytedance:feat/im-message-send-uat-support
Apr 2, 2026
Merged

feat(im): add UAT support for +messages-send and +messages-reply#180
YangJunzhou-01 merged 1 commit intolarksuite:mainfrom
sammi-bytedance:feat/im-message-send-uat-support

Conversation

@sammi-bytedance
Copy link
Copy Markdown
Contributor

@sammi-bytedance sammi-bytedance commented Apr 1, 2026

Summary

Add user identity (--as user) support to im +messages-send and im +messages-reply. Previously both shortcuts were bot-only. With this change, messages can be sent as the authorized end user using a user access token (UAT).

Changes

  • Add --as user support to +messages-send and +messages-reply; default identity remains bot
  • Add UserScopes: im:message.send_as_user and BotScopes: im:message:send_as_bot to both shortcuts
  • Add DoAPIAsBot to RuntimeContext so file/image uploads always use bot identity (upload APIs are bot-only) even when the surrounding command runs as user
  • Update skill docs and reference files to reflect user/bot support and upload behavior

Test Plan

  • +messages-send --as user --text sends message with user identity (identity: user in response)
  • +messages-send --as user --image uploads image with bot identity, sends message with user identity
  • +messages-send --as bot continues to work as before
  • auth login --domain im correctly includes im:message.send_as_user scope without error
  • Missing scope error shown correctly when im:message.send_as_user is not authorized

Related Issues

  • None

Summary by CodeRabbit

  • New Features

    • Messaging shortcuts (im +messages-send, im +messages-reply) now support both user and bot identities instead of bot-only
    • Users can send messages as themselves using the new --as user option
    • Media uploads for messages continue using bot credentials
  • Documentation

    • Updated messaging shortcut guides with identity selection instructions and corresponding scope requirements

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 1, 2026

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 1, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Added RuntimeContext.DoAPIAsBot to send SDK requests as a bot; switched IM media uploads to use that bot-only path; expanded IM message shortcuts to allow both user and bot identities and updated docs to describe identity selection and upload behavior.

Changes

Cohort / File(s) Summary
Core API Enhancement
shortcuts/common/runner.go
Added func (ctx *RuntimeContext) DoAPIAsBot(req *larkcore.ApiReq, opts ...larkcore.RequestOptionFunc) (*larkcore.ApiResp, error) which reuses the cached API client, applies ShortcutHeaderOpts when present, and calls ac.DoSDKRequest with core.AsBot.
IM Media Upload
shortcuts/im/helpers.go
Switched uploadImageToIM and uploadFileToIM to call runtime.DoAPIAsBot(...) instead of runtime.DoAPI(...), keeping multipart/form-data construction and larkcore.WithFileUpload() unchanged.
IM Shortcuts Metadata
shortcuts/im/im_messages_reply.go, shortcuts/im/im_messages_send.go
Expanded AuthTypes from ["bot"] to ["bot","user"], removed single Scopes, and added UserScopes and BotScopes; descriptions updated to reflect user/bot support. Execution logic unchanged.
Documentation
skills/lark-im/SKILL.md, skills/lark-im/references/lark-im-messages-reply.md, skills/lark-im/references/lark-im-messages-send.md
Docs updated to document --as user alongside --as bot, specify required UAT scope for user sends, and clarify that local media uploads occur as bot while final sends use the chosen identity.

Sequence Diagram

sequenceDiagram
    participant IM as IMUploadFunc
    participant RC as RuntimeContext
    participant AC as APIClient
    participant SDK as LarkSDK

    IM->>RC: uploadImageToIM / uploadFileToIM(req)
    RC->>RC: DoAPIAsBot(req, opts...)
    RC->>AC: get or reuse API client
    RC->>RC: apply ShortcutHeaderOpts(ctx.ctx) if present
    RC->>AC: DoSDKRequest(ctx.ctx, req, core.AsBot, opts...)
    AC->>SDK: execute HTTP request as bot
    SDK-->>AC: ApiResp
    AC-->>RC: ApiResp
    RC-->>IM: return result
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped along the code-lined way,

Bot uploads stay bot, while sends can play,
User or bot now choose the stage,
Scopes neatly split upon the page,
A rabbit cheers the simpler way.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding UAT (user access token) support to two messaging shortcuts.
Description check ✅ Passed The description follows the template with clear Summary, Changes, Test Plan, and Related Issues sections; all sections are complete and specific.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
skills/lark-im/references/lark-im-messages-send.md (1)

5-22: ⚠️ Potential issue | 🟡 Minor

Update stale --as parameter description to include user mode.

Line 163 still says bot only, which conflicts with the new behavior documented elsewhere in this file (Line 5, Line 21, Line 221).

✏️ Suggested doc fix
-| `--as <identity>` | No | Identity type: `bot` only |
+| `--as <identity>` | No | Identity type: `bot` or `user` |

Also applies to: 163-163, 214-223

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@skills/lark-im/references/lark-im-messages-send.md` around lines 5 - 22,
Update the stale description for the `--as` parameter to reflect both supported
identities (user and bot): locate the `--as` flag references (e.g., the
parameter description that currently mentions only `bot`) and change the text to
explain the two modes (`--as bot` and `--as user`), note the
permission/requirement differences (app must be in the chat for bot;
`im:message.send_as_user` scope for user), and ensure the three places that
still say `bot` only are updated to match the top-of-file behavior and examples.
skills/lark-im/references/lark-im-messages-reply.md (1)

5-22: ⚠️ Potential issue | 🟡 Minor

Fix stale --as parameter doc (bot-only is no longer true).

Line 157 conflicts with the updated user/bot identity support described in Line 5 and Line 221.

✏️ Suggested doc fix
-| `--as <identity>` | No | Identity type: `bot` only |
+| `--as <identity>` | No | Identity type: `bot` or `user` |

Also applies to: 157-157, 214-222

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@skills/lark-im/references/lark-im-messages-reply.md` around lines 5 - 22, The
docs contain a stale statement claiming the `--as` parameter is bot-only; update
all occurrences of `--as` usage to reflect that it supports both `user` and
`bot` identities (remove or reword the "bot-only" assertion), and reconcile the
contradictory lines so the intro ("Reply to a specific message") and the
identity section both state the same behavior; specifically search for the
`--as` token and the identity description blocks and change wording to explain
both `--as user` and `--as bot` usage and any scope/app-install requirements
consistently.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@shortcuts/im/im_messages_reply.go`:
- Around line 23-25: The change reversed the default identity by setting
AuthTypes so that AuthTypes[0] is "user", which makes the --as flag default to
user; restore the original order so the bot remains the default by ensuring the
AuthTypes slice in the +messages-reply shortcut lists "bot" first (e.g.,
AuthTypes: []string{"bot", "user"}), leaving UserScopes and BotScopes unchanged;
this preserves registerShortcutFlags' behavior (which uses AuthTypes[0] as the
--as default) and avoids breaking existing bot-default workflows.

---

Outside diff comments:
In `@skills/lark-im/references/lark-im-messages-reply.md`:
- Around line 5-22: The docs contain a stale statement claiming the `--as`
parameter is bot-only; update all occurrences of `--as` usage to reflect that it
supports both `user` and `bot` identities (remove or reword the "bot-only"
assertion), and reconcile the contradictory lines so the intro ("Reply to a
specific message") and the identity section both state the same behavior;
specifically search for the `--as` token and the identity description blocks and
change wording to explain both `--as user` and `--as bot` usage and any
scope/app-install requirements consistently.

In `@skills/lark-im/references/lark-im-messages-send.md`:
- Around line 5-22: Update the stale description for the `--as` parameter to
reflect both supported identities (user and bot): locate the `--as` flag
references (e.g., the parameter description that currently mentions only `bot`)
and change the text to explain the two modes (`--as bot` and `--as user`), note
the permission/requirement differences (app must be in the chat for bot;
`im:message.send_as_user` scope for user), and ensure the three places that
still say `bot` only are updated to match the top-of-file behavior and examples.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7a074dd5-8d1f-4e7c-816c-088f4d66dc57

📥 Commits

Reviewing files that changed from the base of the PR and between 70c72a2 and f3eff62.

📒 Files selected for processing (7)
  • shortcuts/common/runner.go
  • shortcuts/im/helpers.go
  • shortcuts/im/im_messages_reply.go
  • shortcuts/im/im_messages_send.go
  • skills/lark-im/SKILL.md
  • skills/lark-im/references/lark-im-messages-reply.md
  • skills/lark-im/references/lark-im-messages-send.md

@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Apr 1, 2026

Greptile Summary

This PR adds --as user support to im +messages-send and im +messages-reply, introducing a new DoAPIAsBot helper on RuntimeContext so file/image uploads always use bot identity while the final send respects the resolved identity. Scope checking is correctly routed through ScopesForIdentity, and all documentation is updated consistently.

  • The legacy Scopes field is retained in both shortcut definitions even though UserScopes and BotScopes are now both populated, making it permanently unreachable dead code in ScopesForIdentity.

Confidence Score: 5/5

Safe to merge; only finding is a cosmetic dead-code field that has no runtime impact.

All P0/P1 concerns are absent. The DoAPIAsBot path correctly hard-codes bot identity for upload-only APIs, scope checking is properly routed through ScopesForIdentity, and the AuthTypes expansion is consistent across both shortcuts. The sole remaining finding (stale Scopes field) is P2 style cleanup with zero behavioral impact.

shortcuts/im/im_messages_send.go and shortcuts/im/im_messages_reply.go — minor dead-code cleanup only.

Important Files Changed

Filename Overview
shortcuts/common/runner.go Adds DoAPIAsBot that hard-codes core.AsBot identity for upload-only calls; mirrors DoAPI structure correctly.
shortcuts/im/helpers.go Both uploadImageToIM and uploadFileToIM switched from DoAPI to DoAPIAsBot, correctly forcing bot identity for upload-only endpoints.
shortcuts/im/im_messages_send.go Adds UserScopes/BotScopes/AuthTypes for user identity support; legacy Scopes field left in place as unreachable dead code.
shortcuts/im/im_messages_reply.go Same pattern as im_messages_send.go; adds user identity support with legacy Scopes field remaining unreachable.
skills/lark-im/SKILL.md Updated shortcut table descriptions from bot-only to user/bot — clean documentation change.
skills/lark-im/references/lark-im-messages-send.md Expanded reference with user identity instructions, upload-as-bot note, and corrected flag table — accurate and consistent.
skills/lark-im/references/lark-im-messages-reply.md Mirrors send reference updates; user identity documentation is accurate and the upload-as-bot behavior is clearly explained.

Sequence Diagram

sequenceDiagram
    participant User
    participant CLI
    participant UploadAPI as Lark Upload API (bot-only)
    participant MsgAPI as Lark Messages API (user or bot)

    User->>CLI: lark-cli im +messages-send --as user --image ./photo.png

    CLI->>CLI: resolveShortcutIdentity() → user
    CLI->>CLI: checkShortcutScopes(UserScopes: im:message.send_as_user)

    alt Local file path provided
        CLI->>UploadAPI: DoAPIAsBot() POST /im/v1/images [TAT — always bot]
        UploadAPI-->>CLI: image_key
    end

    CLI->>MsgAPI: DoAPIJSON() POST /im/v1/messages [UAT — resolved --as identity]
    MsgAPI-->>CLI: message_id, chat_id
    CLI-->>User: Output result
Loading

Reviews (7): Last reviewed commit: "feat: support im message send/reply with..." | Re-trigger Greptile

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
skills/lark-im/references/lark-im-messages-send.md (1)

5-22: ⚠️ Potential issue | 🟡 Minor

Fix stale --as parameter description to avoid contradiction.

The updated sections say user/bot are supported, but Line 163 still says bot only.

📝 Proposed doc fix
-| `--as <identity>` | No | Identity type: `bot` only |
+| `--as <identity>` | No | Identity type: `user` or `bot` |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@skills/lark-im/references/lark-im-messages-send.md` around lines 5 - 22, The
docs currently contradict themselves by saying the --as parameter is "bot" only
while earlier and elsewhere it states both user and bot are supported; update
the stale description that mentions "bot" only to reflect that --as supports
both "user" and "bot", adjust any example or explanatory text that restricts it
to bot (search for the literal "--as bot" phrase and the sentence claiming
bot-only), and ensure the safety constraints and the note about required scopes
reference both identities (including the im:message:send_as_user scope for --as
user) so the documentation is consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@skills/lark-im/references/lark-im-messages-send.md`:
- Around line 5-22: The docs currently contradict themselves by saying the --as
parameter is "bot" only while earlier and elsewhere it states both user and bot
are supported; update the stale description that mentions "bot" only to reflect
that --as supports both "user" and "bot", adjust any example or explanatory text
that restricts it to bot (search for the literal "--as bot" phrase and the
sentence claiming bot-only), and ensure the safety constraints and the note
about required scopes reference both identities (including the
im:message:send_as_user scope for --as user) so the documentation is consistent.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a7e3b706-9125-4e03-bce5-edb9515a4a10

📥 Commits

Reviewing files that changed from the base of the PR and between db1425b and b3fac2e.

📒 Files selected for processing (4)
  • shortcuts/im/im_messages_reply.go
  • shortcuts/im/im_messages_send.go
  • skills/lark-im/references/lark-im-messages-reply.md
  • skills/lark-im/references/lark-im-messages-send.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • shortcuts/im/im_messages_reply.go
  • skills/lark-im/references/lark-im-messages-reply.md

@sammi-bytedance sammi-bytedance force-pushed the feat/im-message-send-uat-support branch from b3fac2e to 709fa93 Compare April 1, 2026 09:42
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
skills/lark-im/references/lark-im-messages-send.md (1)

163-163: ⚠️ Potential issue | 🟡 Minor

Documentation inconsistency: --as parameter description says "bot only" but user is now supported.

Line 163 states Identity type: bot only, which contradicts the rest of this document (lines 5, 15, 21-22, 221-222) and the code changes in im_messages_send.go where AuthTypes: []string{"bot", "user"} enables both identities.

📝 Proposed fix
-| `--as <identity>` | No | Identity type: `bot` only |
+| `--as <identity>` | No | Identity type: `bot` (default) or `user` |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@skills/lark-im/references/lark-im-messages-send.md` at line 163, The
documentation for the `--as` parameter is incorrect: it currently says "Identity
type: `bot` only" but the implementation in im_messages_send.go sets AuthTypes:
[]string{"bot", "user"}; update the `--as <identity>` row to reflect both
supported identities (e.g., "Identity type: `bot` or `user`") and scan this
markdown for other mentions (lines referenced in the comment) to make consistent
wording and examples that show both `--as bot` and `--as user` where applicable.
🧹 Nitpick comments (2)
shortcuts/im/im_messages_send.go (1)

23-25: Consider removing redundant Scopes field.

With both UserScopes and BotScopes now defined, the Scopes field on line 23 is never used by ScopesForIdentity() since it only falls back to Scopes when the identity-specific slice is empty. Keeping it is harmless but adds slight noise.

♻️ Optional cleanup
 	Risk:        "write",
-	Scopes:      []string{"im:message:send_as_bot"},
 	UserScopes:  []string{"im:message:send_as_user"},
 	BotScopes:   []string{"im:message:send_as_bot"},
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@shortcuts/im/im_messages_send.go` around lines 23 - 25, The struct currently
defines Scopes along with UserScopes and BotScopes, but ScopesForIdentity() only
uses Scopes as a fallback when the identity-specific slice is empty, and since
UserScopes and BotScopes are populated the Scopes field is redundant; remove the
Scopes field from the struct (and any references to it) to reduce noise—update
the definition that contains Scopes, UserScopes, BotScopes (and any constructor
or literal where Scopes is set) so only UserScopes and BotScopes remain, and run
tests to ensure ScopesForIdentity() behavior is unchanged.
shortcuts/im/im_messages_reply.go (1)

22-24: Same optional cleanup opportunity as im_messages_send.go.

The Scopes field on line 22 is redundant now that both UserScopes and BotScopes are defined.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@shortcuts/im/im_messages_reply.go` around lines 22 - 24, The Scopes field is
redundant because UserScopes and BotScopes are now explicitly provided; remove
the Scopes entry (the "Scopes" key) from the shortcut definition so only
UserScopes and BotScopes remain, updating the initializer where Scopes,
UserScopes, and BotScopes are defined (referencing the Scopes, UserScopes, and
BotScopes symbols in im_messages_reply.go) to avoid duplicated/unused
configuration.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@skills/lark-im/references/lark-im-messages-send.md`:
- Line 163: The documentation for the `--as` parameter is incorrect: it
currently says "Identity type: `bot` only" but the implementation in
im_messages_send.go sets AuthTypes: []string{"bot", "user"}; update the `--as
<identity>` row to reflect both supported identities (e.g., "Identity type:
`bot` or `user`") and scan this markdown for other mentions (lines referenced in
the comment) to make consistent wording and examples that show both `--as bot`
and `--as user` where applicable.

---

Nitpick comments:
In `@shortcuts/im/im_messages_reply.go`:
- Around line 22-24: The Scopes field is redundant because UserScopes and
BotScopes are now explicitly provided; remove the Scopes entry (the "Scopes"
key) from the shortcut definition so only UserScopes and BotScopes remain,
updating the initializer where Scopes, UserScopes, and BotScopes are defined
(referencing the Scopes, UserScopes, and BotScopes symbols in
im_messages_reply.go) to avoid duplicated/unused configuration.

In `@shortcuts/im/im_messages_send.go`:
- Around line 23-25: The struct currently defines Scopes along with UserScopes
and BotScopes, but ScopesForIdentity() only uses Scopes as a fallback when the
identity-specific slice is empty, and since UserScopes and BotScopes are
populated the Scopes field is redundant; remove the Scopes field from the struct
(and any references to it) to reduce noise—update the definition that contains
Scopes, UserScopes, BotScopes (and any constructor or literal where Scopes is
set) so only UserScopes and BotScopes remain, and run tests to ensure
ScopesForIdentity() behavior is unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 79855ca9-21c8-439b-9a59-102c459aa700

📥 Commits

Reviewing files that changed from the base of the PR and between b3fac2e and 709fa93.

📒 Files selected for processing (7)
  • shortcuts/common/runner.go
  • shortcuts/im/helpers.go
  • shortcuts/im/im_messages_reply.go
  • shortcuts/im/im_messages_send.go
  • skills/lark-im/SKILL.md
  • skills/lark-im/references/lark-im-messages-reply.md
  • skills/lark-im/references/lark-im-messages-send.md
✅ Files skipped from review due to trivial changes (3)
  • shortcuts/im/helpers.go
  • shortcuts/common/runner.go
  • skills/lark-im/references/lark-im-messages-reply.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • skills/lark-im/SKILL.md

@github-actions github-actions bot added domain/im PR touches the im domain size/L Large or sensitive change across domains or core paths labels Apr 1, 2026
@sammi-bytedance sammi-bytedance force-pushed the feat/im-message-send-uat-support branch from 709fa93 to ce77c6e Compare April 1, 2026 09:53
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
skills/lark-im/references/lark-im-messages-send.md (1)

149-164: ⚠️ Potential issue | 🟡 Minor

Update stale --as parameter description.

Line 163 still says bot only, which conflicts with the updated dual-identity behavior documented elsewhere (e.g., Line 5 and Line 221).

📝 Proposed doc fix
-| `--as <identity>` | No | Identity type: `bot` only |
+| `--as <identity>` | No | Identity type: `bot` or `user` (default follows shortcut auth/default-as resolution) |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@skills/lark-im/references/lark-im-messages-send.md` around lines 149 - 164,
The `--as <identity>` parameter description is stale (currently "bot only");
update the docs entry for `--as <identity>` to reflect dual-identity behavior by
allowing both identities (e.g., "bot" and "user") or the exact identity tokens
used elsewhere in the doc, and ensure the wording matches other sections that
describe dual-identity behavior (so `--as <identity>` lists both supported
values and any constraints).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@skills/lark-im/references/lark-im-messages-send.md`:
- Around line 149-164: The `--as <identity>` parameter description is stale
(currently "bot only"); update the docs entry for `--as <identity>` to reflect
dual-identity behavior by allowing both identities (e.g., "bot" and "user") or
the exact identity tokens used elsewhere in the doc, and ensure the wording
matches other sections that describe dual-identity behavior (so `--as
<identity>` lists both supported values and any constraints).

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f7153530-aa7b-4b41-8efd-9767ad7fa808

📥 Commits

Reviewing files that changed from the base of the PR and between 709fa93 and ce77c6e.

📒 Files selected for processing (7)
  • shortcuts/common/runner.go
  • shortcuts/im/helpers.go
  • shortcuts/im/im_messages_reply.go
  • shortcuts/im/im_messages_send.go
  • skills/lark-im/SKILL.md
  • skills/lark-im/references/lark-im-messages-reply.md
  • skills/lark-im/references/lark-im-messages-send.md
🚧 Files skipped from review as they are similar to previous changes (5)
  • shortcuts/im/helpers.go
  • skills/lark-im/SKILL.md
  • shortcuts/im/im_messages_send.go
  • shortcuts/im/im_messages_reply.go
  • skills/lark-im/references/lark-im-messages-reply.md

@sammi-bytedance sammi-bytedance force-pushed the feat/im-message-send-uat-support branch 3 times, most recently from 2ffd799 to 37c2f5d Compare April 2, 2026 04:02
- Add --as user support to +messages-send and +messages-reply
- Add UserScopes (im:message.send_as_user) / BotScopes (im:message:send_as_bot)
- Add DoAPIAsBot to RuntimeContext so file/image uploads always use bot
  identity even when the surrounding command runs as user
- Update skill docs and reference files to reflect user/bot support
- Default identity remains bot (first element of AuthTypes)
@sammi-bytedance sammi-bytedance force-pushed the feat/im-message-send-uat-support branch from 37c2f5d to 1706d1c Compare April 2, 2026 04:07
@YangJunzhou-01 YangJunzhou-01 merged commit f231031 into larksuite:main Apr 2, 2026
4 checks passed
tuxedomm pushed a commit that referenced this pull request Apr 3, 2026
- Add --as user support to +messages-send and +messages-reply
- Add UserScopes (im:message.send_as_user) / BotScopes (im:message:send_as_bot)
- Add DoAPIAsBot to RuntimeContext so file/image uploads always use bot
  identity even when the surrounding command runs as user
- Update skill docs and reference files to reflect user/bot support
- Default identity remains bot (first element of AuthTypes)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain/im PR touches the im domain size/L Large or sensitive change across domains or core paths

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants