Skip to content

feat(drive): document copy workflow guidance - #2184

Merged
SongHantian merged 10 commits into
larksuite:mainfrom
SongHantian:auto-research-sync/01KYVM5CMVBXCSZWETFR6Y4VAQ/mr-1358-5fb17c0d
Aug 11, 2026
Merged

SongHantian merged 10 commits into
larksuite:mainfrom
SongHantian:auto-research-sync/01KYVM5CMVBXCSZWETFR6Y4VAQ/mr-1358-5fb17c0d

Conversation

@SongHantian

@SongHantian SongHantian commented Aug 4, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Document the Drive file copy workflow so agents use the native copy API with stable parameters and avoid unnecessary schema, inspect, or metadata calls.

Changes

  • Added a dedicated Drive copy reference covering source selection, fixed drive files copy parameters, wiki/folder URL handling, post-copy editing boundaries, and error recovery.
  • Updated the Drive skill routing guidance for copy operations, title search uniqueness, authentication diagnostics, and the files.copy API exception.

Test Plan

  • git diff --check

Related Issues

Auto research task: 01KYVM5CMVBXCSZWETFR6Y4VAQ

Summary by CodeRabbit

  • New Features

    • Added precise title-based search guidance, including long-title matching and duplicate-result handling.
    • Added a streamlined copy-and-edit workflow using the newly created copy for subsequent edits.
    • Added clearer handling for validation errors and uncertain request outcomes.
  • Bug Fixes

    • Refined authentication guidance to apply only when identity checks or authentication-related errors require it.
    • Clarified when verification is unnecessary and when additional information is needed.

@CLAassistant

CLAassistant commented Aug 4, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026 •

Copy link
Copy Markdown

Review Change Stack

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

This PR updates Lark Drive guidance. Authentication rules are conditional. Search guidance defines strict title matching. Copy guidance defines source selection, token use, limited reads, completion behavior, and error recovery.

Changes

Lark Drive skill guidance

Layer / File(s) Summary
Conditional authentication and title search rules
skills/lark-drive/SKILL.md, skills/lark-drive/references/lark-drive-search.md
Shared authentication guidance is read only for explicit identity checks or authentication-related errors. Title searches use --only-title, validate long-title results, and require one unique match before write operations.
Copy workflow and error recovery
skills/lark-drive/references/lark-drive-copy.md
The copy workflow selects one unique source, performs one copy, uses the returned token for edits, limits block-ID reads, and handles deterministic, validation, and uncertain transport failures.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • larksuite/cli#2159: Updates the same Lark Drive authentication, copy, and search guidance.
  • larksuite/cli#2226: Introduces the shared authentication guidance that this PR loads conditionally.

Suggested labels: documentation

Suggested reviewers: fangshuyu-768

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: documenting the Drive copy workflow.
Description check ✅ Passed The description includes all required sections and clearly explains the workflow changes, with a specific diff check in the test plan.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@github-actions github-actions Bot added domain/ccm PR touches the ccm domain size/M Single-domain feat or fix with limited business impact labels Aug 4, 2026

@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: 1

🧹 Nitpick comments (1)
skills/lark-drive/references/lark-drive-copy.md (1)

17-22: 🗄️ Data Integrity & Integration | 🔵 Trivial | 🏗️ Heavy lift

Add executable coverage for the fixed copy contract.

Lines 17-22 define the exact drive files copy request, but tests/cli_e2e/drive/coverage.md reports no workflow test for this command. Add a contract test that verifies --file-token, data.folder_token, data.name, and data.type, including rejection of a missing folder_token. Otherwise, a CLI change can silently invalidate this reference and the routing in skills/lark-drive/SKILL.md.

🤖 Prompt for 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.

In `@skills/lark-drive/references/lark-drive-copy.md` around lines 17 - 22, Add
executable contract coverage for the `drive files copy` request documented in
`lark-drive-copy.md`, covering `--file-token`, `data.folder_token`, `data.name`,
and `data.type`. Include a negative case that rejects a missing `folder_token`,
and register the workflow in `tests/cli_e2e/drive/coverage.md` so changes to the
CLI contract or `skills/lark-drive/SKILL.md` routing are detected.
🤖 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 `@skills/lark-drive/references/lark-drive-copy.md`:
- Around line 46-50: 在“错误恢复”部分补充 drive files copy 的未知结果处理:对超时、连接重置、5xx
等可能已到达服务端的传输失败不得自动重试;优先使用可用的幂等机制或结果核对,无法核对时先征得用户确认再重试,并保留现有确定性错误的停止规则。

---

Nitpick comments:
In `@skills/lark-drive/references/lark-drive-copy.md`:
- Around line 17-22: Add executable contract coverage for the `drive files copy`
request documented in `lark-drive-copy.md`, covering `--file-token`,
`data.folder_token`, `data.name`, and `data.type`. Include a negative case that
rejects a missing `folder_token`, and register the workflow in
`tests/cli_e2e/drive/coverage.md` so changes to the CLI contract or
`skills/lark-drive/SKILL.md` routing are detected.
🪄 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: 91003c75-5e28-485a-be69-926189f4f313

📥 Commits

Reviewing files that changed from the base of the PR and between 811d37e and 9188319.

📒 Files selected for processing (2)
  • skills/lark-drive/SKILL.md
  • skills/lark-drive/references/lark-drive-copy.md

Comment thread skills/lark-drive/references/lark-drive-copy.md Outdated
@github-actions

github-actions Bot commented Aug 4, 2026 •

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

npm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@55701fdfd03c05d3a664811fb5e8d84148cc310b

🧩 Skill update

npx skills add SongHantian/cli#auto-research-sync/01KYVM5CMVBXCSZWETFR6Y4VAQ/mr-1358-5fb17c0d -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: 1

🤖 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 `@skills/lark-drive/SKILL.md`:
- Line 13: 更新认证与确认路由规则,将未结构化但明确表示登录态失败的 Drive/API 错误(包括 `1061005 auth failed`
等资源引用中的错误)纳入读取 `../lark-shared/SKILL.md` 的认证诊断路径;保留 `invalid token`、`not
found`、`unsupported type` 及租户安全策略等确定性业务错误不触发诊断。
🪄 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: bd261e7f-b4d8-41a7-9b0f-905020f8231e

📥 Commits

Reviewing files that changed from the base of the PR and between 9188319 and 12742be.

📒 Files selected for processing (2)
  • skills/lark-drive/SKILL.md
  • skills/lark-drive/references/lark-drive-copy.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • skills/lark-drive/references/lark-drive-copy.md

Comment thread skills/lark-drive/SKILL.md Outdated
Comment thread skills/lark-drive/SKILL.md Outdated
Comment thread skills/lark-drive/SKILL.md Outdated
Comment thread skills/lark-drive/SKILL.md Outdated
Comment thread skills/lark-drive/SKILL.md Outdated
Comment thread skills/lark-drive/SKILL.md Outdated
@SongHantian
SongHantian force-pushed the auto-research-sync/01KYVM5CMVBXCSZWETFR6Y4VAQ/mr-1358-5fb17c0d branch from 8b0422f to dfeadd0 Compare August 10, 2026 06:39
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@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: 2

🤖 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 `@skills/lark-drive/references/lark-drive-copy.md`:
- Around line 53-54: Update the post-copy guidance in the final
structured-success workflow to state that if drive +copy succeeds but the
following edit fails, retain data.file_token and retry only the edit; do not
repeat the full copy workflow, which could create a duplicate.

In `@skills/lark-drive/references/lark-drive-search.md`:
- Around line 28-29: Update the full-title search guidance to require checking
all paginated drive +search results when has_more=true, using the same query
until either uniqueness is proven or a documented pagination limit is reached.
Permit write operations only for exactly one strict match across the checked
pages; otherwise report no match or list candidates and request clarification.
🪄 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: 31c7909a-5935-4676-b399-bfe6b2fe40f1

📥 Commits

Reviewing files that changed from the base of the PR and between 2016120 and dfeadd0.

📒 Files selected for processing (3)
  • skills/lark-drive/SKILL.md
  • skills/lark-drive/references/lark-drive-copy.md
  • skills/lark-drive/references/lark-drive-search.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • skills/lark-drive/SKILL.md

Comment thread skills/lark-drive/references/lark-drive-copy.md Outdated
Comment thread skills/lark-drive/references/lark-drive-search.md Outdated
Comment thread skills/lark-drive/SKILL.md Outdated
Comment thread skills/lark-drive/references/lark-drive-search.md
Comment thread skills/lark-drive/references/lark-drive-copy.md
Comment thread skills/lark-drive/references/lark-drive-copy.md Outdated
Comment thread skills/lark-drive/references/lark-drive-copy.md Outdated
Comment thread skills/lark-drive/references/lark-drive-copy.md Outdated
Comment thread skills/lark-drive/references/lark-drive-copy.md Outdated
Comment thread skills/lark-drive/references/lark-drive-copy.md Outdated
Comment thread skills/lark-drive/references/lark-drive-copy.md Outdated
@SongHantian
SongHantian force-pushed the auto-research-sync/01KYVM5CMVBXCSZWETFR6Y4VAQ/mr-1358-5fb17c0d branch from 5e50600 to aaedf5e Compare August 10, 2026 13:05
@SongHantian
SongHantian merged commit 5028c2e into larksuite:main Aug 11, 2026
22 checks passed
@liangshuo-1 liangshuo-1 mentioned this pull request Aug 11, 2026
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain/ccm PR touches the ccm domain size/M Single-domain feat or fix with limited business impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants