{"record":{"id":"e177cb18fd2eb594","repo":"FoundationAgents/OpenManus","slug":"parameter-plan-id-is-required-for-command-creat","errorCode":null,"errorMessage":"Parameter `plan_id` is required for command: create","messagePattern":"Parameter `plan_id` is required for command: create","errorType":"exception","errorClass":"ToolError","httpStatus":null,"severity":"warning","filePath":"app/tool/planning.py","lineNumber":125,"sourceCode":"        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\n        if (\n            not steps\n            or not isinstance(steps, list)\n            or not all(isinstance(step, str) for step in steps)\n        ):\n            raise ToolError(\n                \"Parameter `steps` must be a non-empty list of strings for command: create\"\n            )\n","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/tool/planning.py#L107-L143","documentation":"Raised by _create_plan (app/tool/planning.py:125) when command='create' is dispatched without a truthy plan_id. plan_id is the dictionary key for the in-memory plan store (self.plans), so creation requires it up front. This is input validation before any state is touched.","triggerScenarios":"Calling `await planning.execute(command='create', title='t', steps=['a'])` with plan_id omitted or set to '' / None. Common with LLM callers that assume the tool auto-generates an ID.","commonSituations":"Model-issued tool calls that omit plan_id because the schema marks only 'command' as required; callers used to APIs that auto-assign IDs; empty string passed from a templating bug.","solutions":["Pass an explicit plan_id: `await planning.execute(command='create', plan_id='release-1', title=..., steps=[...])`.","In the calling layer, generate an ID when the model omits one (e.g. slugify(title) or uuid4 hex) before invoking the tool.","If you control prompts, make plan_id explicitly required in the instructions/examples for the create command."],"exampleFix":"// before\nawait planning.execute(command='create', title='Refactor', steps=['a','b'])\n\n// after\nplan_id = plan_id or slugify(title)\nawait planning.execute(command='create', plan_id=plan_id, title='Refactor', steps=['a','b'])","handlingStrategy":"validation","validationCode":"if not plan_id or not plan_id.strip():\n    raise ValueError('create requires a plan_id')\nawait planning.execute(command='create', plan_id=plan_id, title=title, steps=steps)","typeGuard":"def is_plan_id(v: str | None) -> bool:\n    return isinstance(v, str) and bool(v.strip())","tryCatchPattern":"try:\n    await planning.execute(command='create', title=t, steps=s)\nexcept ToolError as e:\n    if 'plan_id` is required' in str(e):\n        await planning.execute(command='create', plan_id=slugify(t), title=t, steps=s)\n    else:\n        raise","preventionTips":["Always compute and pass plan_id yourself; never rely on the tool to generate one.","Derive deterministic IDs (slug of title) for idempotent agent retries.","State in agent prompts that create requires plan_id, title and steps together."],"tags":["planning","validation","required-field"],"backgroundTag":null,"analyzedSha":"52a13f2a57d8c7f6737eefb02ccf569594d44273","analyzedAt":"2026-08-15T02:33:49.993Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}