feat(im): support feed_group (tag) APIs#1039
Conversation
📝 WalkthroughWalkthroughRefactors IM flag shortcut metadata (consolidated Description and structured fields) and adds full documentation for a new im.feed.groups API (method list, request/response schemas, enums, CLI examples, and permission scope mappings). ChangesIM Shortcut and Feed Groups
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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/im/im_flag_cancel.go`:
- Line 20: The description string at the top is inaccurate: it says
double-cancel only happens after checking for a thread-root, but the code path
in buildCancelItems currently performs a best-effort double-cancel by default
without that explicit gate; update the Description text to describe the actual
behavior (e.g., "performs a best-effort cancel for both message and feed layers
by default; when --flag-type is provided, only that layer is targeted") so the
wording matches buildCancelItems and the current execution path.
In `@shortcuts/im/im_flag_create.go`:
- Line 19: Update the command Description string (the Description variable in
im_flag_create.go) to accurately reflect that feed-layer flags can be created by
passing --flag-type=feed even when --item-type is omitted because the code will
auto-detect item_type; remove the clause saying "feed-layer flag requires
explicit --item-type + --flag-type" and replace it with text stating feed-layer
creation supports auto-detection of item type when --item-type is not provided.
🪄 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: 715ce6a0-9db4-42d7-97be-abcec7ef501b
📒 Files selected for processing (4)
shortcuts/im/im_flag_cancel.goshortcuts/im/im_flag_create.goskills/lark-im/SKILL.mdskills/lark-im/references/lark-im-feed-groups.md
3e14895 to
01e7c50
Compare
Document the nine raw-API methods registered under the feed.groups resource: create, update, delete, batch_query, list, batch_add_item, batch_remove_item, batch_query_item, list_item. Adds a new high-density skill reference at skills/lark-im/references/lark-im-feed-groups.md and records the matching permission scopes in skills/lark-im/SKILL.md. The new reference covers, for each method: - HTTP verb, path, and request/response shape - The enum surface from the underlying datasync IDL (feed_group_type, feed_card_type, rule action / match / condition item / operator / chat type, update_fields) - A feed_group_rules JSON walkthrough with the required-field legend The chat-only constraint on items[].feed_type is called out loudly: the meta types feed_type as an open string and the CLI does not pre-validate, so the per-method tables and the feed_card_type enum section both make clear that anything other than "chat" is rejected at runtime. All fenced JSON blocks parse cleanly so examples are paste-runnable into --data. Also refines descriptions for +flag-create / +flag-cancel — a carried-over wording fix from the prior IM bookmark task that was sitting uncommitted on this branch. Change-Id: I07aea9ff839dc856c1f267c835141d7d5dd10cff
01e7c50 to
a49731d
Compare
There was a problem hiding this comment.
♻️ Duplicate comments (1)
shortcuts/im/im_flag_create.go (1)
19-19:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winDescription contradicts actual feed-layer behavior.
The text says feed-layer creation requires explicit
--item-type + --flag-type, but execution logic still supports--flag-type=feedwith auto-detecteditem_typewhen--item-typeis omitted. Please align the description with implemented behavior.🤖 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/im/im_flag_create.go` at line 19, The command Description string in shortcuts/im/im_flag_create.go currently claims feed-layer creation requires explicit --item-type + --flag-type, which contradicts the implemented behavior that allows --flag-type=feed with auto-detected item_type when --item-type is omitted; update the Description (the Description field in the command definition) to accurately state that feed-layer flags can be created by passing --flag-type=feed and the command will auto-detect item_type if --item-type is not provided (or note when explicit flags are needed), so the prose matches the actual logic.
🤖 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.
Duplicate comments:
In `@shortcuts/im/im_flag_create.go`:
- Line 19: The command Description string in shortcuts/im/im_flag_create.go
currently claims feed-layer creation requires explicit --item-type +
--flag-type, which contradicts the implemented behavior that allows
--flag-type=feed with auto-detected item_type when --item-type is omitted;
update the Description (the Description field in the command definition) to
accurately state that feed-layer flags can be created by passing
--flag-type=feed and the command will auto-detect item_type if --item-type is
not provided (or note when explicit flags are needed), so the prose matches the
actual logic.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: b67d1ca2-8237-4b45-9dd0-cf9d01881c80
📒 Files selected for processing (4)
shortcuts/im/im_flag_cancel.goshortcuts/im/im_flag_create.goskills/lark-im/SKILL.mdskills/lark-im/references/lark-im-feed-groups.md
✅ Files skipped from review due to trivial changes (2)
- skills/lark-im/references/lark-im-feed-groups.md
- shortcuts/im/im_flag_cancel.go
Summary
Land CLI support for the new feed_group (tag) APIs in
imv1. Documents the nine raw-API methods registered under thefeed.groupsresource (create, update, delete, batch_query, list, batch_add_item, batch_remove_item, batch_query_item, list_item) so AI agents and developers can call the new feed-group surface without reading meta JSON or thrift IDL by hand.Changes
skills/lark-im/references/lark-im-feed-groups.md— high-density reference covering HTTP verb, path, request/response shape, the enum surface from the underlying datasync IDL, and theim:feed_group_v1:read/im:feed_group_v1:writepermission scopes for each of the 9 methods.chat-only constraint onitems[].feed_typeinbatch_add_item/batch_remove_item/batch_query_item: the meta types it as an open string and the CLI does not pre-validate, so the reference makes the constraint loud at the per-method tables and in thefeed_card_typeenum section./* ... */placeholders); examples are paste-runnable into--data.skills/lark-im/SKILL.mdto list thefeed.groupsresource and its 9 methods alongside their scopes.Test Plan
make unit-testpassed viavalidate.sh(build / vet / unit / integration / convention guard / security)scripts/dev-verify/validate.sh→overall: true)internal/registry/meta_data.json, three-table internal consistency, SKILL.md alignment, 2 enums cross-checked against the IDL)python3— confirmed all 7 fenced JSON blocks inlark-im-feed-groups.mdparse cleanly viajson.loadsRelated Issues
N/A
Summary by CodeRabbit