Skip to content

Improve agent-facing error guidance for drive, markdown, and wiki#1779

Merged
liangshuo-1 merged 8 commits into
mainfrom
codex/drive-push-error-guidance
Jul 7, 2026
Merged

Improve agent-facing error guidance for drive, markdown, and wiki#1779
liangshuo-1 merged 8 commits into
mainfrom
codex/drive-push-error-guidance

Conversation

@fangshuyu-768

@fangshuyu-768 fangshuyu-768 commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • improve agent-facing error guidance for high-noise Drive, Markdown, and Wiki shortcut failures
  • classify Drive upload/delete and Wiki list failures into more precise terminal/retryable categories with actionable hints
  • add target URL/token normalization and local validation for markdown +create and wiki +node-list
  • update skill docs so agents stop retrying terminal errors and fix parameters/permissions instead

Context

Failure telemetry showed several repeated agent error patterns:

  • drive +push: missing parent folders and delete-remote already-deleted responses caused noisy hard failures
  • markdown +create: agents mixed folder/wiki/document tokens, retried quota/not-found/server failures without enough guidance
  • wiki +node-list: agents passed wiki URLs, node tokens, document tokens, or stale page tokens where numeric space_id / wiki node_token were required

This PR turns those cases into clearer CLI behavior:

  • terminal parameter/resource/permission failures get explicit recovery hints
  • retryable rate-limit/server failures remain retryable and recommend backoff
  • obvious token/URL mismatches are rejected before calling OpenAPI

Tests

  • go test ./shortcuts/drive ./internal/errclass
  • go test ./shortcuts/drive ./internal/errclass ./internal/qualitygate/skillscan ./internal/skillcontent
  • go test ./shortcuts/wiki ./shortcuts/markdown ./internal/errclass ./internal/qualitygate/skillscan ./internal/skillcontent

Notes

  • A broader run of go test ./internal/qualitygate/... ./internal/skillcontent/... ./shortcuts/drive ./internal/errclass still fails in internal/qualitygate/cmd/manifest-export because the existing command index test cannot find drive file.comments create_v2; the affected packages above pass.

Summary by CodeRabbit

  • New Features
    • drive push, drive pull, and drive sync now stop immediately on terminal errors and report aborted in the summary.
    • markdown +create and wiki/markdown targeting now accept supported folder/wiki URLs and normalize them automatically.
  • Bug Fixes
    • Treats Drive “already deleted” responses (1061007) as idempotent success (action: already_deleted) during --delete-remote.
    • Improves handling when destination parents are missing during Drive upload (adds per-item hints and aborts the run).
    • Enhances wiki +node-list parsing, validation, and error hints (space IDs and parent-node tokens), including stale/invalid cases.

@github-actions github-actions Bot added 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

Drive push, pull, and sync now track abort state explicitly. Drive push also adds per-item hints, treats delete code 1061007 as already_deleted, and updates docs/tests. Markdown and wiki commands now normalize token-or-URL inputs and add targeted error hints with matching docs and tests.

Changes

Drive terminal failure handling and hints

Layer / File(s) Summary
Push item hints and classifier updates
shortcuts/drive/drive_push.go
drivePushItem and driveBatchFailureDecision gain hint support, 1061044 maps to terminal parent_node_missing, and failed push items copy hint and terminal state from the classifier.
Delete-remote already_deleted handling
shortcuts/drive/drive_push.go
1061007 delete responses are recorded as already_deleted and skipped without incrementing failures or aborting the delete loop; terminal-abort detection now uses item terminal state.
Pull and sync terminal flags
shortcuts/drive/drive_pull.go, shortcuts/drive/drive_sync.go
Pull and sync items gain a non-serialized Terminal flag, failed items populate it from classifier decisions, and batch-abort checks read that flag directly.
Tests and push documentation
shortcuts/drive/drive_push_test.go, skills/lark-drive/references/lark-drive-push.md, internal/errclass/codemeta_drive.go, internal/errclass/codemeta_test.go
Adds tests for already_deleted delete handling and parent_node_missing aborts, updates the push reference docs for the expanded JSON schema and failure-handling rules, and adds drive error-code metadata coverage.

Markdown and wiki token handling

Layer / File(s) Summary
Markdown create normalization
shortcuts/markdown/markdown_create.go
markdown +create now reads a normalized spec through shared helpers and accepts folder/wiki targets as tokens or supported URLs before validation and execution.
Markdown error hints and tests
shortcuts/markdown/helpers.go, shortcuts/markdown/markdown_test.go
markdownUploadProblem adds quota, server, and rate-limit hints, and tests cover URL normalization plus the new hint output.
Wiki node-list parsing and hints
shortcuts/wiki/wiki_helpers.go, shortcuts/wiki/wiki_node_list.go
+node-list centralizes spec parsing, normalizes wiki parent tokens, enforces numeric space IDs, and appends targeted hints for selected API failures.
Wiki tests, docs, and errclass data
shortcuts/wiki/wiki_list_copy_test.go, internal/errclass/codemeta_wiki.go, skills/lark-markdown/SKILL.md, skills/lark-markdown/references/lark-markdown-create.md, skills/lark-wiki/SKILL.md, skills/lark-wiki/references/lark-wiki-node-list.md
Updates wiki node-list fixtures and assertions for numeric space IDs, adds wiki code metadata, and revises markdown/wiki skill and reference docs for the new URL and error-handling behavior.

Estimated code review effort: 5 (Critical) | ~90 minutes

Sequence Diagram(s)

sequenceDiagram
  participant drivePush as drivePush
  participant driveClassifyBatchFailure as driveClassifyBatchFailure
  participant DriveAPI as DriveAPI
  DriveAPI-->>drivePush: upload_all error
  drivePush->>driveClassifyBatchFailure: classify problem code
  driveClassifyBatchFailure-->>drivePush: decision{Terminal, Hint, ErrorClass}
  drivePush->>drivePush: store hint and terminal on failed item
  DriveAPI-->>drivePush: DELETE error 1061007
  drivePush->>drivePush: append already_deleted item and continue
Loading
sequenceDiagram
  participant User as User
  participant WikiNodeList as WikiNodeList
  participant WikiAPI as WikiAPI
  User->>WikiNodeList: --space-id and --parent-node-token
  WikiNodeList->>WikiNodeList: readWikiNodeListSpec
  WikiNodeList->>WikiAPI: fetchWikiNodes(space_id, parent_node_token)
  WikiAPI-->>WikiNodeList: API error
  WikiNodeList->>WikiNodeList: wikiNodeListProblem appends hint
Loading

Possibly related PRs

  • larksuite/cli#392: Both PRs touch the wiki +node-list feature and its --space-id / --parent-node-token handling.
  • larksuite/cli#704: This PR extends the markdown upload failure-hinting path introduced there.
  • larksuite/cli#709: This PR extends the same drive +push flow and per-item failure handling.

Suggested labels: feature

Suggested reviewers: wittam-01, SunPeiYang996

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the PR’s main theme of improving agent-facing error guidance across Drive, Markdown, and Wiki.
Description check ✅ Passed The description is mostly complete and covers Summary, Changes, and Tests, but it lacks an explicit Related Issues section.
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 codex/drive-push-error-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.

@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

🧹 Nitpick comments (1)
shortcuts/drive/drive_push.go (1)

590-638: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Terminal-ness duplicated across two independent switches.

driveClassifyBatchFailure sets decision.Terminal per-case (Line 625), and driveTerminalBatchErrorClass independently re-derives terminality from the string ErrorClass (Line 656) for use in drivePushHasTerminalFailure. Adding parent_node_missing requires keeping both switches in sync by hand; a future new terminal class could easily update one and miss the other, silently making aborted/loop-break behavior diverge from the per-item Terminal flag returned by drivePushFailedItem. This is a pre-existing pattern, not introduced by this diff, but it's growing with each new class.

Consider deriving driveTerminalBatchErrorClass from a single source of truth (e.g., look up terminality from a class→bool map that driveClassifyBatchFailure also populates from), or store Terminal directly in drivePushItem instead of re-inferring it from ErrorClass strings later.

Also applies to: 654-661

🤖 Prompt for 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.

In `@shortcuts/drive/drive_push.go` around lines 590 - 638,
`driveClassifyBatchFailure` and `driveTerminalBatchErrorClass` are duplicating
terminal-state logic, so keep terminality in a single source of truth. Update
the batching flow around `driveClassifyBatchFailure`,
`driveTerminalBatchErrorClass`, and `drivePushHasTerminalFailure` so
terminal-ness is derived consistently from one shared mapping or from the stored
failure decision itself, rather than re-inferring it from `ErrorClass` strings
in a separate switch. This will prevent future classes like
`parent_node_missing` from getting out of sync between per-item failure handling
and abort/loop-break behavior.
🤖 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-drive/references/lark-drive-push.md`:
- Around line 122-125: The delete_failed example is missing the structured
failure fields that the guidance now expects. Update the example near
drivePushFailedItem so the delete failure shape mirrors the other failure
entries by including the same structured fields used for failures, such as
error_class, phase, code, subtype, retryable, and any relevant hints, instead of
only showing error.
- Around line 114-116: The summary schema table is missing the new aborted field
even though the example already exposes summary.aborted. Update the schema
documentation in the lark-drive-push reference so the summary section includes
aborted alongside uploaded, skipped, failed, and deleted_remote, keeping the
table and example in sync.

---

Nitpick comments:
In `@shortcuts/drive/drive_push.go`:
- Around line 590-638: `driveClassifyBatchFailure` and
`driveTerminalBatchErrorClass` are duplicating terminal-state logic, so keep
terminality in a single source of truth. Update the batching flow around
`driveClassifyBatchFailure`, `driveTerminalBatchErrorClass`, and
`drivePushHasTerminalFailure` so terminal-ness is derived consistently from one
shared mapping or from the stored failure decision itself, rather than
re-inferring it from `ErrorClass` strings in a separate switch. This will
prevent future classes like `parent_node_missing` from getting out of sync
between per-item failure handling and abort/loop-break behavior.
🪄 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: 3d216c95-bda8-4e10-8d1a-8fd534652c2a

📥 Commits

Reviewing files that changed from the base of the PR and between f0b6f35 and be0b70b.

📒 Files selected for processing (3)
  • shortcuts/drive/drive_push.go
  • shortcuts/drive/drive_push_test.go
  • skills/lark-drive/references/lark-drive-push.md

Comment thread skills/lark-drive/references/lark-drive-push.md
Comment thread skills/lark-drive/references/lark-drive-push.md Outdated
@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 62.68116% with 103 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.40%. Comparing base (f0b6f35) to head (004f8a7).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
shortcuts/wiki/wiki_node_list.go 61.61% 31 Missing and 7 partials ⚠️
shortcuts/markdown/markdown_create.go 68.18% 27 Missing and 8 partials ⚠️
shortcuts/drive/drive_sync.go 23.07% 13 Missing and 7 partials ⚠️
shortcuts/wiki/wiki_helpers.go 44.44% 2 Missing and 3 partials ⚠️
shortcuts/drive/drive_push.go 80.00% 3 Missing and 1 partial ⚠️
shortcuts/drive/drive_pull.go 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1779      +/-   ##
==========================================
- Coverage   74.46%   74.40%   -0.07%     
==========================================
  Files         855      857       +2     
  Lines       88568    88952     +384     
==========================================
+ Hits        65954    66181     +227     
- Misses      17543    17668     +125     
- Partials     5071     5103      +32     

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

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

🧩 Skill update

npx skills add larksuite/cli#codex/drive-push-error-guidance -y -g

wittam-01
wittam-01 previously approved these changes Jul 7, 2026
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
{}

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

PR Quality Summary

CI did not complete successfully. Use the failed check links below to decide whether this PR needs a code change or a rerun.

Failed checks

@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

🧹 Nitpick comments (4)
shortcuts/markdown/markdown_create.go (2)

182-204: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Prefix-based classifier duplicates similar token-shape logic elsewhere.

markdownKnownResourceTokenKind re-implements a heuristic that overlaps with looksLikeWikiNodeToken used in shortcuts/wiki/wiki_node_list.go. Consider centralizing token-kind detection (e.g. in shortcuts/common) so both the markdown and wiki commands share one source of truth for token prefixes, reducing drift risk if prefix conventions change.

🤖 Prompt for 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.

In `@shortcuts/markdown/markdown_create.go` around lines 182 - 204,
`markdownKnownResourceTokenKind` duplicates token-prefix detection logic that
already exists in `looksLikeWikiNodeToken`, so the markdown and wiki paths can
drift. Move the shared token-kind/prefix classification into a common helper
(for example under shortcuts/common) and update both
`markdownKnownResourceTokenKind` and `looksLikeWikiNodeToken` to call that
shared logic so they use one source of truth for token prefixes.

137-180: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Folder/wiki token normalizers are weaker than the parallel wiki implementation.

Compared to shortcuts/wiki/wiki_node_list.go's normalizeWikiNodeListParentToken, these two functions:

  • Don't reject stray URL fragments/paths (strings.ContainsAny(token, "/?#")) for non-:// inputs, so a malformed partial URL (e.g. wiki/wikcnXXX without a scheme) falls through to the prefix heuristic and may be sent to the API as-is, producing an opaque API error instead of a clear CLI validation message.
  • Don't call an equivalent of validateOptionalResourceName on the final token before returning it.

Separately, several of the constructed messages (e.g. "Use --wiki-token for wiki nodes or pass a Drive folder URL/token.") bundle recovery guidance directly into the error message. Per coding guidelines, recovery guidance should live in .WithHint(...), with param/message limited to naming what failed. markdownValidationParamError's implementation isn't in this diff, so it's worth confirming it doesn't collapse hint text into the message field, for consistency with wiki_node_list.go's pattern (which mixes both styles in the same function — see companion comment there).

♻️ Suggested hardening for the missing checks
 func normalizeMarkdownFolderToken(token string) (string, error) {
 	token = strings.TrimSpace(token)
 	if strings.Contains(token, "://") {
 		ref, ok := common.ParseResourceURL(token)
 		...
 		return ref.Token, nil
 	}
+	if strings.ContainsAny(token, "/?#") {
+		return "", markdownValidationParamError("--folder-token", "--folder-token must be a raw Drive folder token, not a partial URL or path")
+	}
 	switch markdownKnownResourceTokenKind(token) {
 	...
 	}
 	return token, nil
 }

Based on coding guidelines, param field in errors should only name the user input that actually failed; recovery guidance goes in .WithHint(...).

🤖 Prompt for 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.

In `@shortcuts/markdown/markdown_create.go` around lines 137 - 180, The token
normalizers in normalizeMarkdownFolderToken and normalizeMarkdownWikiToken are
too permissive compared with normalizeWikiNodeListParentToken, so malformed
non-URL inputs with stray path/query/fragment characters can slip through and
reach the API. Tighten both functions by rejecting tokens containing /, ?, or #
before the token-kind heuristic, and by validating the final normalized token
with the same optional-resource-name check used in the wiki implementation. Also
revise markdownValidationParamError call sites so the error text only names the
failed parameter/value, while recovery guidance is moved into a hint-style field
rather than embedded in the main message.

Source: Coding guidelines

shortcuts/wiki/wiki_helpers.go (1)

9-9: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicate of appendMarkdownProblemHint.

This is a byte-for-byte duplicate of appendMarkdownProblemHint in shortcuts/markdown/helpers.go. Consider moving it to a shared location (e.g. shortcuts/common) so both packages call the same implementation.

♻️ Suggested consolidation
-func appendWikiProblemHint(err error, hint string) error {
-	if strings.TrimSpace(hint) == "" {
-		return err
-	}
-	if p, ok := errs.ProblemOf(err); ok {
-		if strings.TrimSpace(p.Hint) != "" {
-			p.Hint = p.Hint + "\n" + hint
-		} else {
-			p.Hint = hint
-		}
-	}
-	return err
-}
+// use common.AppendProblemHint(err, hint) instead

Also applies to: 31-43

🤖 Prompt for 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.

In `@shortcuts/wiki/wiki_helpers.go` at line 9, The helper in
shortcuts/wiki/wiki_helpers.go is a byte-for-byte duplicate of
appendMarkdownProblemHint in shortcuts/markdown/helpers.go, so consolidate the
shared logic into a common package and have both call the same implementation.
Move the implementation to a shared location such as shortcuts/common, update
appendMarkdownProblemHint and its callers to use the shared function, and remove
the duplicate copy from the wiki helpers while preserving the existing behavior.
shortcuts/wiki/wiki_node_list.go (1)

151-172: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Inconsistent Message/Hint separation for validation errors.

Within these two functions, some branches correctly put recovery guidance in .WithHint(...) (e.g. the "not a numeric wiki space_id" and "not a wiki node token" cases), while sibling branches embed the same kind of guidance directly in the error Message (e.g. "not a URL or path; run lark-cli wiki +space-list --as user..." and "pass a raw wiki node token from wiki +node-get..."/"Resolve the document URL with lark-cli wiki +node-get..."). Per coding guidelines, param field in errors should only name the user input that actually failed; recovery guidance goes in .WithHint(...). Aligning all branches to the pattern already used elsewhere in the same functions would make the resulting Problem.Message/Problem.Hint consistent for downstream consumers/agents parsing structured fields.

♻️ Example fix for one branch
 	if strings.Contains(spaceID, "://") || strings.ContainsAny(spaceID, "/?#") {
 		return errs.NewValidationError(errs.SubtypeInvalidArgument,
-			"--space-id must be a numeric wiki space_id, not a URL or path; run `lark-cli wiki +space-list --as user` to discover space IDs",
-		).WithParam("--space-id")
+			"--space-id must be a numeric wiki space_id, not a URL or path",
+		).WithParam("--space-id").WithHint("Run `lark-cli wiki +space-list --as user` to discover space IDs.")
 	}

Based on coding guidelines, param field in errors should only name the user input that actually failed; recovery guidance goes in .WithHint(...).

Also applies to: 186-219

🤖 Prompt for 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.

In `@shortcuts/wiki/wiki_node_list.go` around lines 151 - 172, The validation
errors in wiki node/space ID checks mix recovery guidance into the error message
instead of keeping it in .WithHint(...), which makes
Problem.Message/Problem.Hint inconsistent. Update validateWikiNodeListSpaceID
and the related validation branches in the same file to keep the Message focused
on the failed input and move any “run lark-cli ...” or “pass ...” guidance into
WithHint, following the pattern already used by the numeric space ID and token
validation paths.

Source: Coding guidelines

🤖 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 134-159: The two error-path tests for WikiNodeList currently
validate only error text, so update TestWikiNodeListRejectsNonNumericSpaceID and
TestWikiNodeListRejectsDocumentURLAsParentNodeToken to assert the structured
problem returned by mountAndRunWiki using errs.ProblemOf instead of
strings.Contains. Check the relevant category/subtype/param metadata and
preserve the cause chain, following the pattern used by
TestWikiNodeListProblemAddsActionableHint so the tests verify typed error
details rather than message substrings.

---

Nitpick comments:
In `@shortcuts/markdown/markdown_create.go`:
- Around line 182-204: `markdownKnownResourceTokenKind` duplicates token-prefix
detection logic that already exists in `looksLikeWikiNodeToken`, so the markdown
and wiki paths can drift. Move the shared token-kind/prefix classification into
a common helper (for example under shortcuts/common) and update both
`markdownKnownResourceTokenKind` and `looksLikeWikiNodeToken` to call that
shared logic so they use one source of truth for token prefixes.
- Around line 137-180: The token normalizers in normalizeMarkdownFolderToken and
normalizeMarkdownWikiToken are too permissive compared with
normalizeWikiNodeListParentToken, so malformed non-URL inputs with stray
path/query/fragment characters can slip through and reach the API. Tighten both
functions by rejecting tokens containing /, ?, or # before the token-kind
heuristic, and by validating the final normalized token with the same
optional-resource-name check used in the wiki implementation. Also revise
markdownValidationParamError call sites so the error text only names the failed
parameter/value, while recovery guidance is moved into a hint-style field rather
than embedded in the main message.

In `@shortcuts/wiki/wiki_helpers.go`:
- Line 9: The helper in shortcuts/wiki/wiki_helpers.go is a byte-for-byte
duplicate of appendMarkdownProblemHint in shortcuts/markdown/helpers.go, so
consolidate the shared logic into a common package and have both call the same
implementation. Move the implementation to a shared location such as
shortcuts/common, update appendMarkdownProblemHint and its callers to use the
shared function, and remove the duplicate copy from the wiki helpers while
preserving the existing behavior.

In `@shortcuts/wiki/wiki_node_list.go`:
- Around line 151-172: The validation errors in wiki node/space ID checks mix
recovery guidance into the error message instead of keeping it in
.WithHint(...), which makes Problem.Message/Problem.Hint inconsistent. Update
validateWikiNodeListSpaceID and the related validation branches in the same file
to keep the Message focused on the failed input and move any “run lark-cli ...”
or “pass ...” guidance into WithHint, following the pattern already used by the
numeric space ID and token validation paths.
🪄 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: ee959ed9-aa00-40c9-a6da-40bbcda739f6

📥 Commits

Reviewing files that changed from the base of the PR and between 2f04f86 and b3e5df3.

📒 Files selected for processing (13)
  • internal/errclass/codemeta_drive.go
  • internal/errclass/codemeta_test.go
  • internal/errclass/codemeta_wiki.go
  • shortcuts/markdown/helpers.go
  • shortcuts/markdown/markdown_create.go
  • shortcuts/markdown/markdown_test.go
  • shortcuts/wiki/wiki_helpers.go
  • shortcuts/wiki/wiki_list_copy_test.go
  • shortcuts/wiki/wiki_node_list.go
  • skills/lark-markdown/SKILL.md
  • skills/lark-markdown/references/lark-markdown-create.md
  • skills/lark-wiki/SKILL.md
  • skills/lark-wiki/references/lark-wiki-node-list.md
✅ Files skipped from review due to trivial changes (1)
  • skills/lark-wiki/SKILL.md

Comment thread shortcuts/wiki/wiki_list_copy_test.go
@fangshuyu-768 fangshuyu-768 changed the title Improve drive push error guidance Improve agent-facing error guidance for drive, markdown, and wiki Jul 7, 2026
@fangshuyu-768
fangshuyu-768 force-pushed the codex/drive-push-error-guidance branch from ee5ea90 to 004f8a7 Compare July 7, 2026 09:32
@liangshuo-1
liangshuo-1 merged commit f98dbfe into main Jul 7, 2026
19 of 22 checks passed
@liangshuo-1
liangshuo-1 deleted the codex/drive-push-error-guidance branch July 7, 2026 10:10
@liangshuo-1 liangshuo-1 mentioned this pull request Jul 7, 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/L Large or sensitive change across domains or core paths

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants