Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sweepai/agents/question_answerer.py
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ def done_file_search(

# Guidelines

1. Analyze the user's request to understand the information they are seeking. This may involve breaking the request down into smaller sub requests to identify the specific information needed. You may need to search for these smaller sub requests seperately.
1. Analyze the user's request to understand the information they are seeking. This may involve breaking the request down into smaller sub requests to identify the specific information needed. You may need to search for these smaller sub requests separately.
2. Use the search tools available to search the codebase for relevant code files that can help answer all of the user's requests.
3. When you are confident a code file is relevant to the user request, use the `add_file_to_context` tool to add a file to context to indicate that the file is useful and will be needed to fully resolve the user request.
4. A relevant file is defined to be any file needed to answer the user request. This includes code files that contain relevant typing/struct/constant definitions, utility functions, or any other code that is needed to answer the user request.
Expand Down
8 changes: 4 additions & 4 deletions sweepai/core/context_pruning.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ def build_full_hierarchy(
if length == 1
}
except Exception as e:
print("error occured while fetching successors:", e)
print("error occurred while fetching successors:", e)
return hierarchy
sorted_successors = sorted(successors)
for idx, child in enumerate(sorted_successors):
Expand All @@ -368,7 +368,7 @@ def build_full_hierarchy(
if length == 1
}
except Exception as e:
print("error occured while fetching predecessors:", e)
print("error occurred while fetching predecessors:", e)
return hierarchy
sorted_predecessors = sorted(predecessors)
for idx, parent in enumerate(sorted_predecessors):
Expand Down Expand Up @@ -543,7 +543,7 @@ def add_relevant_files_to_top_snippets(rcm: RepoContextManager) -> RepoContextMa
rcm.boost_snippets_to_top(code_snippets, code_files_in_query)
except Exception as e:
logger.error(
f"Tried to add code file found in query but recieved error: {e}, skipping and continuing to next one."
f"Tried to add code file found in query but received error: {e}, skipping and continuing to next one."
)
return rcm

Expand Down Expand Up @@ -790,7 +790,7 @@ def handle_function_call(
output = f"FAILURE: No results found for code_entity: {code_entity} in the entire codebase. Please try a new code_entity. Consider trying different whitespace or a truncated version of this code_entity."
except Exception as e:
logger.error(
f"FAILURE: An Error occured while trying to find the code_entity {code_entity}: {e}"
f"FAILURE: An Error occurred while trying to find the code_entity {code_entity}: {e}"
)
output = f"FAILURE: No results found for code_entity: {code_entity} in the entire codebase. Please try a new code_entity. Consider trying different whitespace or a truncated version of this code_entity."
elif function_name == "view_files":
Expand Down
2 changes: 1 addition & 1 deletion sweepai/core/on_comment_prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
</issue_sub_request>
<proposed_changes>
For each of the sub requests here, pinpoint the exact places to make changes. Describe exactly what to do, referencing specific code entities in the relevant files.
Break the above steps up into seperate actionable steps and number them.
Break the above steps up into separate actionable steps and number them.
Double check the state of the code base.
Example:
1. Step 1
Expand Down
2 changes: 1 addition & 1 deletion sweepai/core/planning_prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
</issue_sub_request>
<proposed_changes>
For each of the sub requests here, pinpoint the exact places to make changes. Describe exactly what to do, referencing specific code entities in the relevant files.
Break the above steps up into seperate actionable steps and number them.
Break the above steps up into separate actionable steps and number them.
Example:
1. Step 1
- Step 1a
Expand Down
2 changes: 1 addition & 1 deletion sweepai/core/pull_request_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
3. Group similar operations where applicable to avoid redundancy.
Your message must be directly related to the file changes stated. Avoid additional interpretation or detail not present in the input.

You will recieve a series of file diffs that need to be described in a short commit message.
You will receive a series of file diffs that need to be described in a short commit message.

Return your commit message in the following xml format:

Expand Down
6 changes: 3 additions & 3 deletions sweepai/core/review_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ def review_code_changes_by_file(
use_openai=True,
seed=seed
)
# make a seperate call for the special rules
# make a separate call for the special rules
# check if there are special rules we need to follow for this file by seeing if the files "SWEEP.md" exists
special_rules = self.get_special_rules(cloned_repo, file_names)
if special_rules:
Expand Down Expand Up @@ -1012,7 +1012,7 @@ def get_code_reviews_for_file(
)
return code_review_by_group

# run 5 seperate instances of review_pr and then group the resulting issues and only take the issues that appear the majority of the time (> 3)
# run 5 separate instances of review_pr and then group the resulting issues and only take the issues that appear the majority of the time (> 3)
def group_vote_review_pr(
username: str,
pr_changes: dict[str, PRChange],
Expand Down Expand Up @@ -1266,7 +1266,7 @@ def cluster_patches(pr_changes: dict[str, PRChange]):

# group key is the label, value is the list of file names to review together
groups_to_review_files_in: dict[str, list[str]] = {}
# split files into their groups -> -1 means create a seperate group -1x for that group
# split files into their groups -> -1 means create a separate group -1x for that group
noise_groups = 0
for index, group in enumerate(labels):
if group != -1:
Expand Down
2 changes: 1 addition & 1 deletion sweepai/core/vector_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def openai_with_expo_backoff(batch: tuple[str]):
# make sure all token counts are within model params (max: 8192)
new_embeddings = openai_call_embedding(batch)
except requests.exceptions.Timeout as e:
logger.exception(f"Timeout error occured while embedding: {e}")
logger.exception(f"Timeout error occurred while embedding: {e}")
except Exception as e:
logger.exception(e)
if any(tiktoken_client.count(text) > 8192 for text in batch):
Expand Down
4 changes: 2 additions & 2 deletions sweepai/handlers/on_comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,13 +291,13 @@ def edit_comment(new_comment: str) -> None:
"failed",
properties={
"error": str(e),
"traceback": f"An error occured during the search! The stack trace is below:\n\n{stack_trace}",
"traceback": f"An error occurred during the search! The stack trace is below:\n\n{stack_trace}",
"duration": elapsed_time,
"tracking_id": tracking_id,
**metadata,
},
)
edit_comment(ERROR_FORMAT.format(title=f"An error occured!\n\nThe exception message is:{str(e)}\n\nThe stack trace is:{stack_trace}"))
edit_comment(ERROR_FORMAT.format(title=f"An error occurred!\n\nThe exception message is:{str(e)}\n\nThe stack trace is:{stack_trace}"))
raise e

try:
Expand Down
2 changes: 1 addition & 1 deletion sweepai/handlers/review_pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def review_pr(
pr_changes, dropped_files, unsuitable_files = get_pr_changes(
repository, pr, cloned_repo
)
# -1 group key means review those seperately
# -1 group key means review those separately
grouped_files: dict[str, list[str]] = cluster_patches(pr_changes)
# build another dict so that all files are in their own group
single_files = {file_name: [file_name] for file_name in pr_changes.keys()}
Expand Down
2 changes: 1 addition & 1 deletion sweepai/utils/str_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def extract_objects_from_string(text: str, object_tag: str, object_params: list[
extracted_objects.append(object_args)
else:
failed_extraction = True
logger.warning(f"Failure occured during extraction on the following param: {failed_param}\ntext:\n{text}")
logger.warning(f"Failure occurred during extraction on the following param: {failed_param}\ntext:\n{text}")
posthog.capture("extract_objects_from_string", "extract_objects_from_string failed", properties={"failed_param": failed_param, "text": text, "object_tag": object_tag})
return extracted_objects, failed_extraction

Expand Down