{"record":{"id":"e60bfef939b51bec","repo":"huggingface/smolagents","slug":"unsupported-action-type-action-type","errorCode":null,"errorMessage":"Unsupported action type: {action_type}","messagePattern":"Unsupported action type: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/smolagents/cli.py","lineNumber":257,"sourceCode":"            description = f\"Tool loaded from Hugging Face Space: {tool_name}\"\n            available_tools.append(Tool.from_space(space_id=tool_name, name=space_name, description=description))\n        else:\n            if tool_name in TOOL_MAPPING:\n                available_tools.append(TOOL_MAPPING[tool_name]())\n            else:\n                raise ValueError(f\"Tool {tool_name} is not recognized either as a default tool or a Space.\")\n\n    if action_type == \"code\":\n        agent = CodeAgent(\n            tools=available_tools,\n            model=model,\n            additional_authorized_imports=imports,\n            stream_outputs=True,\n        )\n    elif action_type == \"tool_calling\":\n        agent = ToolCallingAgent(tools=available_tools, model=model, stream_outputs=True)\n    else:\n        raise ValueError(f\"Unsupported action type: {action_type}\")\n\n    agent.run(prompt)\n\n\ndef main() -> None:\n    args = parse_arguments()\n\n    # Check if we should run in interactive mode\n    # Interactive mode is triggered when no prompt is provided\n    if args.prompt is None:\n        prompt, tools, model_type, model_id, provider, api_base, api_key, imports, action_type = interactive_mode()\n    else:\n        prompt = args.prompt\n        tools = args.tools\n        model_type = args.model_type\n        model_id = args.model_id\n        provider = args.provider\n        api_base = args.api_base","sourceCodeStart":239,"sourceCodeEnd":275,"githubUrl":"https://github.com/huggingface/smolagents/blob/30bb1161095dbae2271e6bc3cc4c219cc3897a57/src/smolagents/cli.py#L239-L275","documentation":"Raised by run_smolagent in the smolagents CLI when --action-type is neither 'code' (CodeAgent) nor 'tool_calling' (ToolCallingAgent). It is the final else of the agent-type dispatch and guards against unsupported agent paradigms.","triggerScenarios":"Running `smolagent --action-type <something other than 'code' or 'tool_calling'>`, e.g. 'react', 'json', or a typo like 'toolcall'.","commonSituations":"Assuming the CLI supports the same breadth of agent types as the library API, or copy-pasting an action type from outdated docs.","solutions":["Use one of the two supported values: --action-type code or --action-type tool_calling.","For other agent types, build the agent programmatically with smolagents' Python API instead of the CLI."],"exampleFix":"# before\nsmolagent --action-type react ...\n# after\nsmolagent --action-type tool_calling ...","handlingStrategy":"validation","validationCode":"if action_type not in {'code','tool_calling'}: raise SystemExit('action-type must be code or tool_calling')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Hard-code the two valid values in wrapper scripts.","Prefer the Python API over the CLI when you need other agent types."],"tags":["cli","agent-config","input-validation","smolagents"],"backgroundTag":"invalid-argument-value","analyzedSha":"30bb1161095dbae2271e6bc3cc4c219cc3897a57","analyzedAt":"2026-08-28T18:52:54.169Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}