feat: Enhance chat prompt construction with prior findings and new ch… - #55
Merged
Conversation
…anges diff - Updated `constructChatPromptText` to prefer `priorFindings` over full `diff` for efficiency. - Added handling for `newChangesDiff` to ensure fresh commits are considered. - Improved context sections in the prompt for better clarity. feat: Introduce file review prompt for individual file analysis - Created `constructFileReviewPromptText` to handle per-file reviews in a structured manner. - Included context about the file, author, and related local context for better analysis. feat: Implement merge review prompt for synthesizing findings - Added `constructMergeReviewPromptText` to aggregate per-file results into a final review. - Ensured the output adheres to a consistent JSON structure for downstream processing. refactor: Centralize tone instructions for consistent feedback - Created `getToneInstructions` to standardize tone and language guidance across prompts. - Removed redundant tone instructions from individual prompts. feat: Add concurrency utility for managing adapter requests - Implemented `mapWithConcurrency` to limit concurrent requests and prevent rate-limiting issues. feat: Introduce context budget management for diff character limits - Replaced fixed character limits with a dynamic budget based on model context windows. - Added functions to estimate tokens and fit findings to budget constraints. feat: Implement local git context helpers for diff and file management - Created functions to fetch local diffs, check reviewable files, and build a repo map. - Added support for extracting signatures from files to enhance context during reviews. test: Add comprehensive tests for concurrency, context budget, and git context utilities - Implemented tests for `mapWithConcurrency`, `contextBudget`, and `gitContext` functionalities. - Ensured coverage for edge cases and expected behaviors in various scenarios.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…anges diff
constructChatPromptTextto preferpriorFindingsover fulldifffor efficiency.newChangesDiffto ensure fresh commits are considered.feat: Introduce file review prompt for individual file analysis
constructFileReviewPromptTextto handle per-file reviews in a structured manner.feat: Implement merge review prompt for synthesizing findings
constructMergeReviewPromptTextto aggregate per-file results into a final review.refactor: Centralize tone instructions for consistent feedback
getToneInstructionsto standardize tone and language guidance across prompts.feat: Add concurrency utility for managing adapter requests
mapWithConcurrencyto limit concurrent requests and prevent rate-limiting issues.feat: Introduce context budget management for diff character limits
feat: Implement local git context helpers for diff and file management
test: Add comprehensive tests for concurrency, context budget, and git context utilities
mapWithConcurrency,contextBudget, andgitContextfunctionalities.