Skip to content

feat(drive): optimize copy and search guidance - #2159

Open
beibeisongi777-netizen wants to merge 1 commit into
larksuite:mainfrom
beibeisongi777-netizen:auto-research-sync/01KYVM5CMVBXCSZWETFR6Y4VAQ/mr-1358-38fe5321
Open

feat(drive): optimize copy and search guidance#2159
beibeisongi777-netizen wants to merge 1 commit into
larksuite:mainfrom
beibeisongi777-netizen:auto-research-sync/01KYVM5CMVBXCSZWETFR6Y4VAQ/mr-1358-38fe5321

Conversation

@beibeisongi777-netizen

@beibeisongi777-netizen beibeisongi777-netizen commented Aug 3, 2026

Copy link
Copy Markdown

Summary

Refine lark-drive skill guidance for Drive copy, search, and authentication handling.

Changes

  • Avoid eager auth/shared diagnostics for routine Drive operations unless requested or required by structured errors.
  • Document direct drive files copy usage, strict source-title matching, explicit destination folder handling, and returned-token reuse for copy editing flows.
  • Clarify drive +search --query as the title lookup path and mark drive files copy as the fixed-parameter exception to the schema-first native API guidance.

Test Plan

  • git diff --check

Related Issues

Auto research task: 01KYVM5CMVBXCSZWETFR6Y4VAQ

Summary by CodeRabbit

  • Documentation
    • 更新 Drive 操作指南,认证共享文档改为按需读取。
    • 优化文档复制流程,增加标题唯一匹配、目标文件夹令牌校验及副本令牌使用规则。
    • 明确搜索需使用 +search,并规范重复结果处理。
    • 补充原生 API 复制普通文件时的例外规则。

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

Drive 技能指引

Layer / File(s) Summary
搜索与文档复制流程
skills/lark-drive/SKILL.md
搜索优先使用 drive +search,并执行严格标题匹配。复制文档时校验 token 类型,并使用复制结果返回的副本 token。
认证与原生 API 规则
skills/lark-drive/SKILL.md
认证诊断改为按需执行。普通文件复制等固定参数操作不再预先查询 schema。

Estimated code review effort: 1 (Trivial) | ~5 minutes

Suggested reviewers: liangshuo-1, wittam-01

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main Drive copy and search guidance changes.
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

Warning

Tools execution failed with the following error:

Failed to run tools: 14 UNAVAILABLE: Connection dropped


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 3, 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

🤖 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`:
- Around line 163-167: Align the schema-exception wording in the command usage
and the “重要” guidance so only the explicitly supported `drive files copy`
operation bypasses schema lookup. Remove the unsupported exemptions for ordinary
documents, sheets, Base, and slides unless their fixed parameter contracts are
documented and reflected consistently in the earlier command description.
🪄 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 Plus

Run ID: db52e2f6-6acc-47da-9657-c63c50915884

📥 Commits

Reviewing files that changed from the base of the PR and between 2a16134 and 2328c39.

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

Comment on lines +163 to +167
lark-cli schema drive.<resource>.<method> # 原生 API 调用前查看参数结构;普通 files.copy 例外
lark-cli drive <resource> <method> [flags] # 调用 API
```

> **重要**:使用原生 API 时,必须先运行 `schema` 查看 `--data` / `--params` 参数结构,不要猜测字段格式。
> **重要**:使用原生 API 时,必须先运行 `schema` 查看 `--data` / `--params` 参数结构,不要猜测字段格式。普通文档、表格、Base、幻灯片和文件复制是例外,按快速决策中的固定参数契约直接使用 `drive files copy`;仅在命令返回结构化参数错误后再查 schema。

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Keep the schema exception scope consistent.

Line 163 marks only files.copy as a schema exception. Line 167 also exempts ordinary documents, sheets, Base, and slides, but it does not define fixed parameter contracts for those operations. Agents may skip schema and guess --data or --params, causing invalid native API requests.

If only copy is intended, limit the exception to drive files copy. Otherwise, document each additional fixed contract and update line 163 to match.

Proposed wording
-> **重要**:使用原生 API 时,必须先运行 `schema` 查看 `--data` / `--params` 参数结构,不要猜测字段格式。普通文档、表格、Base、幻灯片和文件复制是例外,按快速决策中的固定参数契约直接使用 `drive files copy`;仅在命令返回结构化参数错误后再查 schema。
+> **重要**:使用原生 API 时,必须先运行 `schema` 查看 `--data` / `--params` 参数结构,不要猜测字段格式。文件复制是例外,按快速决策中的固定参数契约直接使用 `drive files copy`;仅在复制命令返回结构化参数错误后再查 schema。
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
lark-cli schema drive.<resource>.<method> # 原生 API 调用前查看参数结构;普通 files.copy 例外
lark-cli drive <resource> <method> [flags] # 调用 API
```
> **重要**:使用原生 API 时,必须先运行 `schema` 查看 `--data` / `--params` 参数结构,不要猜测字段格式。
> **重要**:使用原生 API 时,必须先运行 `schema` 查看 `--data` / `--params` 参数结构,不要猜测字段格式。普通文档、表格、Base、幻灯片和文件复制是例外,按快速决策中的固定参数契约直接使用 `drive files copy`;仅在命令返回结构化参数错误后再查 schema。
lark-cli schema drive.<resource>.<method> # 原生 API 调用前查看参数结构;普通 files.copy 例外
lark-cli drive <resource> <method> [flags] # 调用 API
🤖 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/SKILL.md` around lines 163 - 167, Align the
schema-exception wording in the command usage and the “重要” guidance so only the
explicitly supported `drive files copy` operation bypasses schema lookup. Remove
the unsupported exemptions for ordinary documents, sheets, Base, and slides
unless their fixed parameter contracts are documented and reflected consistently
in the earlier command description.

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.

1 participant