fix(contact): stop bot match segments carrying tags or empty entries - #2115
Conversation
📝 WalkthroughWalkthroughBot search requests now share scope-filter construction, omit empty filters, strip highlight tags consistently, and expand cancellation and parsing tests. Related contact documentation and permission guidance are updated. ChangesBot search behavior
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 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 |
The non-greedy highlight pattern can pair a stray `<h>` with the next `</h>`, leaving a tag inside the capture, so a match segment could read differently from the name and description it came from. Strip segments the same way, and drop a blank highlight instead of appending an empty string. - share one buildBotSearchFilter across --query and --queries, replacing two copies of the same logic and keeping "nil filter means no scope" explicit - cover the fanout scheduler's cancellation branch - point the +search-bot affordance at its skill reference - correct the 41050 recovery path, which told the reader to switch to a bot identity even though +search-bot is user-only
76cd5f5 to
fb22bf6
Compare
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@fb22bf693731ba9513076ed4618f8dc1e8ab9178🧩 Skill updatenpx skills add larksuite/cli#fix/search-bot-followup -y -g |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/contact/contact_search_bot_fanout_test.go`:
- Around line 522-549: The test’s cancellation can occur before all fanout
workers are occupied, so it does not reliably exercise queued-query
cancellation. Update TestBotFanoutCancelledSchedulingFailsQueuedQueries to
signal once from each blocked OnMatch handler, wait for fanoutConcurrency
signals before cancelling, and retain the timeout safeguard to prevent parked
workers.
🪄 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 Plus
Run ID: 5e7819b8-2612-4ae2-93d6-34cee195c17c
📒 Files selected for processing (7)
affordance/contact.mdshortcuts/contact/contact_search_bot.goshortcuts/contact/contact_search_bot_fanout.goshortcuts/contact/contact_search_bot_fanout_test.goshortcuts/contact/contact_search_bot_test.goshortcuts/contact/contact_search_user_test.goskills/lark-contact/SKILL.md
🚧 Files skipped from review as they are similar to previous changes (2)
- affordance/contact.md
- skills/lark-contact/SKILL.md
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2115 +/- ##
=======================================
Coverage 75.25% 75.25%
=======================================
Files 916 916
Lines 97173 97167 -6
=======================================
- Hits 73123 73121 -2
+ Misses 18437 18433 -4
Partials 5613 5613 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
Follow-up to #2083. These changes were made after that PR's head was snapshotted for the squash merge, so they never reached
main.Changes
<h>tags or empty entries — the non-greedy highlight pattern can pair a stray<h>with the next</h>, leaving a tag inside the capture.buildBotSearchFiltershared by--queryand--queries, replacing two copies of the same logic.+search-botaffordance points at its skill reference; the 41050 recovery path no longer suggests switching to a bot identity for a user-only command.Test Plan
go test ./shortcuts/contact/...,go vet,gofmt,skill-format-checkall pass--dry-runconfirms the shared filter builder is behavior-preserving: no scope flags omitsfilterentirely, and--has-chattedyields the same filter for both flagsRelated Issues
Summary by CodeRabbit
New Features
Bug Fixes
Documentation