Skip to content

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

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

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

Conversation

@seemslike

@seemslike seemslike commented May 22, 2026

Copy link
Copy Markdown
Contributor

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 with method lists, request/response details, auth requirements, enums, and permission scopes.
    • Updated IM shortcut help: clarified --flag-type feed usage, noted item_type auto-detection from chat mode, and changed +flag-cancel wording to a “best-effort” double-cancel (feed-layer cancel only when chat type is determinable).

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

coderabbitai Bot commented May 22, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b8993f14-00c7-4c73-bbd7-0ba61bf6396e

📥 Commits

Reviewing files that changed from the base of the PR and between a49731d and 3ec66d3.

📒 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 (1)
  • shortcuts/im/im_flag_create.go

📝 Walkthrough

Walkthrough

Refactors IM flag shortcut metadata (consolidated Description and structured fields), rewords feed-layer guidance for flag-create/cancel, and adds a full im.feed.groups API reference plus SKILL.md updates for feed.groups methods and permission scopes.

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 reformatted to a multi-line common.Shortcut literal and its Description consolidated to state a "best-effort double-cancel" (message layer plus feed layer when chat_type is determinable). ImFlagCreate Description reworded to state --flag-type feed auto-detects item_type from chat mode.
Feed groups API documentation
skills/lark-im/SKILL.md, skills/lark-im/references/lark-im-feed-groups.md
SKILL.md gains a feed.groups subsection and permission mappings. A new lark-im-feed-groups.md reference is added documenting im.feed.groups methods, request/response schemas, enums, timestamp and soft-delete semantics, v1 chat-only constraints for feed cards, CLI usage, and per-method permission scope table (im:feed_group_v1:read / im:feed_group_v1:write).

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
  • fangshuyu-768

Poem

🐰 A clearer line, a tidy tweak,
Flags that cancel when they can peek,
Feed groups penned with scope and rule,
Docs and CLI now play it cool,
Hops of joy — a rabbit’s tweak.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding support for feed_group (tag) APIs in the im domain.
Description check ✅ Passed The description includes all required template sections: Summary, Changes, Test Plan, and Related Issues. It thoroughly documents the PR scope, implementation details, and verification status.
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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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

@codecov

codecov Bot commented May 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.76%. Comparing base (33c292c) to head (a49731d).
⚠️ Report is 61 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1039      +/-   ##
==========================================
+ Coverage   66.40%   67.76%   +1.35%     
==========================================
  Files         560      590      +30     
  Lines       51548    55194    +3646     
==========================================
+ Hits        34230    37400    +3170     
- Misses      14455    14682     +227     
- Partials     2863     3112     +249     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

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

🧩 Skill update

npx skills add seemslike/cli#feat/feed-group -y -g

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

2 participants