feat(drive): optimize copy and search guidance - #2159
Conversation
📝 WalkthroughWalkthroughChangesDrive 技能指引
Estimated code review effort: 1 (Trivial) | ~5 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (1)
skills/lark-drive/SKILL.md
| 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。 |
There was a problem hiding this comment.
🎯 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.
| 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.
Summary
Refine lark-drive skill guidance for Drive copy, search, and authentication handling.
Changes
drive files copyusage, strict source-title matching, explicit destination folder handling, and returned-token reuse for copy editing flows.drive +search --queryas the title lookup path and markdrive files copyas the fixed-parameter exception to the schema-first native API guidance.Test Plan
git diff --checkRelated Issues
Auto research task: 01KYVM5CMVBXCSZWETFR6Y4VAQ
Summary by CodeRabbit
+search,并规范重复结果处理。