diff --git a/prometheus/app/api/routes/repository.py b/prometheus/app/api/routes/repository.py index dfd48a2..1fdaa4f 100644 --- a/prometheus/app/api/routes/repository.py +++ b/prometheus/app/api/routes/repository.py @@ -68,14 +68,12 @@ async def upload_github_repository( upload_repository_request.commit_id, request.state.user_id, ) - else: - repository = await repository_service.get_repository_by_url_and_commit_id( - upload_repository_request.https_url, commit_id=upload_repository_request.commit_id - ) - # If the repository already exists, return its ID - if repository: - return Response(message="Repository already exists", data={"repository_id": repository.id}) + # If the repository already exists, return its ID + if repository: + return Response( + message="Repository already exists", data={"repository_id": repository.id} + ) # Check if the number of repositories exceeds the limit if settings.ENABLE_AUTHENTICATION: diff --git a/prometheus/tools/file_operation.py b/prometheus/tools/file_operation.py index c1057ce..424e6e1 100644 --- a/prometheus/tools/file_operation.py +++ b/prometheus/tools/file_operation.py @@ -64,7 +64,7 @@ class FileOperationTool: read_file_spec = ToolSpec( description="""\ Read the content of a file with line numbers prepended from the codebase with a safety limit on the number of lines. - Returns up to the first 1000 lines by default to prevent context issues with large files. + Returns up to the first 800 lines by default to prevent context issues with large files. Returns an error message if the file doesn't exist. """, input_schema=ReadFileInput, @@ -129,7 +129,7 @@ def __init__(self, root_path: str, kg: KnowledgeGraph): self.root_path = root_path self.kg = kg - def read_file(self, relative_path: str, n_lines: int = 1000) -> str: + def read_file(self, relative_path: str, n_lines: int = 800) -> str: if os.path.isabs(relative_path): return f"relative_path: {relative_path} is a absolute path, not relative path." @@ -245,7 +245,7 @@ def read_file_with_knowledge_graph_data( with file_path.open() as f: lines = f.readlines() # Limit to first 1000 lines to avoid context issues - selected_text_with_line_numbers = pre_append_line_numbers("".join(lines[:1000]), 1) + selected_text_with_line_numbers = pre_append_line_numbers("".join(lines[:800]), 1) result_data = [ {