Skip to content

Commit

Permalink
Prevent long wait times for insights threadpool at end of run
Browse files Browse the repository at this point in the history
  • Loading branch information
roaga committed Dec 14, 2024
1 parent 13dcc90 commit ed3e256
Show file tree
Hide file tree
Showing 2 changed files with 1,205 additions and 247 deletions.
10 changes: 7 additions & 3 deletions src/seer/automation/autofix/autofix_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,14 @@ def run_iteration(self, run_config: RunConfig):

# log thoughts to the user
cur = self.context.state.get()
initial_memory_length = cur.steps[-1].initial_memory_length
if (
completion.message.content
and self.config.interactive
completion.message.content # only if we have something to summarize
and self.config.interactive # only in interactive mode
and not cur.request.options.disable_interactivity
and (
completion.message.tool_calls or len(self.memory) <= initial_memory_length + 1
) # only if the run is in progress (and special case for ending in one exception)
):
text_before_tag = completion.message.content.split("<")[0]
text = text_before_tag
Expand Down Expand Up @@ -171,7 +175,7 @@ def run_iteration(self, run_config: RunConfig):
@contextlib.contextmanager
def manage_run(self):
self.futures = []
self.executor = ThreadPoolExecutor(max_workers=1, initializer=copy_modules_initializer())
self.executor = ThreadPoolExecutor(max_workers=2, initializer=copy_modules_initializer())
with super().manage_run(), self.executor:
yield
for future in self.futures:
Expand Down
Loading

0 comments on commit ed3e256

Please sign in to comment.