Skip to content

docs(im): document chat.user_setting batch_query/batch_update - #1339

Merged
YangJunzhou-01 merged 1 commit into
larksuite:mainfrom
shifengjuan-dev:feat/im-chat-user-setting
Jun 11, 2026
Merged

docs(im): document chat.user_setting batch_query/batch_update#1339
YangJunzhou-01 merged 1 commit into
larksuite:mainfrom
shifengjuan-dev:feat/im-chat-user-setting

Conversation

@shifengjuan-dev

@shifengjuan-dev shifengjuan-dev commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

What

Document the chat.user_setting resource in the lark-im skill, exposing batch_query / batch_update via the generic lark-cli im <resource> <method> gateway.

Per-user in-chat mute preferences:

  • is_muted — mute normal messages
  • is_mute_at_all — mute @ALL messages

User identity only (user_access_token); caller must be in each target chat; up to 10 chats per call.

Changes

  • New ### chat.user_setting entry under API Resources (batch_query, batch_update).
  • Permission table: batch_queryim:chat.user_setting:read, batch_updateim:chat.user_setting:write.

Docs only; no code changes.

Summary by CodeRabbit

  • New Features
    • Added batch query and batch update operations for chat user settings. These new user-scoped operations enable developers to efficiently query and update user settings across multiple chats simultaneously. Each request supports processing up to 10 chats and includes enforced permission scopes to ensure secure and granular access control for all operations.

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds documentation for new chat.user_setting API operations to the Lark IM skill documentation. It introduces batch_query and batch_update endpoints scoped to user identity, along with their required permission scopes.

Changes

Chat User Settings API Documentation

Layer / File(s) Summary
API operations documentation
skills/lark-im/SKILL.md
Introduces chat.user_setting.batch_query and batch_update operations with user identity scope, per-chat membership requirement, and 10-chat per request limit.
Scopes and permissions
skills/lark-im/SKILL.md
Extends permissions table with chat.user_setting.batch_query (im:chat.user_setting:read) and chat.user_setting.batch_update (im:chat.user_setting:write).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested labels

domain/im, size/M

Suggested reviewers

  • liangshuo-1
  • YangJunzhou-01

Poem

🐰 New endpoints hop into sight,
Batch queries and updates so bright,
User settings now documented well,
With scopes to guard the wishing bell! 📝

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The PR title accurately and concisely describes the main change: documenting the chat.user_setting resource with batch_query and batch_update operations.
Description check ✅ Passed The PR description includes a What section explaining the changes, a Changes section listing the modifications, and notes this is docs-only; however, it lacks Test Plan and Related Issues sections from the template.
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.

@github-actions github-actions Bot added domain/im PR touches the im domain size/M Single-domain feat or fix with limited business impact labels Jun 9, 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.

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 `@skills/lark-im/SKILL.md`:
- Around line 161-162: The registry lookup failed for the scope
im:chat.user_setting:write used by chat.user_setting.batch_update; check the
registry entries and either add the missing im:chat.user_setting:write scope or
correct the scope name to match the existing read entry
(im:chat.user_setting:read) and update the mapping used by
chat.user_setting.batch_update accordingly; after updating, run the registry
lookup/validation and any permission tests to confirm the write scope resolves.
- Line 113: The SKILL.md incorrectly documents a write scope for
chat.user_setting.batch_update that doesn't exist in the codebase; locate the
chat.user_setting.batch_update entry in skills/lark-im/SKILL.md and either
remove or correct the write scope to match the actual registered permission
im:chat.user_setting:read, or alternatively add the missing registry entry
im:chat.user_setting:write in the authoritative permission registry (and
corresponding code/fixtures) so the documented scope matches the implemented
permission; ensure references to im:chat.user_setting:read and
im:chat.user_setting:write and the skill name chat.user_setting.batch_update are
updated consistently.
🪄 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: 57402a4c-3359-4f2c-b82d-8b9ba403f064

📥 Commits

Reviewing files that changed from the base of the PR and between 03ea6e7 and c32eed3.

📒 Files selected for processing (1)
  • skills/lark-im/SKILL.md

Comment thread skills/lark-im/SKILL.md Outdated
Comment thread skills/lark-im/SKILL.md Outdated
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

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

🧩 Skill update

npx skills add shifengjuan-dev/lark-cli#feat/im-chat-user-setting -y -g

@codecov

codecov Bot commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.82%. Comparing base (e64610f) to head (2bcd46f).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1339      +/-   ##
==========================================
+ Coverage   72.75%   72.82%   +0.06%     
==========================================
  Files         730      731       +1     
  Lines       69034    69096      +62     
==========================================
+ Hits        50228    50320      +92     
+ Misses      15034    14999      -35     
- Partials     3772     3777       +5     

☔ View full report in Codecov by Harness.
📢 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.

@shifengjuan-dev

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

Both findings re: the im:chat.user_setting:write scope are false positives. The scope is registered in the authoritative internal/registry/meta_data.json (line 15436, chat_user_setting.batch_update["im:chat", "im:chat.user_setting:write"]). The check only consulted scope_priorities.json, which is a scored recommendation ranking, not the authoritative scope registry. Please re-review.

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify the scope in meta_data.json
echo "=== Checking meta_data.json for chat_user_setting ==="
rg -n "chat_user_setting" internal/registry/meta_data.json | head -30

echo ""
echo "=== Checking around line 15436 ==="
sed -n '15430,15445p' internal/registry/meta_data.json 2>/dev/null || echo "File not found or sed failed"

echo ""
echo "=== Checking for im:chat.user_setting:write in meta_data.json ==="
rg -n "im:chat.user_setting:write" internal/registry/meta_data.json | head -10

echo ""
echo "=== Checking scope_priorities.json for comparison ==="
rg -n "chat.user_setting" internal/registry/scope_priorities.json 2>/dev/null | head -10

echo ""
echo "=== Reading the changed file ==="
cat skills/lark-im/SKILL.md

Length of output: 13612



@shifengjuan-dev Thank you for the clarification. I've confirmed that scope_priorities.json is indeed a scored recommendation ranking and not the authoritative scope registry — so those findings were false positives. The internal/registry/meta_data.json file is not present in the sandbox environment (it appears to be outside the public repo boundary), but I accept your correction.

Re-review of skills/lark-im/SKILL.md:

The changes are accurate and consistent with the rest of the document:

  • Placement: ### chat.user_setting is correctly grouped after ### chat.members, keeping all chat.* sub-resources together.
  • batch_query entry: correctly documents both mute fields (is_muted, is_mute_at_all), the 10-chat limit, user-only identity, and chat membership requirement.
  • batch_update entry: same constraints documented consistently.
  • Permissions table: entries are placed in the correct position (after chat.members.*, before messages.*), and the scope names follow the established pattern:
    • im:chat.user_setting:read for batch_query
    • im:chat.user_setting:write for batch_update ✅ (absence of _only suffix is consistent with other write scopes like im:chat:update)

No issues found. The documentation is well-structured and correct.


✏️ Learnings added
Learnt from: shifengjuan-dev
URL: https://github.com/larksuite/cli/pull/1339

Timestamp: 2026-06-09T06:02:02.337Z
Learning: In the larksuite/cli repository, `internal/registry/scope_priorities.json` is a scored recommendation ranking for scopes — it is NOT the authoritative scope registry. The authoritative registry is `internal/registry/meta_data.json`. Scope validation should use `meta_data.json`, not `scope_priorities.json`. A scope absent from `scope_priorities.json` may still be valid if present in `meta_data.json`.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

@shifengjuan-dev
shifengjuan-dev force-pushed the feat/im-chat-user-setting branch from c32eed3 to ab2a7fb Compare June 11, 2026 07:21
Add the chat.user_setting resource (per-user mute prefs: is_muted /
is_mute_at_all, user-only, <=10 chats per call) to the lark-im skill's
API Resources list and permission table, exposing batch_query / batch_update
via the generic im gateway.

Change-Id: Ifdd163bfa1cdbfcb56cbf12a3f52e40b61d85e2d
@shifengjuan-dev
shifengjuan-dev force-pushed the feat/im-chat-user-setting branch from ab2a7fb to 2bcd46f Compare June 11, 2026 08:24
@YangJunzhou-01
YangJunzhou-01 merged commit ae35b35 into larksuite:main Jun 11, 2026
18 checks passed
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/M Single-domain feat or fix with limited business impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants