Skip to content

fix(wiki): clarify resource permission recovery - #2281

Merged
fangshuyu-768 merged 1 commit into
mainfrom
fix/wiki-permission-error-handling
Aug 11, 2026
Merged

fix(wiki): clarify resource permission recovery#2281
fangshuyu-768 merged 1 commit into
mainfrom
fix/wiki-permission-error-handling

Conversation

@liujinkun2025

@liujinkun2025 liujinkun2025 commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

Clarify recovery guidance for Wiki 131006 failures so agents treat them as resource-access errors instead of app-scope authorization failures. The change keeps the existing non-retryable classification and avoids branching on normalized upstream message text.

Changes

  • Add shared resource-permission recovery guidance for wiki +node-get and wiki +node-list.
  • Remove misleading app-scope advice and explicitly discourage same-request retries, reauthorization, and identity trial-and-error.
  • Document 131006 behavior in the command references and add regression coverage.

Test Plan

  • go test ./shortcuts/wiki/...
  • node scripts/skill-format-check/index.js
  • git diff --check

Related Issues

  • None

Summary by CodeRabbit

  • Bug Fixes

    • Improved Wiki permission-error handling for node retrieval and listing.
    • Permission-denied errors are clearly identified as non-retryable.
    • Recovery guidance directs users to request access to the relevant Wiki space or node.
  • Documentation

    • Clarified the difference between resource access issues and app authorization problems.
    • Added guidance not to retry, reauthorize, or switch identities for these errors.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a259c791-0d43-47e4-86a1-f6a30fce0356

📥 Commits

Reviewing files that changed from the base of the PR and between 93f245e and f3b6967.

📒 Files selected for processing (1)
  • shortcuts/wiki/wiki_node_get_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • shortcuts/wiki/wiki_node_get_test.go

📝 Walkthrough

Walkthrough

Wiki node get and list commands now classify API error 131006 as a non-retryable permission error. They provide shared guidance to obtain node or space access. Tests and references cover user and bot identities.

Changes

Wiki permission error handling

Layer / File(s) Summary
Permission classification and guidance
shortcuts/wiki/wiki_helpers.go, shortcuts/wiki/wiki_node_get.go, shortcuts/wiki/wiki_node_list.go, skills/lark-wiki/references/*
Error 131006 is classified as non-retryable. Node and space access guidance uses a shared hint and updated reference documentation.
Behavior validation
shortcuts/wiki/wiki_list_copy_test.go, shortcuts/wiki/wiki_node_get_test.go
Tests verify error classification, preserved authorization metadata and causes, non-retryable behavior, and resource-access guidance for user and bot identities.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • larksuite/cli#2193: Both PRs modify Wiki node-list error classification and recovery guidance.
  • larksuite/cli#2266: Both PRs modify wikiNodeGetProblem and its tests for non-retryable Wiki errors.

Suggested labels: bug

Suggested reviewers: fangshuyu-768

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the Wiki permission recovery guidance change, which is the main focus of the pull request.
Description check ✅ Passed The description includes all required sections and clearly explains the changes and completed tests; manual local verification is not listed.
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 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/wiki-permission-error-handling

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 11, 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: 2

🤖 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 `@shortcuts/wiki/wiki_list_copy_test.go`:
- Around line 284-306: The tests must verify the complete typed-error contract,
including metadata and cause preservation. In
shortcuts/wiki/wiki_list_copy_test.go:284-306, create the input permission error
with a sentinel cause, then assert errors.Is(got, cause) and validate the
expected Category, Subtype, and Code alongside the existing retry and hint
checks. In shortcuts/wiki/wiki_node_get_test.go:490-529, add an assertion that
the mounted command’s returned error preserves the underlying API error cause;
no other changes are required there.

In `@skills/lark-wiki/references/lark-wiki-node-list.md`:
- Line 90: Update the permission_denied guidance in the node-list documentation
to use the generic recovery action from wikiPermissionDeniedHint, without
branching on or relying on the upstream error message. Tell users to ask the
resource owner or Wiki administrator to grant read access, or use an accessible
resource, while preserving the terminal no-retry and no-identity-switch
behavior.
🪄 Autofix

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: eeb330fa-7458-4d1a-aec3-3fa04690f47c

📥 Commits

Reviewing files that changed from the base of the PR and between d289566 and ff3ead5.

📒 Files selected for processing (7)
  • shortcuts/wiki/wiki_helpers.go
  • shortcuts/wiki/wiki_list_copy_test.go
  • shortcuts/wiki/wiki_node_get.go
  • shortcuts/wiki/wiki_node_get_test.go
  • shortcuts/wiki/wiki_node_list.go
  • skills/lark-wiki/references/lark-wiki-node-get.md
  • skills/lark-wiki/references/lark-wiki-node-list.md

Comment thread shortcuts/wiki/wiki_list_copy_test.go
Comment thread skills/lark-wiki/references/lark-wiki-node-list.md Outdated
@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

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

🧩 Skill update

npx skills add larksuite/cli#fix/wiki-permission-error-handling -y -g

@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 76.46%. Comparing base (d289566) to head (f3b6967).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
shortcuts/wiki/wiki_node_list.go 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2281      +/-   ##
==========================================
+ Coverage   76.44%   76.46%   +0.01%     
==========================================
  Files        1013     1013              
  Lines      111972   112037      +65     
==========================================
+ Hits        85601    85666      +65     
+ Misses      19860    19859       -1     
- Partials     6511     6512       +1     

☔ 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 `@shortcuts/wiki/wiki_node_get_test.go`:
- Around line 534-537: Strengthen the 131006 regression fixture by replacing the
permission message and cause with neutral strings, ensuring classification
relies on structured metadata rather than message matching. Update the hint
assertion near the existing check to require the complete shared hint or
explicitly assert that the exact legacy app-scope authorization recommendation
is absent, without rejecting the intentional generic “app scope” wording.
🪄 Autofix

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: ddeb7c18-fea3-4f8a-8f56-63364354fb6e

📥 Commits

Reviewing files that changed from the base of the PR and between ff3ead5 and 93f245e.

📒 Files selected for processing (3)
  • shortcuts/wiki/wiki_list_copy_test.go
  • shortcuts/wiki/wiki_node_get_test.go
  • skills/lark-wiki/references/lark-wiki-node-list.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • skills/lark-wiki/references/lark-wiki-node-list.md
  • shortcuts/wiki/wiki_list_copy_test.go

Comment thread shortcuts/wiki/wiki_node_get_test.go Outdated
@liujinkun2025
liujinkun2025 force-pushed the fix/wiki-permission-error-handling branch from 24659b5 to f3b6967 Compare August 11, 2026 06:32

@fangshuyu-768 fangshuyu-768 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed the Wiki 131006 permission recovery changes. The typed error contract, resource-access guidance, tests, and documentation are consistent with the API semantics. No actionable findings.

@fangshuyu-768
fangshuyu-768 merged commit b1167a1 into main Aug 11, 2026
26 checks passed
@fangshuyu-768
fangshuyu-768 deleted the fix/wiki-permission-error-handling branch August 11, 2026 07:05
@liangshuo-1 liangshuo-1 mentioned this pull request Aug 11, 2026
3 tasks
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.

2 participants