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

Fix: Bump max_iterations when resuming due to throttling #3410

Merged
merged 17 commits into from
Aug 20, 2024
Merged
Changes from 7 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
5 changes: 5 additions & 0 deletions opendevin/controller/agent_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,11 @@ async def set_agent_state_to(self, new_state: AgentState):
):
# user intends to interrupt traffic control and let the task resume temporarily
self.state.traffic_control_state = TrafficControlState.PAUSED
# User has chosen to deliberately continue - lets double the max iterations
if self.state.iteration >= self.state.max_iterations:
self.state.max_iterations *= 2
if self.state.metrics.accumulated_cost >= self.max_budget_per_task:
self.max_budget_per_task *= 2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This piece of code alone doesn't work in a multi-agent context. This essentially expands the current agent/controller's limit, but when it returns to its parent, the old limit would be hit immediately. It would still work but a little bit confusing/surprising to users. The backend logs would look weird, too.

I would suggest take a look at code in if delegate_done section. You probably need to do something similar to "propagate back" the max_iterations and max_budget_per_task.


self.state.agent_state = new_state
if new_state == AgentState.STOPPED or new_state == AgentState.ERROR:
Expand Down