Skip to content

feat: support bot identity - #2278

Closed
zhangjun-bytedance wants to merge 1 commit into
mainfrom
feat/support_bot_identity
Closed

feat: support bot identity#2278
zhangjun-bytedance wants to merge 1 commit into
mainfrom
feat/support_bot_identity

Conversation

@zhangjun-bytedance

@zhangjun-bytedance zhangjun-bytedance commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

Changes

  • Change 1
  • Change 2

Test Plan

  • Unit tests pass
  • Manual local verification confirms the lark-cli <domain> <command> flow works as expected

Related Issues

  • None

Summary by CodeRabbit

  • New Features

    • Added bot identity support for meeting minutes details and permission requests.
    • Added bot identity support for note details.
    • Added bot identity support for video conference details, notes, and recordings, including calendar event lookups.
    • Bot access remains limited to content available to the configured bot.
  • Documentation

    • Updated command guidance and examples to describe supported bot authentication options and access requirements.
  • Tests

    • Added comprehensive end-to-end and validation coverage for bot-authenticated commands and dry runs.

@github-actions github-actions Bot added domain/vc PR touches the vc domain size/L Large or sensitive change across domains or core paths labels Aug 11, 2026
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 664293f4-4aa4-4871-88d4-5aaae82f792c

📥 Commits

Reviewing files that changed from the base of the PR and between f1cf9a8 and 9863635.

📒 Files selected for processing (1)
  • shortcuts/vc/vc_recording.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • shortcuts/vc/vc_recording.go

📝 Walkthrough

Walkthrough

Minutes, note, and VC shortcuts now support bot authentication where applicable. VC recording scope checks resolve tokens for the active identity. Tests and documentation describe the new identity behavior.

Changes

Shortcut authentication and validation

Layer / File(s) Summary
Minutes and note authentication
shortcuts/minutes/..., shortcuts/note/..., tests/cli_e2e/minutes/..., tests/cli_e2e/note/...
Minutes detail and permission application, plus note detail, accept bot authentication. Note transcripts remain user-only. Tests validate identity propagation, endpoints, artifacts, and permission payloads.
VC authentication and token resolution
shortcuts/vc/vc_detail.go, shortcuts/vc/vc_notes.go, shortcuts/vc/vc_recording.go, shortcuts/vc/vc_recording_test.go
VC detail, notes, and recording accept bot authentication. Recording scope validation resolves credentials for the active identity and app ID.
VC bot execution validation
shortcuts/vc/bot_identity_test.go, tests/cli_e2e/vc/...
Tests cover bot execution for meeting IDs and calendar event IDs, primary-calendar resolution, API paths, help output, and identity-aware scope preflight.
Identity guidance
skills/lark-minutes/SKILL.md, skills/lark-note/..., skills/lark-vc/...
Skill and reference documentation describes bot identity support and access conditions.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant Shortcut
  participant Credential
  participant API
  CLI->>Shortcut: Run command with --as bot
  Shortcut->>Credential: Resolve token for active identity
  Credential-->>Shortcut: Return bot token and scopes
  Shortcut->>API: Send request or dry-run request
  API-->>Shortcut: Return response or validation result
  Shortcut-->>CLI: Render command result
Loading

Possibly related PRs

  • larksuite/cli#2189: Modifies bot-identity handling for shortcuts/vc/vc_notes.go.
  • larksuite/cli#2190: Enables bot authentication for VC shortcuts and adds identity-support tests.
  • larksuite/cli#2194: Adds bot-identity support to Minutes shortcuts and related documentation and tests.

Suggested reviewers: liangshuo-1

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The required sections are present, but the summary is empty and the changes and test plan contain only placeholders or unchecked template items. Replace the placeholders with the motivation, concrete changes, completed test results, and any related issue references.
Docstring Coverage ⚠️ Warning Docstring coverage is 42.11% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding bot identity support.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/support_bot_identity

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@zhangjun-bytedance
zhangjun-bytedance force-pushed the feat/support_bot_identity branch 2 times, most recently from 69d6c51 to f1cf9a8 Compare August 11, 2026 03:02
@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

npm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@986363523619f6d8fe9bea826096c32cfe0d5fd8

🧩 Skill update

npx skills add larksuite/cli#feat/support_bot_identity -y -g

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@shortcuts/vc/bot_identity_test.go`:
- Around line 121-129: Update recordingIdentityTokenResolver to record the
requested token type in req.Type, then assert after mountAndRun that it equals
credential.TokenTypeTAT. Keep the existing error assertion and ensure the test
directly verifies tenant-token preflight resolution.

In `@shortcuts/vc/vc_recording.go`:
- Around line 120-127: The missing-scope error handling around runtime.As() must
not suggest lark-cli auth login when the identity is bot. Use a bot-specific
app-scope hint for bot credentials, while preserving the existing user-login
hint for non-bot identities.

In `@skills/lark-minutes/SKILL.md`:
- Line 23: Update the command identity guidance in SKILL.md to include
+apply-permission alongside +detail and +download as supporting --as bot, while
preserving the default --as user behavior and existing bot permission
limitation.

In `@skills/lark-vc/SKILL.md`:
- Line 23: 更新 lark-vc skill 中的 bot 支持命令说明:将 +detail、+notes 和 +recording 加入支持
--as bot 的列表,并将 +search 的 Markdown 反引号标记修正为有效格式;保留现有 meeting-events 和
meeting-message-send 必须沿用 meeting_id 来源身份的说明。
🪄 Autofix

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 Plus

Run ID: b4987ed4-c908-4afd-84cb-23ff20971ded

📥 Commits

Reviewing files that changed from the base of the PR and between d289566 and f1cf9a8.

📒 Files selected for processing (21)
  • shortcuts/minutes/bot_identity_test.go
  • shortcuts/minutes/minutes_apply_permission.go
  • shortcuts/minutes/minutes_detail.go
  • shortcuts/note/note_detail.go
  • shortcuts/note/note_test.go
  • shortcuts/vc/bot_identity_test.go
  • shortcuts/vc/vc_detail.go
  • shortcuts/vc/vc_notes.go
  • shortcuts/vc/vc_recording.go
  • shortcuts/vc/vc_recording_test.go
  • skills/lark-minutes/SKILL.md
  • skills/lark-note/SKILL.md
  • skills/lark-note/references/lark-note-detail.md
  • skills/lark-vc/SKILL.md
  • skills/lark-vc/references/lark-vc-recording.md
  • tests/cli_e2e/minutes/minutes_apply_permission_test.go
  • tests/cli_e2e/minutes/minutes_detail_dryrun_test.go
  • tests/cli_e2e/note/coverage.md
  • tests/cli_e2e/note/note_dryrun_test.go
  • tests/cli_e2e/vc/vc_detail_dryrun_test.go
  • tests/cli_e2e/vc/vc_recording_dryrun_test.go

Comment thread shortcuts/vc/bot_identity_test.go
Comment thread shortcuts/vc/vc_recording.go
Comment thread skills/lark-minutes/SKILL.md
Comment thread skills/lark-vc/SKILL.md
@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 25.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.44%. Comparing base (a18ccd6) to head (9863635).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
shortcuts/vc/vc_recording.go 25.00% 5 Missing and 1 partial ⚠️

❌ Your patch check has failed because the patch coverage (25.00%) is below the target coverage (60.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2278      +/-   ##
==========================================
- Coverage   76.44%   76.44%   -0.01%     
==========================================
  Files        1013     1013              
  Lines      111957   111969      +12     
==========================================
+ Hits        85588    85594       +6     
- Misses      19859    19863       +4     
- Partials     6510     6512       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@zhangjun-bytedance
zhangjun-bytedance force-pushed the feat/support_bot_identity branch from f1cf9a8 to 9863635 Compare August 11, 2026 03:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain/vc PR touches the vc 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.

2 participants