-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
fix(autofix): Smorgasbord #1982
base: main
Are you sure you want to change the base?
Conversation
repo_names = [repo.full_name for repo in self.repos] | ||
if repo_name and repo_name not in repo_names: | ||
# Try to find a repo name that contains the provided one to autocorrect | ||
matching_repos = [r for r in repo_names if repo_name.lower() in r.lower()] | ||
if matching_repos: | ||
repo_name = min(matching_repos, key=lambda x: abs(len(x) - len(repo_name))) | ||
else: | ||
raise AgentError() from ValueError( | ||
f"Repo '{repo_name}' not found. Available repos: {', '.join(repo_names)}" | ||
) |
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.
autocorrect repo names
def format_missing_msg( | ||
missing_files: list[str], existing_files: list[str], correct_paths: list[str] | ||
): | ||
text = "" | ||
|
||
if correct_paths: | ||
text += ( | ||
f"The following code changes are formatted correctly: {', '.join(correct_paths)}\n" | ||
) | ||
text += "But..." | ||
if missing_files: | ||
text += f"The following files don't exist, yet you are trying to modify them: {', '.join(missing_files)}\n" | ||
if existing_files: | ||
text += f"The following files already exist, yet you are trying to create them: {', '.join(existing_files)}\n" | ||
text += "\nPlease fix the above issues and output your answer in the correct format again." | ||
|
||
text += "\nPlease fix the above issues by correcting the file paths or correcting the type (file_create, file_change, or file_delete) and output your answer in the correct format again. Re-write your WHOLE answer, including the already-correct changes." |
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.
make missing file fixer prompt clearer
@@ -65,7 +65,7 @@ def format_step_one( | |||
return textwrap.dedent(template).format( | |||
latest_thought=latest_thought, | |||
insights=" ".join(past_insights) if past_insights else "[paragraph is empty]", | |||
no_insight_instruction="If there is nothing insightful to add, just return <NO_INSIGHT/>", | |||
no_insight_instruction="If there is nothing SUPER IMPORTANT to add, just return <NO_INSIGHT/>.", |
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.
make insight cards a bit stricter
FunctionTool( | ||
name="file_search", | ||
fn=self.file_search, | ||
description="Searches for a file in the codebase.", | ||
description="Given a filename with extension returns the list of locations where a file with the name is found.", | ||
parameters=[ | ||
{ | ||
"name": "filename", | ||
"type": "string", | ||
"description": "The file to search for.", | ||
"description": "The filename with extension to search for.", | ||
}, | ||
], | ||
required=["filename"], |
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.
clarify tool so gemini doesn't get confused
@@ -486,7 +486,7 @@ def get_tools(self): | |||
FunctionTool( | |||
name="ask_a_question", | |||
fn=self.ask_user_question, | |||
description="Ask the codeowners a question about business logic, product requirements, past decisions, or subjective preferences. You may not ask about anything else.", | |||
description="Ask the user a question about business logic, product requirements, past decisions, or subjective preferences. You may not ask about anything else. Only use this tool if necessary.", |
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.
temporary bandaid to make questions less aggressive
much pain
eval up to 75% fixed, saved over a minute on latency (unless the old eval was extra slow for no reason)
i also tested all kinds of filtering out tests, and aider diff format, and both dropped evals