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

Add chat_logger logs to context_pruning.py (✓ Sandbox Passed) #2724

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
16 changes: 13 additions & 3 deletions sweepai/core/context_pruning.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from sweepai.api import chat_logger
import json
import re
import time
Expand Down Expand Up @@ -431,9 +432,18 @@ def modify_context(
repo_context_manager.top_snippet_paths
)
# if the paths have not changed or all tools were empty, we are done
return not (
paths_changed and (paths_to_keep or directories_to_expand or paths_to_add)
)

finished = not (paths_changed and (paths_to_keep or directories_to_expand or paths_to_add))
if chat_logger is not None:
chat_logger.add_chat(
{
"query": query,
"repo_context_manager": repo_context_manager,
"ticket_progress": ticket_progress,
# add any other relevant data here
}
)
return finished


if __name__ == "__main__":
Expand Down
Loading