sweepai / sweep

Sweep: open-source AI-powered Software Developer for small features and bug fixes.
https://sweep.dev
Other
7.43k stars 425 forks source link

Sweep: In repocontextmanager make sure that the snippets are sorted by starting line if two or more snippets are from the same file #2723

Open wwzeng1 opened 10 months ago

wwzeng1 commented 10 months ago
Checklist - [X] Modify `sweepai/core/context_pruning.py` ✓ https://github.com/sweepai/sweep/commit/3fe482a57b7ad029d98a217a17f54a0e97ee9c71 [Edit](https://github.com/sweepai/sweep/edit/sweep/sort-snippets-by-line/sweepai/core/context_pruning.py) - [X] Running GitHub Actions for `sweepai/core/context_pruning.py` ✓ [Edit](https://github.com/sweepai/sweep/edit/sweep/sort-snippets-by-line/sweepai/core/context_pruning.py) ![Flowchart](https://raw.githubusercontent.com/sweepai/sweep/sweep/assets/6d1183f8dcfedc803a6f00d216793e5982196f32d9d57e5a3bff9157e5acd0ea_2723_flowchart.svg)
sweep-nightly[bot] commented 10 months ago

Here's the PR! https://github.com/sweepai/sweep/pull/2726. See Sweep's process at dashboard.

💎 Sweep Pro: I'm using GPT-4. You have unlimited GPT-4 tickets. (tracking ID: 0d65d0877a)

Actions (click)

Sandbox Execution ✓

Here are the sandbox execution logs prior to making any changes:

Sandbox logs for 338fc3c
Checking sweepai/core/context_pruning.py for syntax errors... ✅ sweepai/core/context_pruning.py has no syntax errors! 1/1 ✓
Checking sweepai/core/context_pruning.py for syntax errors...
✅ sweepai/core/context_pruning.py has no syntax errors!

Sandbox passed on the latest main, so sandbox checks will be enabled for this issue.


Step 1: 🔎 Searching

I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.

Some code snippets I think are relevant in decreasing order of relevance (click to expand). If some file is missing from here, you can mention the path in the ticket description. https://github.com/sweepai/sweep/blob/338fc3c43521bdfb90193638e96f562e53c687a9/sweepai/core/context_pruning.py#L59-L78

Step 2: ⌨️ Coding


+++ @@ -8,6 +8,7 @@ from openai.types.beta.thread import Thread from openai.types.beta.threads.run import Run

+from sandbox.src.sandbox_local import field from sweepai.agents.assistant_wrapper import client, openai_retry_with_timeout from sweepai.core.entities import Snippet from sweepai.logn.cache import file_cache @@ -116,7 +117,7 @@ current_top_tree: str snippets: list[Snippet] snippet_scores: dict[str, float]

Ran GitHub Actions for 3fe482a57b7ad029d98a217a17f54a0e97ee9c71:
• black:
• Vercel Preview Comments:


Step 3: 🔁 Code Review

I have finished reviewing the code for completeness. I did not find errors for sweep/sort-snippets-by-line.


🎉 Latest improvements to Sweep:


💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request. Join Our Discord