{"record":{"id":"154b78233ddd6c91","repo":"huggingface/smolagents","slug":"unsupported-executor-type-self-executor-type","errorCode":null,"errorMessage":"Unsupported executor type: {self.executor_type}","messagePattern":"Unsupported executor type: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/smolagents/agents.py","lineNumber":1600,"sourceCode":"            )\n        self.executor_type = executor_type\n        self.executor_kwargs: dict[str, Any] = executor_kwargs or {}\n        self.python_executor = executor or self.create_python_executor()\n\n    def __enter__(self):\n        return self\n\n    def __exit__(self, exc_type, exc_value, traceback):\n        self.cleanup()\n\n    def cleanup(self):\n        \"\"\"Clean up resources used by the agent, such as the remote Python executor.\"\"\"\n        if hasattr(self.python_executor, \"cleanup\"):\n            self.python_executor.cleanup()\n\n    def create_python_executor(self) -> PythonExecutor:\n        if self.executor_type not in {\"local\", \"blaxel\", \"e2b\", \"modal\", \"docker\"}:\n            raise ValueError(f\"Unsupported executor type: {self.executor_type}\")\n\n        if self.executor_type == \"local\":\n            return LocalPythonExecutor(\n                self.additional_authorized_imports,\n                **{\"max_print_outputs_length\": self.max_print_outputs_length} | self.executor_kwargs,\n            )\n        else:\n            if self.managed_agents:\n                raise Exception(\"Managed agents are not yet supported with remote code execution.\")\n            remote_executors = {\n                \"blaxel\": BlaxelExecutor,\n                \"e2b\": E2BExecutor,\n                \"docker\": DockerExecutor,\n                \"modal\": ModalExecutor,\n            }\n            return remote_executors[self.executor_type](\n                self.additional_authorized_imports, self.logger, **self.executor_kwargs\n            )","sourceCodeStart":1582,"sourceCodeEnd":1618,"githubUrl":"https://github.com/huggingface/smolagents/blob/30bb1161095dbae2271e6bc3cc4c219cc3897a57/src/smolagents/agents.py#L1582-L1618","documentation":"CodeAgent.create_python_executor validates executor_type against the fixed set {'local', 'blaxel', 'e2b', 'modal', 'docker'} before building the PythonExecutor that runs the agent's generated code. Any other string — typo, unsupported backend, or the legacy 'remote' value — raises ValueError at agent construction time.","triggerScenarios":"CodeAgent(model=..., executor_type='lambda') or 'docker ' (typo/whitespace), or any value outside the supported set.","commonSituations":"Version drift: older smolagents used executor_type='remote' for E2B, which newer versions reject; misspelled backend names; assuming a backend exists without having read the current docs.","solutions":["Use one of the exact supported values: 'local', 'e2b', 'docker', 'modal', 'blaxel'.","If you had executor_type='remote' from old code, replace it with the concrete backend ('e2b').","Ensure required extras/SDKs for the chosen executor are installed (e.g. e2b-code-interpreter for 'e2b')."],"exampleFix":"# before\nagent = CodeAgent(model=model, tools=[], executor_type='remote')\n\n# after\nagent = CodeAgent(model=model, tools=[], executor_type='e2b')","handlingStrategy":"validation","validationCode":"SUPPORTED_EXECUTORS = {'local', 'blaxel', 'e2b', 'modal', 'docker'}\nassert executor_type in SUPPORTED_EXECUTORS, f'use one of {SUPPORTED_EXECUTORS}'\nagent = CodeAgent(model=model, tools=[], executor_type=executor_type)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Derive executor_type from a validated config enum, not free-form strings.","Replace legacy 'remote' values with 'e2b' when upgrading smolagents.","Install the executor's SDK/extra before constructing the agent."],"tags":["smolagents","codeagent","executor-type","configuration"],"backgroundTag":"invalid-enum-config-value","analyzedSha":"30bb1161095dbae2271e6bc3cc4c219cc3897a57","analyzedAt":"2026-08-28T18:52:54.169Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}