Skip to content

fix(im): unpin search identity after bot support landed - #2208

Merged
YangJunzhou-01 merged 1 commit into
mainfrom
fix/im-search-affordance-dual-identity
Aug 6, 2026
Merged

fix(im): unpin search identity after bot support landed#2208
YangJunzhou-01 merged 1 commit into
mainfrom
fix/im-search-affordance-dual-identity

Conversation

@liangshuo-1

@liangshuo-1 liangshuo-1 commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

main unit tests are red since #2194 (b546516b) and stay red on 50b4c688, blocking every open PR (e.g. #2203). #2194 extended im +messages-search to AuthTypes: {"user", "bot"} but did not update the affordance example or the skill reference, both of which still assert user-only. This PR closes that gap.

The failing assertion:

--- FAIL: TestAllIMShortcutsUseAffordanceExamples/+messages-search
    shortcuts/im/affordance_migration_test.go:53:
    dual-identity shortcut example must leave identity to user intent:
    lark-cli im +messages-search --as user --query "project progress"

Bisect over main: 960bdf6d (#2199, added the guard) ok → fcdef499 ok → b546516b (#2194) FAIL50b4c688 FAIL. main's own push CI shows the same transition. #2194's PR checks were green because its run (31003425323, run_attempt=3) was created at 2026-08-05T11:55Z against base_sha=0848a5b4, a tree that predates #2199 — the re-run reused that stale merge ref, so the new guard never executed.

Changes

  • affordance/im.md: drop --as user from the +messages-search example and the stale "user-only" wording. Nothing is added in their place — which identities a shortcut accepts is already structured metadata.
  • internal/affordance/im_source_test.go: update the audited example and remove the now-unused explicit-user derivation, whose whole job was asserting the source doc said "User identity only".
  • skills/lark-im/references/lark-im-messages-search.md: delete the header callout "User identity only. Bot identity is not supported." and correct the --as row in the flag table. Both contradicted the code and line 166 of the same file, which feat: support bot identity for search shortcuts #2194 updated to tell agents to run --as bot. The callout is deleted rather than reworded: identity support is already carried by --as and the shortcut metadata, and generic "do not pin --as" guidance belongs in lark-shared, not in every reference.
  • skills/lark-im/references/lark-im-message-enrichment.md: drop "user-only" from the scope note describing the search command's Scopes field.

No production code changes — AuthTypes and the search behaviour from #2194 are untouched.

Test Plan

  • go test -race -count=1 ./cmd/... ./internal/... ./shortcuts/... ./extension/... — all green (reproduced the failure on clean 50b4c688 first)
  • node scripts/skill-format-check/index.js — passed
  • gofmt/go vet clean on touched packages
  • Swept every --as user in affordance/im.md against each shortcut's AuthTypes: the remaining ones are genuinely user-only (+flag-*, +feed-*) or raw API commands not covered by the guard

Related Issues

Summary by CodeRabbit

  • New Features

    • Message search now supports both user and bot identities.
    • Searches can use the configured identity without requiring an explicit identity option.
  • Documentation

    • Updated message search guidance and examples to reflect the available identity options.
    • Clarified when to specify a user or bot identity.
    • Updated scope documentation and audit examples for identity-based searches.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 04479528-a510-4178-827d-72ad55433419

📥 Commits

Reviewing files that changed from the base of the PR and between 426f80f and 89429b4.

📒 Files selected for processing (4)
  • affordance/im.md
  • internal/affordance/im_source_test.go
  • skills/lark-im/references/lark-im-message-enrichment.md
  • skills/lark-im/references/lark-im-messages-search.md
🚧 Files skipped from review as they are similar to previous changes (4)
  • skills/lark-im/references/lark-im-message-enrichment.md
  • skills/lark-im/references/lark-im-messages-search.md
  • internal/affordance/im_source_test.go
  • affordance/im.md

📝 Walkthrough

Walkthrough

+messages-search now uses the configured identity by default and documents support for user and bot identities. The affordance audit no longer requires or materializes --as user.

Changes

Message search identity

Layer / File(s) Summary
Message search identity guidance
affordance/im.md, skills/lark-im/references/lark-im-message-enrichment.md, skills/lark-im/references/lark-im-messages-search.md
Documentation now describes configured identities, shared scopes, and user or bot values for --as.
Affordance audit alignment
internal/affordance/im_source_test.go
The audit command omits --as user, and the explicit-user derivation validation was removed.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • larksuite/cli#2194: Updates +messages-search to support bot identity in the underlying shortcut behavior.
  • larksuite/cli#2199: Updates related +messages-search documentation and source validation.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: removing the fixed user identity from IM search after bot support was added.
Description check ✅ Passed The description includes complete Summary, Changes, Test Plan, and Related Issues sections with relevant motivation, scope, and validation details.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/im-search-affordance-dual-identity

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.

@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 Aug 6, 2026
@liangshuo-1
liangshuo-1 force-pushed the fix/im-search-affordance-dual-identity branch from 9b21b53 to 00031fa Compare August 6, 2026 07:14
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

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

🧩 Skill update

npx skills add larksuite/cli#fix/im-search-affordance-dual-identity -y -g

#2194 extended `im +messages-search` to `AuthTypes: {user, bot}` but left the
affordance example and the skill reference asserting user-only, so the
dual-identity guard added by #2199 fails on main.

sa: safe
doc: affordance/im.md, skills/lark-im
cfg: none
test: go test -race ./cmd/... ./internal/... ./shortcuts/... ./extension/...
@liangshuo-1
liangshuo-1 force-pushed the fix/im-search-affordance-dual-identity branch from 00031fa to 89429b4 Compare August 6, 2026 07:18
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.08%. Comparing base (fcdef49) to head (89429b4).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2208      +/-   ##
==========================================
- Coverage   76.10%   76.08%   -0.03%     
==========================================
  Files         983      983              
  Lines      103079   103429     +350     
==========================================
+ Hits        78448    78692     +244     
- Misses      18694    18752      +58     
- Partials     5937     5985      +48     

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

@YangJunzhou-01
YangJunzhou-01 merged commit 9759167 into main Aug 6, 2026
29 of 43 checks passed
@YangJunzhou-01
YangJunzhou-01 deleted the fix/im-search-affordance-dual-identity branch August 6, 2026 07:37
zkh-bytedance pushed a commit that referenced this pull request Aug 6, 2026
#2194 extended `im +messages-search` to `AuthTypes: {user, bot}` but left the
affordance example and the skill reference asserting user-only, so the
dual-identity guard added by #2199 fails on main.

Co-authored-by: TRAE CLI <traecli@bytedance.com>
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