Skip to content

Commit

Permalink
Check task state before checking steps (so it can be skipped if needed)
Browse files Browse the repository at this point in the history
  • Loading branch information
senko committed May 30, 2024
1 parent d5f53ca commit db06ae2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions core/agents/orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,9 @@ def create_agent(self, prev_response: Optional[AgentResponse]) -> BaseAgent:
):
# Ask the Tech Lead to break down the initial project or feature into tasks and apply project template
return TechLead(self.state_manager, self.ui, process_manager=self.process_manager)
elif not state.steps and not state.iterations:
# Ask the Developer to break down current task into actionable steps
return Developer(self.state_manager, self.ui)

# Current task status must be checked before Developer is called because we might want
# to skip it instead of breaking it down
current_task_status = state.current_task.get("status") if state.current_task else None
if current_task_status:
# Status of the current task is set first time after the task was reviewed by user
Expand All @@ -199,6 +198,10 @@ def create_agent(self, prev_response: Optional[AgentResponse]) -> BaseAgent:
# Task is fully done or skipped, call TaskCompleter to mark it as completed
return TaskCompleter(self.state_manager, self.ui)

if not state.steps and not state.iterations:
# Ask the Developer to break down current task into actionable steps
return Developer(self.state_manager, self.ui)

if state.current_step:
# Execute next step in the task
# TODO: this can be parallelized in the future
Expand Down

0 comments on commit db06ae2

Please sign in to comment.