lints and test fixes

This commit is contained in:
lorenzejay
2026-03-14 12:03:58 -07:00
parent 218aeaf7ec
commit 7ebe212226
3 changed files with 397 additions and 1508 deletions

View File

@@ -1114,7 +1114,9 @@ class AgentExecutor(Flow[AgentExecutorState], CrewAgentExecutorMixin):
step_executor = self._ensure_step_executor()
context = self._build_context_for_todo(todo)
result = await asyncio.to_thread(
step_executor.execute, todo, context,
step_executor.execute,
todo,
context,
self._get_max_step_iterations(),
self._get_step_timeout(),
)
@@ -1133,9 +1135,7 @@ class AgentExecutor(Flow[AgentExecutorState], CrewAgentExecutorMixin):
if isinstance(item, Exception):
error_msg = f"Error: {item!s}"
todo.result = error_msg
self.state.todos.mark_failed(
todo.step_number, result=error_msg
)
self.state.todos.mark_failed(todo.step_number, result=error_msg)
if self.agent.verbose:
self._printer.print(
content=f"Todo {todo.step_number} failed: {error_msg}",
@@ -1150,9 +1150,7 @@ class AgentExecutor(Flow[AgentExecutorState], CrewAgentExecutorMixin):
"type": "step_execution",
"step_number": todo.step_number,
"success": result.success,
"result_preview": result.result[:200]
if result.result
else "",
"result_preview": result.result[:200] if result.result else "",
"error": result.error,
"tool_calls": result.tool_calls_made,
"execution_time": result.execution_time,
@@ -1203,13 +1201,9 @@ class AgentExecutor(Flow[AgentExecutorState], CrewAgentExecutorMixin):
# Mark based on observation result
if observation.step_completed_successfully:
self.state.todos.mark_completed(
todo.step_number, result=todo.result
)
self.state.todos.mark_completed(todo.step_number, result=todo.result)
else:
self.state.todos.mark_failed(
todo.step_number, result=todo.result
)
self.state.todos.mark_failed(todo.step_number, result=todo.result)
if self.agent.verbose:
self._printer.print(

View File

@@ -101,17 +101,12 @@ class I18N(BaseModel):
self,
kind: Literal[
"slices",
"errors",
"tools",
"reasoning",
"planning",
"hierarchical_manager_agent",
"memory"
"memory",
],
key: str,
) -> str: