-
Notifications
You must be signed in to change notification settings - Fork 297
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
Inline Fix: Improve response quality #376
Conversation
lib/shared/src/chat/recipes/fixup.ts
Outdated
- You will be provided with code that is below the users' selection, enclosed in <belowCode></belowCode> XML tags. You can use this code, if relevant, to help you plan your rewritten code. | ||
- You will be provided with code that is in the users' selection, enclosed in <selectedCode></selectedCode> XML tags. You must use this code to help you plan your rewritten code. | ||
- You will be provided with instructions on how to modify this code, enclosed in <instructions></instructions> XML tags. You must follow these instructions carefully and to the letter. | ||
- Enclose your response in <selection></selection> XML tags. Do not provide anything else. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This kind of approach (being very specific by naming the XML tags) is taken from examples in the Anthropic docs. Seems to work well from my testing.
lib/shared/src/chat/recipes/fixup.ts
Outdated
Only provide me with the replacement <selection> and nothing else. | ||
If it doesn't make sense, you do not need to provide <selection>. Instead, tell me how I can help you to understand my request. | ||
- You are an AI programming assistant who is an expert in rewriting code to meet given instructions. | ||
- You should think step-by-step to plan your rewritten code before producing the final output. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to work well with Claude, docs
/** | ||
* The test intent is unique in that we likely want to be much more specific in that context that we retrieve. | ||
* TODO(umpox): How can infer the current testing dependencies, etc? | ||
*/ | ||
case 'test': | ||
// Currently the same as add|edit|fix | ||
return getContextMessagesFromSelection( | ||
selection.selectedText, | ||
truncatedPrecedingText, | ||
truncatedFollowingText, | ||
selection, | ||
context.codebaseContext | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abeatrix Am I correct in that you have been looking at improving the test flows? Interested to see if you've found any specific context gathering to be useful
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still wip and got pulled into replacing recipes with commands but I did! I'll share what I have first thing tomorrow since I'm afk atm
@@ -66,6 +68,26 @@ export function populateCurrentEditorSelectedContextTemplate( | |||
) | |||
} | |||
|
|||
const DIAGNOSTICS_CONTEXT_TEMPLATE = `Use the following {type} from the code snippet in the file \`{filePath}\` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
92326b0
to
137b4d2
Compare
Description
This PR improves the inline
/fix
workflow by:fast
model to detect intent from the user. Seems to work well from my experience but open to suggestions. I think eventually (once we have a better command UX) we'll want to use this primarily as a fallback and encourage users to use slash commands first.FixupQualityImprovements.mov
Test plan
Lots of manual testing on inline fixups.