feat(mail): add contact search workflow and multi_entity search API#437
feat(mail): add contact search workflow and multi_entity search API#437chanthuang wants to merge 2 commits intomainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdded documentation for recipient search using Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Greptile SummaryThis PR adds a recipient-search workflow section to the Confidence Score: 5/5Safe to merge — documentation-only changes with no Go code touched All findings are P2 style suggestions; the workflow guidance is clear and the two files are kept in sync No files require special attention Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Agent
participant CLI as lark-cli
User->>Agent: "Send email to 张三"
alt User provides full email address
Agent->>User: Use address directly (no search needed)
else Name / keyword / group provided
Agent->>CLI: multi_entity search --as user --data '{"query":"张三"}'
CLI-->>Agent: List of matching entities (user/mail_group/chat/external_contact)
Agent->>Agent: Filter entities with non-empty email field
alt No matches
Agent->>User: 未找到,请换关键词或直接提供邮箱
else One or more matches
Agent->>User: Display candidates (name/email/dept/tag/type/member_count)
User->>Agent: Confirm recipient email
end
end
Agent->>CLI: +send --to confirmed_email --subject ... --body ...
Agent->>User: Show draft summary, await explicit confirmation
User->>Agent: Approve send
Agent->>CLI: +send --confirm-send
CLI-->>Agent: message_id
Agent->>CLI: messages send_status
CLI-->>Agent: Delivery status per recipient
Agent->>User: Report delivery result
Reviews (3): Last reviewed commit: "fix: require user confirmation for all c..." | Re-trigger Greptile |
skills/lark-mail/SKILL.md
Outdated
|
|
||
| | 方法 | 所需 scope | | ||
| |------|-----------| | ||
| | `multi_entity.search` | `mail:user_mailbox:readonly` | |
There was a problem hiding this comment.
Scope for
multi_entity.search may be too narrow
multi_entity.search returns users, enterprise mail groups, chats, and external contacts. Scoping it to mail:user_mailbox:readonly (a mailbox-read permission) looks narrower than what a cross-entity directory search typically needs. If the AI agent requests only this scope and the API actually requires a contact/directory scope as well, the call will silently fail or return partial results at runtime.
Could you confirm this is the full required scope from the API spec, or verify it against lark-cli schema mail.multi_entity.search? Is mail:user_mailbox:readonly confirmed as the only required scope for multi_entity.search, or does this API need additional contact/directory scopes?
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
skills/lark-mail/SKILL.md (1)
304-305: Fill in themulti_entity.searchmethod descriptionLine 304 currently leaves the method description blank (
- \search` —`). Consider adding a short description for parity with neighboring sections and better discoverability.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@skills/lark-mail/SKILL.md` around lines 304 - 305, Add a concise description for the multi_entity.search method where it currently reads "- `search` —": briefly state that multi_entity.search performs a query across multiple entities and returns matched entity records (with relevance/metadata) or paginated results; reference the method name `multi_entity.search` and mirror the style of neighboring method descriptions for consistency.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@skill-template/domains/mail.md`:
- Around line 87-95: The fenced code block showing the "找到多个匹配\"组\"的结果..."
example is missing a language tag which triggers markdownlint MD040; update that
triple-backtick block (the sample list with entries "团队邮件组 <team@example.com>",
"项目群 <project@example.com>", "张群 <zhangqun@example.com>") to include a language
identifier (e.g., ```text) immediately after the opening backticks so the block
is explicitly marked as text.
---
Nitpick comments:
In `@skills/lark-mail/SKILL.md`:
- Around line 304-305: Add a concise description for the multi_entity.search
method where it currently reads "- `search` —": briefly state that
multi_entity.search performs a query across multiple entities and returns
matched entity records (with relevance/metadata) or paginated results; reference
the method name `multi_entity.search` and mirror the style of neighboring method
descriptions for consistency.
🪄 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: 8c2185fd-4ed6-4948-a334-63c9b5390064
📒 Files selected for processing (2)
skill-template/domains/mail.mdskills/lark-mail/SKILL.md
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@47d446a407aaad58810d09ee4ab19d9188200d17🧩 Skill updatenpx skills add larksuite/cli#feat/mail-contact-search -y -g |
3cc9dbb to
0caadd2
Compare
- Add recipient search workflow to mail skill template (search by name, email keyword, or group name with rich result display) - Regenerate SKILL.md with multi_entity.search command Change-Id: Ie307af16a5ee38dac99c1d8d0df528730bf847d0 Co-Authored-By: AI
0caadd2 to
a51e180
Compare
There was a problem hiding this comment.
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 `@skills/lark-mail/SKILL.md`:
- Around line 382-385: The multi_entity.search entry in SKILL.md currently has
no description; update the `multi_entity.search` documentation to include a
concise summary of what the method does, the expected inputs (e.g., query
string, filters, pagination params), the shape of returned results (e.g., list
of entities with id/name/score and pagination metadata), error/edge-case
behavior, and a short usage example or note linking to related methods (e.g.,
`multi_entity.get` or `multi_entity.list`) for discoverability; ensure the
header `### multi_entity` keeps the bullet `- \`search\` —` followed by a one-
or two-sentence summary and brief parameter/return bullets so the API table is
consistent.
🪄 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: 41d5cc0b-2d01-41f0-96e4-98a0dba9eb20
📒 Files selected for processing (2)
skill-template/domains/mail.mdskills/lark-mail/SKILL.md
✅ Files skipped from review due to trivial changes (1)
- skill-template/domains/mail.md
skills/lark-mail/SKILL.md
Outdated
| ### multi_entity | ||
|
|
||
| - `search` — | ||
|
|
There was a problem hiding this comment.
Fill in the multi_entity.search method description.
search is currently documented with an empty description, which makes the API resource table inconsistent and less useful for discoverability.
✍️ Suggested doc patch
### multi_entity
- - `search` —
+ - `search` — 搜索可作为收件人的实体(用户、邮件组、群聊、外部联系人),返回可用邮箱地址及类型信息📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ### multi_entity | |
| - `search` — | |
| ### multi_entity | |
| - `search` — 搜索可作为收件人的实体(用户、邮件组、群聊、外部联系人),返回可用邮箱地址及类型信息 |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@skills/lark-mail/SKILL.md` around lines 382 - 385, The multi_entity.search
entry in SKILL.md currently has no description; update the `multi_entity.search`
documentation to include a concise summary of what the method does, the expected
inputs (e.g., query string, filters, pagination params), the shape of returned
results (e.g., list of entities with id/name/score and pagination metadata),
error/edge-case behavior, and a short usage example or note linking to related
methods (e.g., `multi_entity.get` or `multi_entity.list`) for discoverability;
ensure the header `### multi_entity` keeps the bullet `- \`search\` —` followed
by a one- or two-sentence summary and brief parameter/return bullets so the API
table is consistent.
multi_entity.search is a fuzzy keyword search — a single result does not guarantee an exact match (e.g. searching "张三" may only return "张三丰"). Always show candidates for user confirmation before using the email address in compose parameters. Change-Id: I447c54cd59b06a88c5d6806bfe76f0adfdceb1ce Co-Authored-By: AI
Summary
multi_entity.searchcommandChanges
skill-template/domains/mail.md: new "Recipient Search" section with search examples, entity type table, and multi-match display formatskills/lark-mail/SKILL.md: regenerated to includemulti_entity.searchand search workflowNo Go code changes. No breaking changes.
Test plan
lark-cli mail multi_entity search --as user --data '{"query":"陈煌"}'returns results with name/email/department/tagSummary by CodeRabbit