Skip to content

feat: surface search API notices#1413

Open
arnold9672 wants to merge 1 commit into
larksuite:mainfrom
arnold9672:feat/search-notice-passthrough
Open

feat: surface search API notices#1413
arnold9672 wants to merge 1 commit into
larksuite:mainfrom
arnold9672:feat/search-notice-passthrough

Conversation

@arnold9672

@arnold9672 arnold9672 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

sa: safe
doc: none
cfg: none
test: unit test

Summary

Surface search API notice strings in CLI output so agents can see server-side search hints such as query truncation.

Changes

  • Pass through data.notice for search shortcuts that rebuild output across contact, docs, drive, IM, mail, minutes, task, and VC.
  • Preserve the first non-empty notice for paginated search flows, and include per-query notices for contact fanout output.
  • Add shortcut tests covering notice passthrough for the affected search domains.

Test Plan

  • go test -count=1 ./shortcuts/contact ./shortcuts/doc ./shortcuts/drive ./shortcuts/im ./shortcuts/mail ./shortcuts/minutes ./shortcuts/task ./shortcuts/vc
  • make unit-test attempted; failed in unrelated existing checks: schema envelope count expected >=193 but got 184, and apps tests require a git binary supporting git init --initial-branch.
  • Manual local verification confirms the lark-cli <domain> <command> flow works as expected

Related Issues

  • None

Summary by CodeRabbit

  • New Features

    • Search commands now surface server-provided notice messages (e.g., query truncation warnings) in JSON and formatted output across drive, mail, IM, tasks, minutes, VC, docs, and contact searches.
  • Tests

    • Added and updated tests to verify notice propagation in search command outputs and fanout responses.

@coderabbitai

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

Run ID: 0eb0c890-f14d-4ad1-83d5-3fc30b226991

📥 Commits

Reviewing files that changed from the base of the PR and between beee97e and 6f3e956.

📒 Files selected for processing (20)
  • shortcuts/contact/contact_search_user.go
  • shortcuts/contact/contact_search_user_fanout.go
  • shortcuts/contact/contact_search_user_test.go
  • shortcuts/doc/docs_search.go
  • shortcuts/doc/docs_search_test.go
  • shortcuts/drive/drive_search.go
  • shortcuts/drive/drive_search_test.go
  • shortcuts/im/im_chat_search.go
  • shortcuts/im/im_messages_search.go
  • shortcuts/im/im_search_notice_test.go
  • shortcuts/mail/mail_triage.go
  • shortcuts/mail/mail_triage_test.go
  • shortcuts/minutes/minutes_search.go
  • shortcuts/minutes/minutes_search_test.go
  • shortcuts/task/task_search.go
  • shortcuts/task/task_search_test.go
  • shortcuts/task/task_tasklist_search.go
  • shortcuts/task/task_tasklist_search_test.go
  • shortcuts/vc/vc_search.go
  • shortcuts/vc/vc_search_test.go
🚧 Files skipped from review as they are similar to previous changes (15)
  • shortcuts/drive/drive_search.go
  • shortcuts/task/task_tasklist_search_test.go
  • shortcuts/minutes/minutes_search_test.go
  • shortcuts/task/task_search_test.go
  • shortcuts/task/task_tasklist_search.go
  • shortcuts/doc/docs_search.go
  • shortcuts/mail/mail_triage.go
  • shortcuts/vc/vc_search.go
  • shortcuts/vc/vc_search_test.go
  • shortcuts/drive/drive_search_test.go
  • shortcuts/mail/mail_triage_test.go
  • shortcuts/contact/contact_search_user.go
  • shortcuts/im/im_search_notice_test.go
  • shortcuts/contact/contact_search_user_test.go
  • shortcuts/contact/contact_search_user_fanout.go

📝 Walkthrough

Walkthrough

Eight search/list shortcuts now capture an optional API data.notice string and propagate it into the CLI's rendered/JSON output when present.

Changes

Notice Field Passthrough Feature

Layer / File(s) Summary
Contact Search User (Single and Fanout)
shortcuts/contact/contact_search_user.go, shortcuts/contact/contact_search_user_fanout.go, shortcuts/contact/contact_search_user_test.go
Contact search user queries decode and propagate data.notice through single-query responses and fanout-mode responses; schemas and tests updated accordingly.
Doc Search
shortcuts/doc/docs_search.go, shortcuts/doc/docs_search_test.go
Docs search reads data.notice and conditionally adds notice to resultData; test verifies JSON passthrough.
Drive Search
shortcuts/drive/drive_search.go, shortcuts/drive/drive_search_test.go
Drive search reads data.notice from API responses and conditionally includes it in resultData; test added to assert JSON output contains notice.
IM Chat and Messages Search
shortcuts/im/im_chat_search.go, shortcuts/im/im_messages_search.go, shortcuts/im/im_search_notice_test.go
IM chat search includes notice when present. IM messages search returns notice from searchMessages (captured during pagination) and includes it across empty/error/success responses; tests added for both.
Mail Triage Search
shortcuts/mail/mail_triage.go, shortcuts/mail/mail_triage_test.go
Mail triage search captures notice from the first search page and conditionally includes it in JSON output; test helpers/stubs updated.
Minutes Search
shortcuts/minutes/minutes_search.go, shortcuts/minutes/minutes_search_test.go
Minutes search reads data.notice and adds it to outData when present; tests updated to validate notice content.
Task Search and TaskList Search
shortcuts/task/task_search.go, shortcuts/task/task_search_test.go, shortcuts/task/task_tasklist_search.go, shortcuts/task/task_tasklist_search_test.go
Task search and tasklist search capture notice during pagination and conditionally include it in final output; tests updated to expect notice in JSON output.
VC Search
shortcuts/vc/vc_search.go, shortcuts/vc/vc_search_test.go
VC search checks for data.notice and includes it in emitted output when non-empty; test added to assert passthrough.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • larksuite/cli#377: Overlaps task search implementations that this PR extends to passthrough data.notice.
  • larksuite/cli#1287: Touches contact search decode/refactor paths where notice decoding would integrate.
  • larksuite/cli#648: Prior work on contact +search-user v3 response shaping related to these changes.

Suggested labels

feature

Suggested reviewers

  • liangshuo-1
  • liuxinyanglxy
  • YangJunzhou-01

Poem

🐰 A tiny notice, soft and clear,
Hops through searches far and near,
From contacts, docs, to VC calls,
It rides the JSON through the halls.
Tests stand guard as it takes flight.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 18.52% 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 'feat: surface search API notices' directly and clearly summarizes the main change—exposing search API notice strings through CLI output across multiple search commands.
Description check ✅ Passed The description follows the repository template with all required sections: Summary, Changes, Test Plan, and Related Issues. It provides clear motivation, lists specific changes across affected domains, documents test execution with transparency about failures, and confirms manual verification.
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 unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@github-actions github-actions Bot added domain/ccm PR touches the ccm domain domain/contact PR touches the contact domain domain/im PR touches the im domain domain/mail PR touches the mail domain domain/task PR touches the task domain domain/vc PR touches the vc domain size/L Large or sensitive change across domains or core paths labels Jun 11, 2026
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

sa: safe
doc: none
cfg: none
test: unit test
@arnold9672 arnold9672 force-pushed the feat/search-notice-passthrough branch from beee97e to 6f3e956 Compare June 11, 2026 15:34
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 domain/contact PR touches the contact domain domain/im PR touches the im domain domain/mail PR touches the mail domain domain/task PR touches the task domain domain/vc PR touches the vc 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