feat(im): add --chat-mode topic to +chat-create#790
feat(im): add --chat-mode topic to +chat-create#790shifengjuan-dev wants to merge 1 commit intolarksuite:mainfrom
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
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 (5)
✅ Files skipped from review due to trivial changes (3)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds a ChangesTopic Chat Mode Support
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Possibly related PRs
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)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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 |
5dcb2ef to
414ed1d
Compare
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
414ed1d to
a175794
Compare
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai the Docstring Coverage check reports 71.43% (5/7). Could you list the specific functions that are counted in scope and which ones are missing docstrings? Please give file:line references so I can fix them precisely. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 43422 Let me check the actual PR diff to pinpoint exactly which functions were added or modified, since the coverage tool likely scopes to diff-touched functions. 🏁 Script executed: Length of output: 6386 🏁 Script executed: Length of output: 40133 🏁 Script executed: Length of output: 14123
Functions/symbols in the PR diff — docstring status
That accounts for 5/6 directly touched symbols. The tool's 7th entry is most likely one of the undocumented helpers visible in
Suggested fixesFor // TestShortcutDryRunShapes verifies that each shortcut's DryRun function
// produces the expected API path, query parameters, and request body.
func TestShortcutDryRunShapes(t *testing.T) {For // mustMarshalDryRun marshals v to a JSON string, calling t.Fatalf on error.
func mustMarshalDryRun(t *testing.T, v interface{}) string {
|
a175794 to
12deb62
Compare
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Adds --chat-mode group|topic so users and AI agents can create 话题群 (topic chats) directly via the CLI. Default remains group; chat_mode is now always emitted in the POST /open-apis/im/v1/chats request body. Without this, "create a topic chat" requests would silently fall back to a normal conversation group. - shortcuts/im/im_chat_create.go: new --chat-mode flag (Enum, default group); buildCreateChatBody always emits chat_mode and defensively falls back to "group" when the value is empty (validateEnumFlags skips empty strings, so an explicit `--chat-mode ""` would otherwise reach the wire with unspecified server semantics); Description updated for AI-agent discoverability. - shortcuts/im/builders_test.go: extended TestBuildCreateChatBody; added TestBuildCreateChatBody_TopicMode and TestBuildCreateChatBody_EmptyChatModeFallsBack; updated TestShortcutDryRunShapes/ImChatCreate to register and assert chat_mode. - skills/lark-im/SKILL.md: added 创建群聊或话题群 to trigger keywords; +chat-create row references --chat-mode. - skills/lark-im/references/lark-im-chat-create.md: extended intro paragraph; added topic-chat example; added --chat-mode parameter row; added disambiguation block clarifying 话题群 (chat_mode=topic) vs 普通群+话题消息模式 (group_message_type=thread). - CHANGELOG.md: [Unreleased] Features entry. Change-Id: I79385e2e8606f84e3f27de240d1b41037bf51261
12deb62 to
f7c6bf2
Compare
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Summary
Adds
--chat-mode group|topictolark-cli im +chat-createso users and AI agents can create 话题群 (topic chats) directly via the CLI. Without this, requests to create a topic chat silently fall back to a normal conversation group. Default remainsgroup;chat_modeis now always emitted in thePOST /open-apis/im/v1/chatsrequest body.Changes
shortcuts/im/im_chat_create.go: new--chat-mode group|topicflag (Enum, defaultgroup); always emitchat_modeinbuildCreateChatBody; updatedDescriptionso AI agents discover the new capability.shortcuts/im/builders_test.go: extendedTestBuildCreateChatBody; addedTestBuildCreateChatBody_TopicMode; updatedTestShortcutDryRunShapes/ImChatCreateto register and assertchat_mode.skills/lark-im/SKILL.md: added创建群聊或话题群to trigger keywords; updated+chat-createrow to reference--chat-mode.skills/lark-im/references/lark-im-chat-create.md: extended intro paragraph; added a topic-chat example; added--chat-moderow in Parameters; added a self-contained disambiguation block clarifying 话题群 (chat_mode=topic) vs 普通群+话题消息模式 (group_message_type=thread).CHANGELOG.md:[Unreleased]Features entry.Note:
chat_mode=topicis not in the public OpenAPI doc (which says topic chats must be created via the Feishu client) but is verified to work end-to-end against a real tenant — see Test Plan.Test Plan
make unit-testpassesgo vet ./...cleangofmt -l .emptygo mod tidyno diff in go.mod / go.sumgolangci-lint --new-from-rev=upstream/mainreports 0 issueslark-cli im +chat-create --name X --chat-mode topic --type publiccreates a real 话题群 in the Feishu client (verified by lighting up the resultingchat_idin the client)--chat-modestill produces a normal group (backward-compatible default)"chat_mode":"topic"(and"chat_mode":"group"for the default case)Related Issues
Summary by CodeRabbit
New Features
Documentation
Tests
Changelog