Skip to content
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

In-line PR comments sometimes request redundant changes #137

Closed
KalleV opened this issue Jul 25, 2023 · 8 comments
Closed

In-line PR comments sometimes request redundant changes #137

KalleV opened this issue Jul 25, 2023 · 8 comments

Comments

@KalleV
Copy link

KalleV commented Jul 25, 2023

I’m fairly often seeing this type of PR feedback where the change already being applied is added as the PR feedback comment:
image

Another seemingly consistent way to reproduce this seems to be when adding try / catch around a code block that did not have it before.

@okotek
Copy link
Contributor

okotek commented Jul 25, 2023

Do you have a public PR you can share with this behavior?

@KalleV
Copy link
Author

KalleV commented Jul 25, 2023

I can try to set up a reproduction of this issue but I can see the prompts are clearly trying to avoid this already:

- Make sure not to provide suggestions repeating modifications already implemented in the new PR code (the '+' lines).

Do you think tweaking that instruction or its placement would make a difference? Something like:

- It is essential to avoid suggesting changes that mirror modifications already introduced in the new PR code (the '+' lines). Ensure that your feedback brings new insights and does not reiterate the changes already incorporated in the PR.

@okotek
Copy link
Contributor

okotek commented Jul 25, 2023

Cc @mrT23

@mrT23
Copy link
Collaborator

mrT23 commented Jul 25, 2023

@KalleV It's tempting to use longer and longer prompts to try and fix cases that didn't work 100% well.
Usually, there are better ways to go.

You can try your modified prompt on the bad cases you saw. Did it improve ?

To try improve the prompting for this specific issue, I would focus on a different aspect -further explain to the model what are the '+' lines. Maybe be a specific example, simulating a hunk in the prompt, would help
(similar to

)

(If you prefer, share a public example that gave bad results, and I will try an improved prompt)

@KalleV KalleV changed the title In-line PR comments request redundant changes In-line PR comments sometimes request redundant changes Jul 25, 2023
@KalleV
Copy link
Author

KalleV commented Jul 26, 2023

I wasn't able to create a minimum public reproduction yet but I came across a PR consistently requesting a try/catch. Not sure if the PR size makes a big difference but according to https://llmtokencounter.com/, the system prompt + user prompt is about 4801 tokens 19205 characters 5004 words.

I couldn't consistently prove small tweaks such as:

+ - It is essential to avoid suggesting changes that mirror modifications already introduced in the new PR code (the '+' lines).
- - Make sure not to provide suggestions repeating modifications already implemented in the new PR code (the '+' lines).

Or rearranging the system instructions led to a consistently better response but it was fun to try!

@mrT23
Copy link
Collaborator

mrT23 commented Jul 26, 2023

ok.

notice that the '/improve' tool works differently in terms of patch and prompt design, and I think it will happen less there, so you can you it instead

@mrT23
Copy link
Collaborator

mrT23 commented Jul 29, 2023

I am closing this issue. if you encounter this again in the '/improve' command, feel free to open another

@mrT23 mrT23 closed this as completed Jul 29, 2023
@KalleV
Copy link
Author

KalleV commented Jul 29, 2023

Sounds good, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants