You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains 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
…tion settings
- Added detailed documentation on the dynamic context strategy in `dynamic_context.md`.
- Updated configuration settings in `configuration.toml` to enable dynamic context by default.
- Adjusted context line parameters in `additional_configurations.md` to reflect new defaults.
- Announced dynamic context as the default option in the `README.md` news section.
Add an example to illustrate the asymmetric context strategy
Consider adding a brief example or use case to illustrate how the asymmetric and dynamic context strategy works in practice. This will help readers better understand the concept.
**Asymmetric:**
We start by recognizing that the context preceding a code change is typically more crucial for understanding the modification than the context following it.
Consequently, PR-Agent implements an asymmetric context policy, decoupling the context window into two distinct segments: one for the code before the change and another for the code after.
-By independently adjusting each context window, PR-Agent can supply the model with a more tailored and pertinent context for individual code changes.+By independently adjusting each context window, PR-Agent can supply the model with a more tailored and pertinent context for individual code changes. +For example, when analyzing a change within a function, PR-Agent might provide more context lines before the change to include the function signature and any relevant variable declarations, while limiting the context after the change to focus on the immediate impact of the modification.+
Apply this suggestion
Suggestion importance[1-10]: 9
Why: Adding a practical example significantly improves the understanding of the asymmetric context strategy, making the concept more concrete for readers.
9
Add explanation of how dynamic context improves code understanding
Consider adding a brief explanation of how the dynamic context strategy improves the model's understanding of code changes. This will help readers better grasp the benefits of this approach.
**Dynamic:**
-We also employs a "dynamic" context strategy.+We also employ a "dynamic" context strategy.
We recognize that the optimal context for a code change often corresponds to its enclosing code component (e.g., function, class), rather than a fixed number of lines.
Consequently, we dynamically adjust the context window based on the code's structure, ensuring the model receives the most pertinent information for each modification.
+This approach significantly enhances the model's ability to understand the purpose and impact of code changes within their functional context, leading to more accurate and insightful analyses.
Apply this suggestion
Suggestion importance[1-10]: 8
Why: The suggestion adds valuable information about the benefits of dynamic context, which enhances the documentation's clarity and usefulness.
8
Add guidance on customizing dynamic context behavior
Consider adding a brief explanation of how users can customize or fine-tune the dynamic context behavior if needed. This information would be valuable for advanced users who might want to adjust the strategy for their specific use cases.
[config]
patch_extension_skip_types =[".md",".txt"] # Skip files with these extensions when trying to extend the context
allow_dynamic_context=true # Allow dynamic context extension
max_extra_lines_before_dynamic_context = 8 # will try to include up to X extra lines before the hunk in the patch, until we reach an enclosing function or class
patch_extra_lines_before = 3 # Number of extra lines (+3 default ones) to include before each hunk in the patch
patch_extra_lines_after = 1 # Number of extra lines (+3 default ones) to include after each hunk in the patch
+Users can adjust these configuration options to fine-tune the dynamic context behavior. For instance, increasing `max_extra_lines_before_dynamic_context` will allow for more context to be included, which might be beneficial for complex codebases. However, be cautious as setting this value too high might lead to performance issues or overwhelm the model with unnecessary information.
+
Apply this suggestion
Suggestion importance[1-10]: 7
Why: This suggestion provides useful information for advanced users, enhancing the documentation's completeness, but it's not as critical as the previous two suggestions.
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.
PR Type
Enhancement, Documentation
Description
Changes walkthrough 📝
README.md
Update README with dynamic context announcement
README.md
dynamic_context.md
Add detailed documentation for dynamic context strategy
docs/docs/core-abilities/dynamic_context.md
additional_configurations.md
Update context extension configuration documentation
docs/docs/usage-guide/additional_configurations.md
configuration.toml
Update configuration to enable dynamic context
pr_agent/settings/configuration.toml