Skip to content

feat(im): support feed_group (tag) APIs#1039

Open
seemslike wants to merge 1 commit into
larksuite:mainfrom
seemslike:feat/feed-group
Open

feat(im): support feed_group (tag) APIs#1039
seemslike wants to merge 1 commit into
larksuite:mainfrom
seemslike:feat/feed-group

Conversation

@seemslike
Copy link
Copy Markdown
Contributor

@seemslike seemslike commented May 22, 2026

Summary

Land CLI support for the new feed_group (tag) APIs in im v1. Documents 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) so AI agents and developers can call the new feed-group surface without reading meta JSON or thrift IDL by hand.

Changes

  • Add 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 the im:feed_group_v1:read / im:feed_group_v1:write permission scopes for each of the 9 methods.
  • Spell out the v1 chat-only constraint on items[].feed_type in batch_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 the feed_card_type enum section.
  • Make all fenced JSON blocks in the reference parse cleanly (no /* ... */ placeholders); examples are paste-runnable into --data.
  • Update skills/lark-im/SKILL.md to list the feed.groups resource and its 9 methods alongside their scopes.

Test Plan

  • make unit-test passed via validate.sh (build / vet / unit / integration / convention guard / security)
  • validate passed (scripts/dev-verify/validate.shoverall: true)
  • skipped: local-eval (lite mode + doc-only change — no shortcut/skill behavior to evaluate)
  • acceptance-reviewer passed (1/1 scenario, all 5 spec §8.2 checks PASS — end-to-end read, 9/9 invocation traces vs internal/registry/meta_data.json, three-table internal consistency, SKILL.md alignment, 2 enums cross-checked against the IDL)
  • manual verification: python3 — confirmed all 7 fenced JSON blocks in lark-im-feed-groups.md parse cleanly via json.loads

Related Issues

N/A

Summary by CodeRabbit

  • Documentation
    • Added comprehensive feed.groups API reference documentation covering create, update, delete, list, and query operations with authentication prerequisites, request/response specifications, and permission scopes
    • Updated IM flag creation shortcut description to clarify message-or-thread scope, user-only access control, and explicit requirements for feed-layer flags

Review Change Stack

@github-actions github-actions Bot added domain/im PR touches the im domain size/L Large or sensitive change across domains or core paths labels May 22, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 22, 2026

📝 Walkthrough

Walkthrough

Refactors 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).

Changes

IM Shortcut and Feed Groups

Layer / File(s) Summary
Shortcut metadata and description updates
shortcuts/im/im_flag_cancel.go, shortcuts/im/im_flag_create.go
ImFlagCancel is reformatted to use structured field assignment and a consolidated Description string. ImFlagCreate Description clarifies message-or-thread scope and states feed-layer flags require explicitly providing --item-type together with --flag-type feed.
Feed groups API documentation
skills/lark-im/SKILL.md, skills/lark-im/references/lark-im-feed-groups.md
SKILL.md adds feed.groups methods and scope mappings (im:feed_group_v1:read / im:feed_group_v1:write). New reference doc provides complete im.feed.groups API spec with command examples, request/response JSON schemas, enums, timestamp and soft-delete semantics, and per-method permission table.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • larksuite/cli#770: Directly introduces the ImFlagCancel and ImFlagCreate shortcut definitions that are refined and documented in this PR.

Suggested labels

domain/im, size/L

Suggested reviewers

  • YangJunzhou-01
  • haozhenghua-code

Poem

🐰 A tidy string, a clearer line,
Flags on threads and messages shine,
Feed groups penned with scopes and rules,
CLI examples for handy tools,
Hops of joy for docs refined.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main change: adding support for feed_group (tag) APIs to the IM module.
Description check ✅ Passed The description includes all required template sections: Summary explains the scope clearly, Changes lists main additions with specifics, Test Plan documents verification with checkmarks, and Related Issues is addressed.
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 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.

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: 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

📥 Commits

Reviewing files that changed from the base of the PR and between ffcf778 and 3e14895.

📒 Files selected for processing (4)
  • shortcuts/im/im_flag_cancel.go
  • shortcuts/im/im_flag_create.go
  • skills/lark-im/SKILL.md
  • skills/lark-im/references/lark-im-feed-groups.md

Comment thread shortcuts/im/im_flag_cancel.go
Comment thread shortcuts/im/im_flag_create.go
@seemslike seemslike changed the title docs(im): add feed.groups skill reference feat(im): support feed_group (tag) APIs May 22, 2026
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
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.

♻️ Duplicate comments (1)
shortcuts/im/im_flag_create.go (1)

19-19: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Description contradicts actual feed-layer behavior.

The text says feed-layer creation requires explicit --item-type + --flag-type, but execution logic still supports --flag-type=feed with auto-detected item_type when --item-type is 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

📥 Commits

Reviewing files that changed from the base of the PR and between 01e7c50 and a49731d.

📒 Files selected for processing (4)
  • shortcuts/im/im_flag_cancel.go
  • shortcuts/im/im_flag_create.go
  • skills/lark-im/SKILL.md
  • skills/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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain/im PR touches the im 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.

1 participant