-
Notifications
You must be signed in to change notification settings - Fork 196
fix(ask_sb): Fix issue with ambiguous references #393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThis change refactors the file reference format throughout the chat feature, replacing the single Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant ChatUI
participant ReferenceParser
participant Utils
participant Renderer
User->>ChatUI: Submits message with file reference
ChatUI->>ReferenceParser: Extract file references
ReferenceParser->>Utils: Parse repo and path from message
Utils-->>ReferenceParser: Return FileReference {repo, path, range}
ReferenceParser-->>ChatUI: Annotated message parts
ChatUI->>Renderer: Render message with references
Renderer->>Utils: Format reference with repo and path
Utils-->>Renderer: Formatted reference string
Renderer-->>ChatUI: Display message with repository-qualified references
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~18 minutes Poem
Note ⚡️ Unit Test Generation - BetaCodeRabbit's unit test generation is now available in Beta! Automatically generate comprehensive unit tests for your code changes, ensuring better test coverage and catching edge cases you might miss. Our AI analyzes your code structure and creates tests that follow best practices and your project's testing patterns. Learn more here, or just try it under ✨ Finishing Touches. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (10)
🧰 Additional context used📓 Path-based instructions (1)**/*📄 CodeRabbit Inference Engine (.cursor/rules/style.mdc)
Files:
🧠 Learnings (1)packages/web/src/features/chat/utils.test.ts (2)Learnt from: brendan-kellam Learnt from: brendan-kellam 🧬 Code Graph Analysis (1)packages/web/src/features/chat/types.ts (1)
🔇 Additional comments (21)
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
@brendan-kellam your pull request is missing a changelog! |
We were hitting a bug where the LLM was not including enough information about a reference in order for it to be accurately resolved (hence ambiguous reference). This happened under two circumstances:
The LLM does not include enough of a path to distinguish two files with the same name. This might happen if repo X has two README.md files, a/README.md and b/README.md. If the LLM only uses
@file:{README.md}in it's reference, then it's not clear what README.md it is referencing.There are files with the same exact name and path, but are in different repos. For example,
README.mdin repo X andREADME.mdin repo Y have the same path and name, so@file:{README.md}is not clear what README.md it is referencing.This PR addresses the second reason by instructing the LLM to include the repository name when referencing a file.
Summary by CodeRabbit
New Features
Bug Fixes
Tests
Style