{"record":{"id":"f589e1b393f76bde","repo":"FoundationAgents/OpenManus","slug":"unrecognized-command-command-allowed-commands","errorCode":null,"errorMessage":"Unrecognized command: {command}. Allowed commands are: create, update, list, get, set_active, mark_step, delete","messagePattern":"Unrecognized command: (.+?)\\. Allowed commands are: create, update, list, get, set_active, mark_step, delete","errorType":"exception","errorClass":"ToolError","httpStatus":null,"severity":"warning","filePath":"app/tool/planning.py","lineNumber":116,"sourceCode":"        - step_notes: Additional notes for a step (used with mark_step command)\n        \"\"\"\n\n        if command == \"create\":\n            return self._create_plan(plan_id, title, steps)\n        elif command == \"update\":\n            return self._update_plan(plan_id, title, steps)\n        elif command == \"list\":\n            return self._list_plans()\n        elif command == \"get\":\n            return self._get_plan(plan_id)\n        elif command == \"set_active\":\n            return self._set_active_plan(plan_id)\n        elif command == \"mark_step\":\n            return self._mark_step(plan_id, step_index, step_status, step_notes)\n        elif command == \"delete\":\n            return self._delete_plan(plan_id)\n        else:\n            raise ToolError(\n                f\"Unrecognized command: {command}. Allowed commands are: create, update, list, get, set_active, mark_step, delete\"\n            )\n\n    def _create_plan(\n        self, plan_id: Optional[str], title: Optional[str], steps: Optional[List[str]]\n    ) -> ToolResult:\n        \"\"\"Create a new plan with the given ID, title, and steps.\"\"\"\n        if not plan_id:\n            raise ToolError(\"Parameter `plan_id` is required for command: create\")\n\n        if plan_id in self.plans:\n            raise ToolError(\n                f\"A plan with ID '{plan_id}' already exists. Use 'update' to modify existing plans.\"\n            )\n\n        if not title:\n            raise ToolError(\"Parameter `title` is required for command: create\")\n","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/tool/planning.py#L98-L134","documentation":"Raised by the planning tool's execute() dispatch (app/tool/planning.py:116) when the command string matches none of the seven supported commands (create, update, list, get, set_active, mark_step, delete). It is the fallback branch of an if/elif chain; note that execute() also declares command as a Literal type, so well-typed callers get static errors first — this guard catches untyped/dynamic callers (e.g. LLM-issued tool calls).","triggerScenarios":"An LLM/tool caller passes command='delete_plan', 'createPlan', 'Add', ' remove' (whitespace), or any casing/typo variant; invoking the tool programmatically with a string not in the Literal set. Only exact lowercase matches dispatch.","commonSituations":"Agent frameworks where the model invents command names not in the tool schema; model output with casing or trailing whitespace; schema drift after upgrading the tool (a command removed or renamed) while prompts still reference the old name.","solutions":["Use one of the exact allowed strings: create, update, list, get, set_active, mark_step, delete (lowercase, underscore-separated).","Normalize and validate model-issued commands before dispatch: strip().lower() and check membership in the allowed set, with a corrective message back to the model.","After tool upgrades, grep prompts/schemas for stale command names and update them."],"exampleFix":"// before\nawait planning.execute(command='delete_plan', plan_id='p1')\n\n// after\nALLOWED = {'create','update','list','get','set_active','mark_step','delete'}\ncmd = raw_cmd.strip().lower()\nif cmd not in ALLOWED:\n    return f\"Unknown command {raw_cmd!r}; use one of {sorted(ALLOWED)}\"\nawait planning.execute(command=cmd, plan_id='p1')","handlingStrategy":"validation","validationCode":"ALLOWED = ('create', 'update', 'list', 'get', 'set_active', 'mark_step', 'delete')\ncmd = raw.strip().lower()\nif cmd not in ALLOWED:\n    return f'Unknown command {raw!r}; allowed: {ALLOWED}'\nawait planning.execute(command=cmd, **params)","typeGuard":"from typing import Literal\nPlanningCommand = Literal['create','update','list','get','set_active','mark_step','delete']\ndef is_planning_command(c: str) -> TypeGuard[PlanningCommand]:\n    return c in {'create','update','list','get','set_active','mark_step','delete'}","tryCatchPattern":"try:\n    await planning.execute(command=cmd)\nexcept ToolError as e:\n    if 'Unrecognized command' in str(e):\n        reply_to_model_with_allowed_commands()\n    else:\n        raise","preventionTips":["Type command as the Literal in caller signatures so static checkers catch typos.","Normalize LLM-issued commands (strip().lower()) before dispatch.","Include the allowed-command list in the corrective feedback loop for model callers."],"tags":["planning","validation","dispatch","llm-tool"],"backgroundTag":null,"analyzedSha":"52a13f2a57d8c7f6737eefb02ccf569594d44273","analyzedAt":"2026-08-15T02:33:49.993Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}