Skip to content

docs(drive): document 30-char query limit for +search - #1560

Merged
fangshuyu-768 merged 1 commit into
mainfrom
docs/drive-search-query-30char-limit
Jul 3, 2026
Merged

docs(drive): document 30-char query limit for +search#1560
fangshuyu-768 merged 1 commit into
mainfrom
docs/drive-search-query-30char-limit

Conversation

@liujinkun2025

@liujinkun2025 liujinkun2025 commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

What

The Search v2 API behind drive +search rejects any --query longer than 30 characters with 99992402 field validation failed. Two important details that were undocumented:

  • The limit is counted by Unicode code point, not bytes — a CJK character counts as 1, same as an ASCII character (30 Chinese chars = 90 bytes still passes; 31 fails).
  • It is a hard error, not a truncation — the request is rejected outright, so callers can't rely on the server silently cutting the query down.

Verified behavior

query runes bytes result
a × 30 30 30 OK
a × 31 31 31 99992402 field validation failed
× 29 29 87 OK
× 30 30 90 OK
× 31 31 93 99992402 field validation failed

Boundary is exactly 30 code points regardless of ASCII vs CJK.

Changes

  • shortcuts/drive/drive_search.go — add the limit to the --query flag description so it shows in drive +search -h.
  • skills/lark-drive/references/lark-drive-search.md — add the constraint to the key-constraints block and the --query parameter table, with guidance to compress long queries into core entity + topic terms instead of pasting whole sentences.

Docs/help-text only; no behavior change.

Summary by CodeRabbit

  • Documentation
    • Clarified the drive +search and --query guidance with a hard 30 Unicode code point limit.
    • Added the server-side validation behavior for overlong queries, including the relevant error code.
    • Noted that queries exceeding the limit are rejected rather than truncated.

The Search v2 API rejects queries longer than 30 characters (counted by
Unicode code point, CJK 1 each) with 99992402 field validation failed —
it is a hard error, not truncation. Surface this in the --query -h help
text and the lark-drive search skill so callers compress long queries
before searching instead of hitting the error.

Change-Id: Ieb30a66edae7a573690c49719627ec8fb2500a1a
@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 Jun 24, 2026
@coderabbitai

coderabbitai Bot commented Jun 24, 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

Run ID: 0b551714-0d7d-4763-92b8-92a0e3a76d5d

📥 Commits

Reviewing files that changed from the base of the PR and between b46e60c and c39b293.

📒 Files selected for processing (2)
  • shortcuts/drive/drive_search.go
  • skills/lark-drive/references/lark-drive-search.md

📝 Walkthrough

Walkthrough

The --query flag description in DriveSearch command definition and the lark-drive-search.md reference documentation are updated to document that queries exceeding 30 Unicode code points are rejected by the server with error code 99992402 (field validation failed) and are not truncated.

Changes

drive +search --query length constraint

Layer / File(s) Summary
--query 30-char limit in CLI flag and reference docs
shortcuts/drive/drive_search.go, skills/lark-drive/references/lark-drive-search.md
The query flag metadata in the Go command definition and both the constraint note and parameter description in the Markdown reference doc are updated to state the 30 Unicode code point server limit and the 99992402 field validation failed error when exceeded.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • larksuite/cli#864: Updates --query usage guidance in the same lark-drive-search.md reference doc, making it directly adjacent to this PR's changes.
  • larksuite/cli#951: Modifies both shortcuts/drive/drive_search.go and skills/lark-drive/references/lark-drive-search.md for drive +search behavior, the same two files changed here.

Suggested labels

documentation, size/M

Suggested reviewers

  • SunPeiYang996
  • fangshuyu-768

Poem

🐇 Thirty code points, not a whisker more,
The server says "stop" at that magic door.
No silent trim, no sneaky chop in store —
Error 99992402 guards the floor.
The docs now tell the tale, forevermore! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the docs update and the 30-character +search query limit, matching the main change.
Description check ✅ Passed It covers the motivation, constraints, changes, and verified behavior, though the template headings and Related Issues section are not followed exactly.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/drive-search-query-30char-limit

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

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

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

🧩 Skill update

npx skills add larksuite/cli#docs/drive-search-query-30char-limit -y -g

@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1560   +/-   ##
=======================================
  Coverage   74.04%   74.05%           
=======================================
  Files         787      788    +1     
  Lines       76353    76366   +13     
=======================================
+ Hits        56534    56550   +16     
+ Misses      15572    15570    -2     
+ Partials     4247     4246    -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.

@fangshuyu-768
fangshuyu-768 merged commit cccf025 into main Jul 3, 2026
25 checks passed
@fangshuyu-768
fangshuyu-768 deleted the docs/drive-search-query-30char-limit branch July 3, 2026 03:39
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.

2 participants