Skip to content

feat: support minutes search#359

Merged
zhicong666-bytedance merged 12 commits intomainfrom
feat/minutes-search
Apr 10, 2026
Merged

feat: support minutes search#359
zhicong666-bytedance merged 12 commits intomainfrom
feat/minutes-search

Conversation

@zhicong666-bytedance
Copy link
Copy Markdown
Collaborator

@zhicong666-bytedance zhicong666-bytedance commented Apr 9, 2026

Summary

Add a minutes search shortcut that supports keyword, owner, participant, and
time-range filters. Align the output fields with the minutes search schema and
clarify same-day query behavior in the related skill docs.

Changes

  • add minutes +search shortcut and related tests
  • support filtering by query, owner ids, participant ids, and create time range
  • align search result parsing with minutes_search_item and minutes_meta
  • use token, display_info, description, app_link, and avatar as output fields
  • validate page-size with the shared page-size validation pattern
  • update minutes and vc skill docs to clarify date-only --end semantics and same-day queries

Test Plan

  • make build
  • make unit-test
  • go mod tidy produced no changes to go.mod or go.sum
  • go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.1.6 run --new-from-rev=origin/main
  • go test -count=1 ./shortcuts/minutes/...
  • Manual local verification confirms lark-cli minutes +search works as expected

Related Issues

  • None

Summary by CodeRabbit

  • New Features

    • Added minutes +search to search/filter minutes by keyword, owner, participants, and time range; supports pagination (default 15, max 200), --page-token, --dry-run, me alias, and formatted table/JSON output (prints "No minutes." when empty).
  • Documentation

    • Updated skill docs and references with usage scenarios, CLI examples, time-format rules (date-only --end → end-of-day), pagination guidance, permissions, and troubleshooting.
  • Tests

    • Added comprehensive tests for validation, time parsing, parameter construction, user-ID handling, execution, and output formatting.
  • Chores

    • Exposed the new search shortcut in the minutes shortcut listing (ordering adjusted).

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 9, 2026

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 9, 2026

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

Adds a new "minutes +search" shortcut with input validation, request/params/body builders, DryRun and Execute flows calling POST /open-apis/minutes/v1/minutes/search, response parsing (items/total/has_more/page_token), table/JSON output formatting, comprehensive unit tests, and updated skill docs and references.

Changes

Cohort / File(s) Summary
Minutes Search Implementation
shortcuts/minutes/minutes_search.go, shortcuts/minutes/minutes_search_test.go, shortcuts/minutes/shortcuts.go
Introduce MinutesSearch shortcut: parse/validate inputs (query length, time range normalization, page_size bounds, owner/participant IDs with me → open_id resolution and case-insensitive dedupe), build request params/body, DryRun/Execute flows using POST /open-apis/minutes/v1/minutes/search, parse response (items,total,has_more,page_token), render table/JSON, and add comprehensive tests covering parsing, validation, ID resolution, request construction, and rendering.
Minutes Skill Documentation
skills/lark-minutes/SKILL.md, skills/lark-minutes/references/lark-minutes-search.md
Add +search usage, flags, constraints (page_size ≤200, date-only --end → end-of-day), me semantics, pagination guidance, and routing rules; update permissions and examples.
VC Skill Documentation Updates
skills/lark-vc/references/lark-vc-search.md, skills/lark-vc/references/lark-vc-recording.md
Clarify date-only --end semantics (end-of-day), add single-day example, and revise agent/command example flows to use explicit lark-cli outputs passed between steps.

Sequence Diagram

sequenceDiagram
    actor User
    participant CLI as CLI Handler
    participant Validator as Validator
    participant Builder as Request Builder
    participant API as Minutes API
    participant Formatter as Output Formatter

    User->>CLI: minutes +search --query="..." [filters]
    CLI->>Validator: Validate inputs (query length, page size, time range, IDs)
    alt Validation fails
        Validator-->>CLI: error
        CLI-->>User: display error
    else Validation passes
        Validator-->>CLI: ok
        CLI->>Builder: build params & body (parse times, resolve 'me', dedupe IDs)
        Builder-->>CLI: prepared request
        CLI->>API: POST /open-apis/minutes/v1/minutes/search
        API-->>CLI: {items, total, has_more, page_token}
        CLI->>Formatter: format results (table or json)
        alt has_more and non-json
            Formatter-->>CLI: append "more available" + page_token
        end
        Formatter-->>User: display results or "No minutes."
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • liangshuo-1
  • zhaoleibd

Poem

🐇 I hopped through flags and parsed the day,
I chased the tokens, found the minutes’ way,
Filters neat and pages left to roam,
I bring your meetings, tidy, home —
Happy hops, your search is ready to play.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The PR title 'feat: support minutes search' directly and clearly describes the main change: adding a new minutes search feature/shortcut.
Description check ✅ Passed The PR description comprehensively covers all required sections: Summary (2 sentences covering motivation/scope), Changes (detailed bullet list of 6 specific changes), and Test Plan (checkbox items confirming build, unit tests, linting, and manual verification).
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/minutes-search

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added domain/vc PR touches the vc domain size/L Large or sensitive change across domains or core paths labels Apr 9, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (3)
shortcuts/minutes/minutes_search_test.go (1)

179-188: Missing t.Parallel() in test function.

This test function is missing t.Parallel() unlike other test functions in this file. While not a bug, adding it would be consistent with the rest of the test file and enable parallel execution.

♻️ Add t.Parallel() for consistency
 func TestMinutesSearchValidationMeOwnerID(t *testing.T) {
+	t.Parallel()
+
 	cmd := newMinutesSearchTestCommand()
 	_ = cmd.Flags().Set("owner-ids", "me")
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@shortcuts/minutes/minutes_search_test.go` around lines 179 - 188, Add
t.Parallel() to the start of the TestMinutesSearchValidationMeOwnerID test
function to match other tests and enable parallel execution; locate the
TestMinutesSearchValidationMeOwnerID function in minutes_search_test.go and
insert a call to t.Parallel() as the first statement (before creating cmd or
calling MinutesSearch.Validate).
shortcuts/minutes/minutes_search.go (2)

49-55: Silently ignored time.Parse errors could mask subtle bugs.

The errors from time.Parse on lines 50-51 are discarded with _. While this code path is only reached after successful toRFC3339 calls (which should guarantee valid RFC3339 strings), silently ignoring parse errors could mask issues if the upstream parsing behavior changes.

Consider adding a defensive check or at minimum a comment explaining why the error is safe to ignore.

💡 Suggested improvement
 	if startTime != "" && endTime != "" {
-		st, _ := time.Parse(time.RFC3339, startTime)
-		et, _ := time.Parse(time.RFC3339, endTime)
+		st, err1 := time.Parse(time.RFC3339, startTime)
+		et, err2 := time.Parse(time.RFC3339, endTime)
+		if err1 != nil || err2 != nil {
+			// Should not happen: toRFC3339 guarantees valid RFC3339 output
+			return "", "", output.ErrValidation("internal: failed to re-parse time")
+		}
 		if st.After(et) {
 			return "", "", output.ErrValidation("--start (%s) is after --end (%s)", start, end)
 		}
 	}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@shortcuts/minutes/minutes_search.go` around lines 49 - 55, The time.Parse
calls for startTime and endTime currently ignore errors (st, _ :=
time.Parse(...), et, _ := time.Parse(...)); add defensive error handling by
capturing the parse errors and returning an appropriate validation error via
output.ErrValidation when either parse fails (e.g., check errSt and errEt after
calling time.Parse), or if you prefer to keep the current behavior, add a clear
comment explaining why the error can be safely ignored because toRFC3339
guarantees validity; reference the variables startTime/endTime, the time.Parse
calls that produce st/et, and use output.ErrValidation for consistent error
reporting.

254-256: Silently ignored strconv.Atoi error.

The error from strconv.Atoi on line 255 is discarded. If buildMinutesSearchParams returns a non-numeric page_size value (which shouldn't happen given the validation), this would silently use 0 as the page size.

This is low-risk since Validate is called first and enforces valid page-size, but adding a comment or defensive handling would improve robustness.

💡 Suggested improvement
 		params := map[string]interface{}{}
-		pageSize, _ := strconv.Atoi(buildMinutesSearchParams(runtime).Get("page_size"))
+		// page_size is validated in Validate(), Atoi won't fail
+		pageSize, _ := strconv.Atoi(buildMinutesSearchParams(runtime).Get("page_size"))
 		params["page_size"] = pageSize
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@shortcuts/minutes/minutes_search.go` around lines 254 - 256, The strconv.Atoi
error from converting buildMinutesSearchParams(...).Get("page_size") is ignored;
update the page_size parsing in minutes_search.go to handle the error instead of
silently using 0: call strconv.Atoi, check the returned err and either
return/propagate the error (from the enclosing function) or set a safe default
and log/debug the unexpected value; specifically modify the code around params
:= map[string]interface{}{}, the pageSize variable assignment and
params["page_size"] to handle non-numeric values returned by
buildMinutesSearchParams, referencing the pageSize and params symbols so the fix
is applied in the correct spot.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@shortcuts/minutes/minutes_search_test.go`:
- Around line 179-188: Add t.Parallel() to the start of the
TestMinutesSearchValidationMeOwnerID test function to match other tests and
enable parallel execution; locate the TestMinutesSearchValidationMeOwnerID
function in minutes_search_test.go and insert a call to t.Parallel() as the
first statement (before creating cmd or calling MinutesSearch.Validate).

In `@shortcuts/minutes/minutes_search.go`:
- Around line 49-55: The time.Parse calls for startTime and endTime currently
ignore errors (st, _ := time.Parse(...), et, _ := time.Parse(...)); add
defensive error handling by capturing the parse errors and returning an
appropriate validation error via output.ErrValidation when either parse fails
(e.g., check errSt and errEt after calling time.Parse), or if you prefer to keep
the current behavior, add a clear comment explaining why the error can be safely
ignored because toRFC3339 guarantees validity; reference the variables
startTime/endTime, the time.Parse calls that produce st/et, and use
output.ErrValidation for consistent error reporting.
- Around line 254-256: The strconv.Atoi error from converting
buildMinutesSearchParams(...).Get("page_size") is ignored; update the page_size
parsing in minutes_search.go to handle the error instead of silently using 0:
call strconv.Atoi, check the returned err and either return/propagate the error
(from the enclosing function) or set a safe default and log/debug the unexpected
value; specifically modify the code around params := map[string]interface{}{},
the pageSize variable assignment and params["page_size"] to handle non-numeric
values returned by buildMinutesSearchParams, referencing the pageSize and params
symbols so the fix is applied in the correct spot.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f687ad60-cf42-4081-8800-18e8f844cb7e

📥 Commits

Reviewing files that changed from the base of the PR and between af83e54 and 165e637.

📒 Files selected for processing (6)
  • shortcuts/minutes/minutes_search.go
  • shortcuts/minutes/minutes_search_test.go
  • shortcuts/minutes/shortcuts.go
  • skills/lark-minutes/SKILL.md
  • skills/lark-minutes/references/lark-minutes-search.md
  • skills/lark-vc/references/lark-vc-search.md

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 9, 2026

Greptile Summary

This PR adds a minutes +search shortcut that filters minutes by keyword, owner, participant, and time range, with pagination support and formatted output. The implementation closely mirrors vc +search and previously flagged concerns (pagination hint placement, redundant param calls) have been addressed.

  • skills/lark-minutes/SKILL.md line 76 states minutes +search returns at most 200 items per request, but maxMinutesSearchPageSize is 30 in the code and the reference doc also correctly says 30 — this mismatch will mislead AI agents into attempting --page-size 200 and hitting a validation error.

Confidence Score: 4/5

Safe to merge after correcting the max page-size claim in SKILL.md from 200 to 30.

One P1 documentation inconsistency: SKILL.md claims 200 items per page but the CLI enforces 30. This would cause AI agents reading the skill to generate failing requests. All code logic, validation, output formatting, and tests look correct.

skills/lark-minutes/SKILL.md — max page-size routing rule needs updating from 200 to 30.

Important Files Changed

Filename Overview
shortcuts/minutes/minutes_search.go New search shortcut; pagination hint and output are correctly structured; max page size (30) in code is correct but contradicts SKILL.md (200).
shortcuts/minutes/minutes_search_test.go Comprehensive tests covering validation, time parsing, user-ID resolution, dry-run, execution, pagination hints, and field extractors.
shortcuts/minutes/shortcuts.go Exposes MinutesSearch before MinutesDownload; ordering matches PR intent.
skills/lark-minutes/SKILL.md Routing rules claim max 200 items per request but the CLI enforces 30; contradicts the reference doc and the code constant.
skills/lark-minutes/references/lark-minutes-search.md Correctly documents max page size as 30, same-day query semantics, and pagination guidance.
skills/lark-vc/SKILL.md Minor doc updates to clarify date-only --end semantics; no logic changes.
skills/lark-vc/references/lark-vc-recording.md Documentation-only update clarifying same-day query behavior.
skills/lark-vc/references/lark-vc-search.md Documentation-only update clarifying date-only --end end-of-day semantics.

Sequence Diagram

sequenceDiagram
    participant User
    participant CLI as lark-cli minutes +search
    participant Validate
    participant Execute
    participant API as POST /open-apis/minutes/v1/minutes/search

    User->>CLI: --query / --owner-ids / --participant-ids / --start / --end
    CLI->>Validate: parseTimeRange, ValidatePageSize, resolveUserIDs
    Validate-->>CLI: error or ok
    CLI->>Execute: buildMinutesSearchParams (page_size, page_token)
    Execute->>Execute: buildMinutesSearchBody (query + filter)
    Execute->>API: POST with params + body
    API-->>Execute: items, total, has_more, page_token
    Execute->>User: pretty table / JSON / CSV (more available hint if has_more)
Loading

Reviews (10): Last reviewed commit: "docs(skills): require shortcut reference..." | Re-trigger Greptile

Comment thread shortcuts/minutes/minutes_search.go Outdated
Comment thread shortcuts/minutes/minutes_search.go Outdated
Comment thread shortcuts/minutes/minutes_search.go
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 9, 2026

🚀 PR Preview Install Guide

🧰 CLI update

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

🧩 Skill update

npx skills add larksuite/cli#feat/minutes-search -y -g

@zhicong666-bytedance zhicong666-bytedance changed the title Feat/minutes search feat: minutes search Apr 9, 2026
@zhicong666-bytedance zhicong666-bytedance changed the title feat: minutes search feat: support minutes search Apr 9, 2026
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 9, 2026

Tip:

Greploop — Automatically fix all review issues by running /greploops in Claude Code. It iterates: fix, push, re-review, repeat until 5/5 confidence.

Use the Greptile plugin for Claude Code to query reviews, search comments, and manage custom context directly from your terminal.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

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 the current code and only fix it if needed.

Inline comments:
In `@shortcuts/minutes/minutes_search_test.go`:
- Around line 68-70: Remove the redundant loop-variable shadowing "tt := tt"
inside the test loop so the closure uses the loop variable captured from "for _,
tt := range tests" directly; locate the for-loop that iterates over tests and
the nested t.Run(...) closures (instances where "for _, tt := range tests { tt
:= tt t.Run(...)" occurs) and delete the "tt := tt" lines at all occurrences
(the ones flagged in the review), leaving the t.Run closures to reference tt
without reassigning it.
🪄 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: b586dc77-1fa0-4072-9f2c-ca7628f68690

📥 Commits

Reviewing files that changed from the base of the PR and between 165e637 and 8897360.

📒 Files selected for processing (4)
  • shortcuts/minutes/minutes_search.go
  • shortcuts/minutes/minutes_search_test.go
  • skills/lark-minutes/references/lark-minutes-search.md
  • skills/lark-vc/references/lark-vc-recording.md
✅ Files skipped from review due to trivial changes (2)
  • skills/lark-vc/references/lark-vc-recording.md
  • skills/lark-minutes/references/lark-minutes-search.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • shortcuts/minutes/minutes_search.go

Comment thread shortcuts/minutes/minutes_search_test.go
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@shortcuts/minutes/minutes_search.go`:
- Around line 342-344: The pagination hint is being written to stdout
(fmt.Fprintf(runtime.IO().Out,...)) which can corrupt piped program output;
change the write target to stderr instead by using the runtime's error output
(e.g., runtime.IO().Err) so the "(more available, page_token: %s)" message is
sent to stderr while preserving the existing condition that skips json/empty
formats and using the same pageToken variable.

In `@skills/lark-minutes/references/lark-minutes-search.md`:
- Line 70: The documentation line for the `--page-size` flag is inconsistent
with the code constant `maxMinutesSearchPageSize = 200`; update the table entry
so the max value shows 200 (and the range text "1-200") and keep the default as
15 to match the flag parsing and the `maxMinutesSearchPageSize` constant used by
the minutes search implementation.
- Line 164: The sentence "必须使用 `--format json` 输出,你更佳擅长解析 JSON 数据。" contains a
typo: replace "更佳" with "更加" so it reads "必须使用 `--format json` 输出,你更加擅长解析 JSON
数据。"; locate the exact string in the markdown and update the wording
accordingly.
- Line 173: The markdown link "[lark-vc] -- 视频会议全部命令" in
skills/lark-minutes/references/lark-minutes-search.md currently points to
../SKILL.md (resolving to the minutes skill); update the link target to the VC
skill's SKILL.md (e.g., ../lark-vc/SKILL.md) by locating the link text
"[lark-vc]" in that file and replacing the destination path so it points to the
lark-vc skill's SKILL.md.
🪄 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: 764ef00d-5dc0-49c5-9b5d-55620b1f66d9

📥 Commits

Reviewing files that changed from the base of the PR and between 219f073 and 8b7135e.

📒 Files selected for processing (4)
  • shortcuts/minutes/minutes_search.go
  • shortcuts/minutes/minutes_search_test.go
  • skills/lark-minutes/SKILL.md
  • skills/lark-minutes/references/lark-minutes-search.md
✅ Files skipped from review due to trivial changes (1)
  • shortcuts/minutes/minutes_search_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • skills/lark-minutes/SKILL.md

Comment thread shortcuts/minutes/minutes_search.go
Comment thread skills/lark-minutes/references/lark-minutes-search.md
Comment thread skills/lark-minutes/references/lark-minutes-search.md Outdated
Comment thread skills/lark-minutes/references/lark-minutes-search.md Outdated
@zhicong666-bytedance zhicong666-bytedance merged commit a00dfad into main Apr 10, 2026
16 checks passed
@zhicong666-bytedance zhicong666-bytedance deleted the feat/minutes-search branch April 10, 2026 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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