fix(skills): align skill guidance with the typed error contract#1786
Conversation
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis PR updates lark-cli documentation to match revised CLI contracts: ChangesCLI documentation contract alignment
Estimated code review effort: 2 (Simple) | ~12 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
e20db5a to
d4472a1
Compare
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@293c79063a2a8dbb6d61bb358a357daa02f7a84e🧩 Skill updatenpx skills add larksuite/cli#fix/skills-typed-error-contract -y -g |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1786 +/- ##
=======================================
Coverage 74.66% 74.66%
=======================================
Files 877 877
Lines 91731 91731
=======================================
Hits 68494 68494
Misses 17926 17926
Partials 5311 5311 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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-slides/references/lark-slides-xml-presentation-slide-replace.md`:
- Around line 159-164: The response-field table is missing the documented
error.message field, so update the table in the slide-replace reference to
include a row for error.message alongside error.code, error.subtype, and
error.hint. Keep the wording consistent with the existing typed-envelope
contract and failure example so the schema docs stay aligned.
🪄 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: 0e0e70c4-7858-464a-b5c7-38c68dd4dcd2
📒 Files selected for processing (20)
skills/lark-apps/references/lark-apps-openapi-key.mdskills/lark-base/SKILL.mdskills/lark-base/references/lark-base-dashboard-block-get-data.mdskills/lark-base/references/lark-base-data-query.mdskills/lark-drive/references/lark-drive-member-add.mdskills/lark-drive/references/lark-drive-pull.mdskills/lark-drive/references/lark-drive-push.mdskills/lark-drive/references/lark-drive-status.mdskills/lark-minutes/SKILL.mdskills/lark-minutes/references/lark-minutes-todo.mdskills/lark-shared/SKILL.mdskills/lark-slides/references/examples.mdskills/lark-slides/references/lark-slides-screenshot.mdskills/lark-slides/references/lark-slides-xml-presentation-slide-create.mdskills/lark-slides/references/lark-slides-xml-presentation-slide-delete.mdskills/lark-slides/references/lark-slides-xml-presentation-slide-get.mdskills/lark-slides/references/lark-slides-xml-presentation-slide-replace.mdskills/lark-slides/references/lark-slides-xml-presentations-get.mdskills/lark-vc-agent/SKILL.mdtests/cli_e2e/drive/coverage.md
b28b848 to
a3faf36
Compare
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-vc-agent/SKILL.md`:
- Line 21: The scope-error handling in the skill guide is conflating `missing
required scope(s)` / `missing_scopes` with the graylist path. Update the
guidance near the `lark-cli` error handling so `missing_scopes` goes directly to
the “应用身份权限配置检查” flow for app permissions, installation, and data scope, and
keep the early-bird group step reserved only for the graylist case
(`ErrNotInGray` / `20017`).
🪄 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: f310e04d-0766-4fb6-b966-062725b97e0b
📒 Files selected for processing (18)
skills/lark-apps/references/lark-apps-openapi-key.mdskills/lark-base/SKILL.mdskills/lark-drive/references/lark-drive-member-add.mdskills/lark-drive/references/lark-drive-pull.mdskills/lark-drive/references/lark-drive-push.mdskills/lark-drive/references/lark-drive-status.mdskills/lark-minutes/SKILL.mdskills/lark-minutes/references/lark-minutes-todo.mdskills/lark-shared/SKILL.mdskills/lark-slides/references/examples.mdskills/lark-slides/references/lark-slides-screenshot.mdskills/lark-slides/references/lark-slides-xml-presentation-slide-create.mdskills/lark-slides/references/lark-slides-xml-presentation-slide-delete.mdskills/lark-slides/references/lark-slides-xml-presentation-slide-get.mdskills/lark-slides/references/lark-slides-xml-presentation-slide-replace.mdskills/lark-slides/references/lark-slides-xml-presentations-get.mdskills/lark-vc-agent/SKILL.mdtests/cli_e2e/drive/coverage.md
✅ Files skipped from review due to trivial changes (12)
- skills/lark-apps/references/lark-apps-openapi-key.md
- skills/lark-base/SKILL.md
- skills/lark-slides/references/lark-slides-xml-presentation-slide-create.md
- tests/cli_e2e/drive/coverage.md
- skills/lark-slides/references/lark-slides-xml-presentation-slide-delete.md
- skills/lark-minutes/references/lark-minutes-todo.md
- skills/lark-slides/references/lark-slides-xml-presentations-get.md
- skills/lark-drive/references/lark-drive-push.md
- skills/lark-slides/references/lark-slides-screenshot.md
- skills/lark-drive/references/lark-drive-member-add.md
- skills/lark-slides/references/examples.md
- skills/lark-slides/references/lark-slides-xml-presentation-slide-replace.md
🚧 Files skipped from review as they are similar to previous changes (4)
- skills/lark-drive/references/lark-drive-pull.md
- skills/lark-slides/references/lark-slides-xml-presentation-slide-get.md
- skills/lark-shared/SKILL.md
- skills/lark-drive/references/lark-drive-status.md
9ce50d3 to
13e126f
Compare
Skill references written before the typed-error refactor still taught retired envelope shapes. AI agents following them now read what the CLI actually emits:
- permission recovery reads error.missing_scopes instead of the upstream permission_violations detail
- confirmation gates use type=confirmation, subtype=confirmation_required, and flat risk/action fields
- drive duplicate-remote failures are typed validation envelopes (failed_precondition with params[]), not duplicate_remote_path with error.detail
- drive batch partial failures are ok:false results on stdout, not an error.type=partial_failure stderr envelope
- minutes edit-permission and word-replace misses branch on error.subtype, not retired error.type values
- slides replace failures are stderr typed envelopes only; no raw backend response is printed to stdout
- slides command outputs show the ok/identity/data success envelope instead of the raw {code,msg} OpenAPI wrapper
13e126f to
293c790
Compare
Summary
Align skill/reference guidance with the current typed error contract so agents do not follow retired raw OpenAPI or legacy envelope shapes. This is a docs-only fix scoped to error-contract corrections; sections that document upstream API responses are left unchanged.
Changes
missing_scopes,type=confirmation/subtype=confirmation_requiredwith flatrisk/action, typed validation envelopes withparams[], and stdoutok:falsepartial results).{code,msg}success guidance in Slides, Base dashboard, and VC meeting-leave docs with theok/identity/dataenvelope the CLI actually emits.error.subtypeinstead of retirederror.typevalues.Test Plan
make unit-testpasses locally on the rebased PR head (Go 1.23.10).go vet ./...node scripts/skill-format-check/index.jsbash scripts/check-skill-wire-vocab.shjsonfences in changed Markdown files parse as JSON.type=confirmation,subtype=confirmation_required, flatrisk/action) matches the pins inerrs/marshal_test.go.Related Issues
Summary by CodeRabbit
missing_scopes,permission_denied) and aligned high-risk confirmation prompt schemas.