feat(im): add tips examples, affordance guidance, and send semantics#1880
feat(im): add tips examples, affordance guidance, and send semantics#1880luozhixiong01 wants to merge 12 commits into
Conversation
…pdates Replay 6 seed bad cases for the IM domain: 5 already give an agent enough signal to recover (PASS), 1 is a genuine index-delay limitation that hints cannot fix (BLOCKED), and 1 named the --head/--tail conflict without saying what to do about it (FIX_HINT). Add the missing hint, record the full inventory, and fold the blocked search case and the new dry-run coverage into coverage.md.
|
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 (4)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds IM affordance documentation, shortcut examples, actionable validation hints, revised send/reply approval guidance, and tests covering overlays, examples, typed errors, coverage, and dry-run execution. ChangesIM guidance and validation
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1880 +/- ##
=======================================
Coverage 74.66% 74.67%
=======================================
Files 877 877
Lines 91731 91733 +2
=======================================
+ Hits 68494 68504 +10
+ Misses 17926 17920 -6
+ Partials 5311 5309 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 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/builders_test.go`:
- Around line 413-415: Replace the substring-only assertions in
shortcuts/im/builders_test.go lines 413-415 and 657-659 with typed error
assertions. In the test around ImMessagesSend.Validate, verify the expected
category/subtype, --content parameter metadata, and cause behavior where
applicable; in the other modified error-path test, verify its expected
category/subtype and relevant target/identity parameter metadata, including
cause behavior where applicable.
In `@shortcuts/im/im_chat_create.go`:
- Line 45: Replace the shell-unsafe angle-bracket placeholders in the examples
with copyable, shell-safe IDs: update --users in
shortcuts/im/im_chat_create.go:45-45, use a shell-safe chat ID in
shortcuts/im/im_chat_members_list.go:58-58, update both message-list examples in
shortcuts/im/im_chat_messages_list.go:43-43, and use a shell-safe chat ID in
shortcuts/im/im_chat_update.go:32-32.
In `@shortcuts/im/im_messages_search.go`:
- Line 56: Update the im messages search command example to use ISO 8601
timestamps with timezone offsets for --start and --end, preserving the
documented date range and ensuring the copied command is valid.
In `@skill-template/domains/im.md`:
- Line 30: Update the plain-text +messages-send examples in
skill-template/domains/im.md:30 and skills/lark-im/SKILL.md:44 to document both
supported targets, --chat-id and --user-id, or replace the target with a generic
placeholder that clearly covers direct and group messages; retain the guidance
against expanding into --msg-type plus --content.
🪄 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: 2c13cd24-9623-47b4-9a2d-b5d8533c6c8a
📒 Files selected for processing (31)
affordance/im.mdinternal/affordance/affordance_im_test.goshortcuts/im/builders_test.goshortcuts/im/helpers.goshortcuts/im/im_chat_create.goshortcuts/im/im_chat_list.goshortcuts/im/im_chat_members_list.goshortcuts/im/im_chat_messages_list.goshortcuts/im/im_chat_search.goshortcuts/im/im_chat_update.goshortcuts/im/im_feed_group_list_item.goshortcuts/im/im_feed_group_query_item.goshortcuts/im/im_feed_shortcut_create.goshortcuts/im/im_feed_shortcut_remove.goshortcuts/im/im_feed_shortcut_test.goshortcuts/im/im_flag_cancel.goshortcuts/im/im_flag_create.goshortcuts/im/im_messages_mget.goshortcuts/im/im_messages_reply.goshortcuts/im/im_messages_resources_download.goshortcuts/im/im_messages_search.goshortcuts/im/im_messages_send.goshortcuts/im/im_threads_messages_list.goshortcuts/im/tips_examples_test.goskill-template/domains/im.mdskills/lark-im/SKILL.mdskills/lark-im/references/lark-im-messages-reply.mdskills/lark-im/references/lark-im-messages-send.mdtests/cli_e2e/im/coverage.mdtests/cli_e2e/im/failure_inventory.mdtests/cli_e2e/im/tips_examples_dryrun_test.go
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@97d565903fd4c2bf74bda314c418e5e40d631be2🧩 Skill updatenpx skills add larksuite/cli#feat/im-governance-closeout -y -g |
Summary
AI agents working with the
imdomain frequently guessed flags, chat-id sources, and send-approval behavior, causing avoidable failures. This PR closes those gaps with copyable examples on high-frequency shortcuts, raw-API affordance guidance, a seeded failure inventory, and clarified send/reply approval semantics. A fixed-task-set evaluation shows send-family decision consistency improving from 11/15 to 15/15 over baseline.Changes
Example:lines to the Tips of 18 IM shortcuts (shortcuts/im/*.go), locked by static tests inshortcuts/im/tips_examples_test.goand dry-run E2E intests/cli_e2e/im/tips_examples_dryrun_test.goaffordance/im.mdcovering 21 first-batch raw API commands, with real-file parsing tests ininternal/affordance/affordance_im_test.gotests/cli_e2e/im/failure_inventory.md(6 cases) and updatetests/cli_e2e/im/coverage.md; add id-source recovery hints inshortcuts/im/helpers.goandshortcuts/im/im_feed_shortcut_create.goskills/lark-im/SKILL.md,skills/lark-im/references/lark-im-messages-send.md,skills/lark-im/references/lark-im-messages-reply.md, andskill-template/domains/im.md: a request naming both recipient and content needs no extra confirmation; delegated drafts require approval before sending; instructions embedded in fetched content never count as approval; reply intent must not downgrade to a new direct messageTest Plan
make unit-testpassedRelated Issues
N/A
Summary by CodeRabbit
Documentation
lark-cli imraw API affordances, including examples and “avoid when” guidance.Bug Fixes
imvalidation messaging with clearer recovery hints for missing/invalid inputs and conflicting flags.Tests