Skip to content

fix(skills): align skill guidance with the typed error contract#1786

Merged
evandance merged 1 commit into
mainfrom
fix/skills-typed-error-contract
Jul 14, 2026
Merged

fix(skills): align skill guidance with the typed error contract#1786
evandance merged 1 commit into
mainfrom
fix/skills-typed-error-contract

Conversation

@evandance

@evandance evandance commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

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

  • Updated permission, confirmation, duplicate-remote, and partial-failure guidance to match typed envelopes (missing_scopes, type=confirmation / subtype=confirmation_required with flat risk / action, typed validation envelopes with params[], and stdout ok:false partial results).
  • Replaced retired {code,msg} success guidance in Slides, Base dashboard, and VC meeting-leave docs with the ok / identity / data envelope the CLI actually emits.
  • Updated Minutes recovery guidance to branch on error.subtype instead of retired error.type values.
  • Clarified Slides replace failures: typed stderr envelope and non-zero exit, with no raw backend response printed to stdout.

Test Plan

  • make unit-test passes locally on the rebased PR head (Go 1.23.10).
  • go vet ./...
  • node scripts/skill-format-check/index.js
  • bash scripts/check-skill-wire-vocab.sh
  • All json fences in changed Markdown files parse as JSON.
  • Added-line scans for retired envelope terms and sensitive material; no problematic additions found.
  • Confirmation envelope wire shape (type=confirmation, subtype=confirmation_required, flat risk / action) matches the pins in errs/marshal_test.go.

Related Issues

  • None

Summary by CodeRabbit

  • Documentation
    • Refreshed CLI JSON success/error examples and error-matching guidance across drive, minutes, slides, and shared workflows.
  • Bug Fixes
    • Updated missing-scope and permission-denied indicators (e.g., missing_scopes, permission_denied) and aligned high-risk confirmation prompt schemas.
    • Clarified duplicate path conflict handling, partial/failed result envelopes (stdout), and non-zero exit behavior.

@github-actions github-actions Bot added domain/base PR touches the base domain domain/ccm PR touches the ccm domain size/L Large or sensitive change across domains or core paths labels Jul 7, 2026
@coderabbitai

coderabbitai Bot commented Jul 7, 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-cli documentation to match revised CLI contracts: missing_scopes replaces permission_violations, responses use ok/identity, Drive conflicts use typed validation errors, partial failures use ok:false stdout envelopes, and Minutes/confirmation checks use typed fields.

Changes

CLI documentation contract alignment

Layer / File(s) Summary
Missing-scope field rename
skills/lark-apps/..., skills/lark-base/SKILL.md, skills/lark-shared/SKILL.md, skills/lark-vc-agent/SKILL.md
Replaces permission_violations with missing_scopes in permission and fallback guidance.
Shared confirmation envelope
skills/lark-shared/SKILL.md
Updates exit-10 confirmation examples and matching guidance to the typed confirmation schema.
Minutes error matching
skills/lark-minutes/...
Uses error.subtype and error.missing_scopes for edit, scope, and transcript replacement cases.
Drive failure and conflict contracts
skills/lark-drive/references/..., tests/cli_e2e/drive/coverage.md
Documents ok:false partial failures and validation/failed_precondition duplicate-path errors with error.params[].
Standard success response envelopes
skills/lark-slides/references/..., skills/lark-base/references/lark-base-dashboard-block-get-data.md
Replaces code/msg or OpenAPI wrappers with {ok, identity, data} examples.
Slide replacement failure output
skills/lark-slides/references/lark-slides-xml-presentation-slide-replace.md
Documents typed stderr failures and removes obsolete failing-part fields.

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

Possibly related PRs

Suggested labels: documentation

Suggested reviewers: wittam-01, zhaoleibd, zhouyue-bytedance

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the docs-only change to align skill guidance with the typed error contract.
Description check ✅ Passed The description matches the required template and includes summary, changes, test plan, and related issues.
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
  • Commit unit tests in branch fix/skills-typed-error-contract

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.

@evandance
evandance force-pushed the fix/skills-typed-error-contract branch from e20db5a to d4472a1 Compare July 7, 2026 13:46
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

npm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@293c79063a2a8dbb6d61bb358a357daa02f7a84e

🧩 Skill update

npx skills add larksuite/cli#fix/skills-typed-error-contract -y -g

@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.66%. Comparing base (1c36744) to head (293c790).
⚠️ Report is 1 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

📥 Commits

Reviewing files that changed from the base of the PR and between f495cbb and d4472a1.

📒 Files selected for processing (20)
  • skills/lark-apps/references/lark-apps-openapi-key.md
  • skills/lark-base/SKILL.md
  • skills/lark-base/references/lark-base-dashboard-block-get-data.md
  • skills/lark-base/references/lark-base-data-query.md
  • skills/lark-drive/references/lark-drive-member-add.md
  • skills/lark-drive/references/lark-drive-pull.md
  • skills/lark-drive/references/lark-drive-push.md
  • skills/lark-drive/references/lark-drive-status.md
  • skills/lark-minutes/SKILL.md
  • skills/lark-minutes/references/lark-minutes-todo.md
  • skills/lark-shared/SKILL.md
  • skills/lark-slides/references/examples.md
  • skills/lark-slides/references/lark-slides-screenshot.md
  • skills/lark-slides/references/lark-slides-xml-presentation-slide-create.md
  • skills/lark-slides/references/lark-slides-xml-presentation-slide-delete.md
  • skills/lark-slides/references/lark-slides-xml-presentation-slide-get.md
  • skills/lark-slides/references/lark-slides-xml-presentation-slide-replace.md
  • skills/lark-slides/references/lark-slides-xml-presentations-get.md
  • skills/lark-vc-agent/SKILL.md
  • tests/cli_e2e/drive/coverage.md

Comment thread skills/lark-slides/references/lark-slides-xml-presentation-slide-replace.md Outdated
@evandance
evandance force-pushed the fix/skills-typed-error-contract branch 3 times, most recently from b28b848 to a3faf36 Compare July 9, 2026 11:40

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

📥 Commits

Reviewing files that changed from the base of the PR and between b28b848 and a3faf36.

📒 Files selected for processing (18)
  • skills/lark-apps/references/lark-apps-openapi-key.md
  • skills/lark-base/SKILL.md
  • skills/lark-drive/references/lark-drive-member-add.md
  • skills/lark-drive/references/lark-drive-pull.md
  • skills/lark-drive/references/lark-drive-push.md
  • skills/lark-drive/references/lark-drive-status.md
  • skills/lark-minutes/SKILL.md
  • skills/lark-minutes/references/lark-minutes-todo.md
  • skills/lark-shared/SKILL.md
  • skills/lark-slides/references/examples.md
  • skills/lark-slides/references/lark-slides-screenshot.md
  • skills/lark-slides/references/lark-slides-xml-presentation-slide-create.md
  • skills/lark-slides/references/lark-slides-xml-presentation-slide-delete.md
  • skills/lark-slides/references/lark-slides-xml-presentation-slide-get.md
  • skills/lark-slides/references/lark-slides-xml-presentation-slide-replace.md
  • skills/lark-slides/references/lark-slides-xml-presentations-get.md
  • skills/lark-vc-agent/SKILL.md
  • tests/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

Comment thread skills/lark-vc-agent/SKILL.md
@evandance
evandance force-pushed the fix/skills-typed-error-contract branch 2 times, most recently from 9ce50d3 to 13e126f Compare July 14, 2026 09:53
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
@evandance
evandance force-pushed the fix/skills-typed-error-contract branch from 13e126f to 293c790 Compare July 14, 2026 11:28
@evandance
evandance merged commit 6ecbfaf into main Jul 14, 2026
34 of 36 checks passed
@evandance
evandance deleted the fix/skills-typed-error-contract branch July 14, 2026 13:05
@liangshuo-1 liangshuo-1 mentioned this pull request Jul 15, 2026
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain/base PR touches the base domain domain/ccm PR touches the ccm domain size/L Large or sensitive change across domains or core paths

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants