Skip to content

fix(drive): guide wiki permission recovery - #2311

Merged
ViperCai merged 1 commit into
mainfrom
codex/wiki-permission-terminal-guidance
Aug 12, 2026
Merged

fix(drive): guide wiki permission recovery#2311
ViperCai merged 1 commit into
mainfrom
codex/wiki-permission-terminal-guidance

Conversation

@ViperCai

@ViperCai ViperCai commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

When drive +inspect unwraps a Wiki URL and the Wiki API returns code 131006, return terminal resource-access guidance instead of suggesting repeated authorization or identity changes. The fix stays local to the Drive shortcut; shared internal error classification and existing Wiki shortcut behavior are unchanged.

Changes

  • Handle Wiki 131006 only at the drive +inspect Wiki-resolution boundary.
  • Preserve the typed authorization error, code, log ID, and non-retryable semantics while replacing only its recovery hint.
  • Keep the Drive import Wiki probe non-blocking.
  • Add regression coverage for both behaviors.

Test Plan

  • go test ./shortcuts/drive -count=1
  • go vet ./shortcuts/drive
  • gofmt and git diff --check
  • make unit-test — affected packages pass; the full repository run still has unrelated metadata-baseline failures in cmd/schema, internal/affordance, and internal/schema (schema count/high-risk metadata/IM image token metadata).

Related Issues

  • None

Summary by CodeRabbit

  • Bug Fixes
    • Improved Drive wiki resolution errors by clearly identifying permission-denied access issues.
    • Added guidance explaining that these errors are not resolved by retrying or switching accounts.
    • Permission failures during folder checks no longer block valid Drive folder imports.
    • Improved error classification and terminal guidance for authorization failures.

@ViperCai
ViperCai requested a review from liangshuo-1 as a code owner August 12, 2026 04:07
@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 12, 2026
@coderabbitai

coderabbitai Bot commented Aug 12, 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: 225a975d-d491-45c0-bf83-1233152a78db

📥 Commits

Reviewing files that changed from the base of the PR and between 0210f1d and 1e5489f.

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

📝 Walkthrough

Walkthrough

Drive Wiki resolution now gives permission-denied code 131006 specific terminal guidance. Drive import probing remains non-blocking when the Wiki folder-token request lacks permission. Regression tests cover both behaviors.

Changes

Wiki permission recovery

Layer / File(s) Summary
Centralized Wiki recovery classification
shortcuts/drive/drive_inspect.go
Wiki node resolution uses a dedicated annotator. Code 131006 receives access-specific, non-retryable guidance.
Permission recovery regression coverage
shortcuts/drive/drive_inspect_test.go, shortcuts/drive/drive_import_common_test.go
Tests verify typed authorization metadata, code 131006, non-retryability, terminal guidance, and non-blocking Drive folder-token imports.

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

Possibly related PRs

  • larksuite/cli#2281: Addresses Wiki 131006 permission-denied handling and recovery guidance.
  • larksuite/cli#2290: Adds command-specific handling for non-retryable Lark Wiki API errors with a different error code.

Suggested reviewers: liangshuo-1

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the Drive Wiki permission recovery guidance change.
Description check ✅ Passed The description includes all required sections and clearly documents the change, tests, and known full-suite limitations.
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 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/wiki-permission-terminal-guidance

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 commented Aug 12, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

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

🧩 Skill update

npx skills add larksuite/cli#codex/wiki-permission-terminal-guidance -y -g

@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.67%. Comparing base (a80c810) to head (1e5489f).
⚠️ Report is 14 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2311      +/-   ##
==========================================
- Coverage   76.47%   74.67%   -1.80%     
==========================================
  Files        1013     1025      +12     
  Lines      112079   137429   +25350     
==========================================
+ Hits        85707   102624   +16917     
- Misses      19859    28134    +8275     
- Partials     6513     6671     +158     

☔ 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.

liujinkun2025
liujinkun2025 previously approved these changes Aug 12, 2026
@ViperCai
ViperCai force-pushed the codex/wiki-permission-terminal-guidance branch from 0210f1d to 1e5489f Compare August 12, 2026 08:03
@ViperCai ViperCai changed the title fix(wiki): reuse terminal permission guidance fix(drive): guide wiki permission recovery Aug 12, 2026
@ViperCai
ViperCai merged commit 52ab2ea into main Aug 12, 2026
29 of 56 checks passed
@ViperCai
ViperCai deleted the codex/wiki-permission-terminal-guidance branch August 12, 2026 08:33
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.

3 participants