default disables coding agent if no env provided

Esse commit está contido em:
alckasoc
2025-10-04 03:40:33 +00:00
commit a9ed594668
2 arquivos alterados com 9 adições e 0 exclusões
+3
Ver Arquivo
@@ -112,6 +112,9 @@ class CodeAgent:
def execute(self, task_instruction: str, screenshot: str, env_controller) -> Dict:
"""Execute code for the given task with a budget of steps."""
if env_controller is None:
raise ValueError("env_controller is required for code execution")
logger.info(f"Starting code execution for task: {task_instruction}")
logger.info(f"Budget: {self.budget} steps")
+6
Ver Arquivo
@@ -65,6 +65,12 @@ class Worker(BaseModule):
else:
skipped_actions = []
# Hide code agent action entirely if no env/controller is available
if not getattr(self.grounding_agent, "env", None) or not getattr(
getattr(self.grounding_agent, "env", None), "controller", None
):
skipped_actions.append("call_code_agent")
sys_prompt = PROCEDURAL_MEMORY.construct_simple_worker_procedural_memory(
type(self.grounding_agent), skipped_actions=skipped_actions
).replace("CURRENT_OS", self.platform)