| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
`convertLLMOutputToPortableMarkdown` was not passing `revisionName` to `getBrowsePath`, so every copied citation link silently resolved to the repo's default branch — even when the source was attached at a non-HEAD revision. Plumb file sources through both callsites so the conversion can resolve each reference to its source and use that source's revision. Also tighten `get_diff` source emission: one source per path at head for added/modified files, base for deletes, both sides for renames. The old behavior emitted a duplicate unreachable source at base for every modified file that the reference resolver would have picked first. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
WalkthroughFile citations from the get_diff tool are now reliably citable in chat answers by threading source metadata through the markdown conversion pipeline. The getDiff tool builds a sources array from diff files, askCodebase extracts file sources from message parts, and the markdown converter resolves @file... references using those sources to generate accurate link text and revision-aware browse URLs. ChangesSource-aware file reference resolution in chat answers
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches 📝 Generate docstrings
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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. ❤️ ShareComment @coderabbitai help to get the list of available commands and usage tips. |
Sorry, something went wrong.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)packages/web/src/features/chat/utils.ts (1)🤖 Prompt for all review comments with AI agents377-382: 💤 Low value
Consider more precise matching logic.
The current implementation uses endsWith for both repo and path matching, which could lead to ambiguous matches when multiple files share the same basename or repos share name suffixes. For example, source.path.endsWith("bar.ts") would match both "foo/bar.ts" and "baz/bar.ts".
While this fuzzy matching may be intentional to handle variations in how the LLM references files, consider whether exact matching (or at least full path comparison) would be more robust.
🤖 Prompt for AI AgentsVerify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/web/src/features/chat/utils.ts` around lines 377 - 382, The tryResolveFileReference function currently uses endsWith for both source.repo and source.path which yields ambiguous matches; update the matching logic in tryResolveFileReference (and consider FileReference/FileSource shapes) to first attempt exact/full-path matches (source.repo === reference.repo and source.path === reference.path) and only if none found fall back to a deliberate, documented fuzzy strategy (e.g., basename equality or suffix match) to avoid accidental collisions; ensure you reference the function name tryResolveFileReference and the types FileReference and FileSource when making the change and keep the fallback behavior explicit and tested.
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 `@packages/web/src/features/mcp/askCodebase.ts`: - Around line 199-204: The chained flatMap/filter/map loses TypeScript's discriminated-union narrowing for the file sources; add an explicit type guard (e.g., declare isFileSource = (s: Source): s is FileSource => s.type === 'file') and use that predicate in the final filter when building fileSources from finalMessages so fileSources is correctly typed before passing into convertLLMOutputToPortableMarkdown; ensure the predicate references the same Source/FileSource types used elsewhere so the compiler can narrow the type. --- Nitpick comments: In `@packages/web/src/features/chat/utils.ts`: - Around line 377-382: The tryResolveFileReference function currently uses endsWith for both source.repo and source.path which yields ambiguous matches; update the matching logic in tryResolveFileReference (and consider FileReference/FileSource shapes) to first attempt exact/full-path matches (source.repo === reference.repo and source.path === reference.path) and only if none found fall back to a deliberate, documented fuzzy strategy (e.g., basename equality or suffix match) to avoid accidental collisions; ensure you reference the function name tryResolveFileReference and the types FileReference and FileSource when making the change and keep the fallback behavior explicit and tested.
Fix all unresolved CodeRabbit comments on this PR:
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 627c51e7-16ff-44bd-97f0-0eb64826c793
📥 CommitsReviewing files that changed from the base of the PR and between d5ad64c and e5ef1c5.
📒 Files selected for processing (6)
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
🤖 Generated with Claude Code