test(discord): regression coverage for PR #51 thread binding and agent sort - #64
Conversation
…agent sort Codex review of #51 flagged two fixes as merged without direct regression tests. Adds coverage for both (tests only, no source changes): - Fix 2 (parent-channel binding): new discord-channelsDb.test.ts unit tests for getChannelInfoForInteraction — direct binding, thread fallback to parent, thread binding taking precedence, and the unbound/no-parentId/no-channel edge cases. Plus an integration test covering the auto-run autocomplete path, which had no coverage (gist already had one). - Fix 4 (sorted agents): asserts /agents autocomplete orders by name, and that sorting happens before the 25-choice Discord cap so the alphabetically-first agents survive truncation. Verified by mutation: reverting either fix fails these tests. Suite: 268 passing (was 258). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe pull request adds tests for alphabetical agent autocomplete ordering, Discord’s 25-choice limit, thread parent-channel fallback, binding precedence, unresolved channels, and auto-run autocomplete resolution. ChangesAutocomplete and channel resolution
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install timed out. The project may have too many dependencies for the sandbox. 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 |
Follow-up to #51 (merged as
77245d2). Codex review flagged two of the four fixes as merged without direct regression tests. This adds them.Tests only — no source changes.
Fix 2 — parent-channel binding in threads
New
src/__tests__/discord-channelsDb.test.tsunit-testsgetChannelInfoForInteraction:parentId/ interaction with no channelPlus an integration test in
auto-run-command.test.tscovering the/auto-runautocomplete path — this was the genuinely uncovered one. (gistalready had an equivalent test.)Fix 4 — sorted agents list
In
agents-command.test.ts:/agentsautocomplete orders results by name, not input orderVerification
Mutation-tested: reverting either fix in the source makes these tests fail (confirmed 5 failures, then restored). Not just passing tests — tests that actually bite.
Suite: 268 passing, up from 258.
🤖 Generated with Claude Code
Summary by CodeRabbit