fix: use instance prompt variable for user prompt in code suggestions#2270
Open
wishhyt wants to merge 1 commit intoqodo-ai:mainfrom
Open
fix: use instance prompt variable for user prompt in code suggestions#2270wishhyt wants to merge 1 commit intoqodo-ai:mainfrom
wishhyt wants to merge 1 commit intoqodo-ai:mainfrom
Conversation
The system prompt correctly uses `self.pr_code_suggestions_prompt_system` (which respects the `decouple_hunks` configuration), but the user prompt was hardcoded to `get_settings().pr_code_suggestions_prompt.user`, always using the decoupled variant. When `decouple_hunks` is False, this creates a mismatch between system and user prompts. Use the instance variable `self.pr_code_suggestions_prompt_user` instead. Made-with: Cursor
Contributor
Review Summary by QodoFix user prompt to respect decouple_hunks configuration
WalkthroughsDescription• Fix user prompt to respect decouple_hunks configuration • Use instance variable instead of hardcoded settings • Align user prompt with system prompt behavior Diagramflowchart LR
A["get_settings().pr_code_suggestions_prompt.user<br/>(hardcoded, always decoupled)"] -->|replaced with| B["self.pr_code_suggestions_prompt_user<br/>(respects decouple_hunks config)"]
C["System prompt<br/>(uses instance variable)"] -->|now aligned with| B
File Changes1. pr_agent/tools/pr_code_suggestions.py
|
Contributor
Code Review by Qodo
1. No pytest for prompt change
|
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.
Summary
Changes
pr_agent/tools/pr_code_suggestions.py: Changed to use self.pr_code_suggestions_prompt_user instead of get_settings().pr_code_suggestions_prompt.user
Test plan