fix(skills): align skill guidance with the typed error contract#1786
fix(skills): align skill guidance with the typed error contract#1786evandance wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughThis PR updates documentation across multiple lark-cli skill reference files to align with a revised CLI error/response contract: ChangesCLI documentation contract alignment
Estimated code review effort: 2 (Simple) | ~12 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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@a3faf36809c6dba6564f34f16bdc893d383e3ada🧩 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.44% 74.44%
=======================================
Files 860 860
Lines 89855 89859 +4
=======================================
+ Hits 66891 66897 +6
+ Misses 17780 17778 -2
Partials 5184 5184 ☔ 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
c5e73f9 to
b28b848
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
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
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-envelope examples in Slides docs with theok/identity/dataenvelope the CLI actually emits.error.subtypeinstead of retirederror.typevalues.Test Plan
go test ./...passes locally on the PR head.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