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

fix(autofix): Smorgasbord #1982

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft

fix(autofix): Smorgasbord #1982

wants to merge 9 commits into from

Conversation

roaga
Copy link
Member

@roaga roaga commented Feb 21, 2025

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

@roaga roaga requested a review from jennmueng February 21, 2025 23:34
Comment on lines 147 to 156
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)}"
)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

autocorrect repo names

Comment on lines +108 to +123
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."
Copy link
Member Author

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/>.",
Copy link
Member Author

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

Comment on lines 427 to 438
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"],
Copy link
Member Author

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.",
Copy link
Member Author

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

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

Successfully merging this pull request may close these issues.

1 participant