{"record":{"id":"e8e4f6e49b8d0008","repo":"FoundationAgents/OpenManus","slug":"parameter-plan-id-is-required-for-command-set-a","errorCode":null,"errorMessage":"Parameter `plan_id` is required for command: set_active","messagePattern":"Parameter `plan_id` is required for command: set_active","errorType":"exception","errorClass":"ToolError","httpStatus":null,"severity":"warning","filePath":"app/tool/planning.py","lineNumber":247,"sourceCode":"        \"\"\"Get details of a specific plan.\"\"\"\n        if not plan_id:\n            # If no plan_id is provided, use the current active plan\n            if not self._current_plan_id:\n                raise ToolError(\n                    \"No active plan. Please specify a plan_id or set an active plan.\"\n                )\n            plan_id = self._current_plan_id\n\n        if plan_id not in self.plans:\n            raise ToolError(f\"No plan found with ID: {plan_id}\")\n\n        plan = self.plans[plan_id]\n        return ToolResult(output=self._format_plan(plan))\n\n    def _set_active_plan(self, plan_id: Optional[str]) -> ToolResult:\n        \"\"\"Set a plan as the active plan.\"\"\"\n        if not plan_id:\n            raise ToolError(\"Parameter `plan_id` is required for command: set_active\")\n\n        if plan_id not in self.plans:\n            raise ToolError(f\"No plan found with ID: {plan_id}\")\n\n        self._current_plan_id = plan_id\n        return ToolResult(\n            output=f\"Plan '{plan_id}' is now the active plan.\\n\\n{self._format_plan(self.plans[plan_id])}\"\n        )\n\n    def _mark_step(\n        self,\n        plan_id: Optional[str],\n        step_index: Optional[int],\n        step_status: Optional[str],\n        step_notes: Optional[str],\n    ) -> ToolResult:\n        \"\"\"Mark a step with a specific status and optional notes.\"\"\"\n        if not plan_id:","sourceCodeStart":229,"sourceCodeEnd":265,"githubUrl":"https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/tool/planning.py#L229-L265","documentation":"Raised by _set_active_plan (app/tool/planning.py:247) when command='set_active' is dispatched without a truthy plan_id. Unlike get/mark_step, set_active has no default target — it exists precisely to name a plan, so omitting the ID is always a caller error. Nothing is mutated when it fires.","triggerScenarios":"Calling `planning.execute(command='set_active')` with plan_id omitted/empty; programmatic calls that forward an optional variable which was never populated.","commonSituations":"Models treating set_active as 'activate the most recent plan'; wrapper code paths where plan_id is conditionally set and the None branch is not excluded.","solutions":["Pass the plan_id: `planning.execute(command='set_active', plan_id='p1')`.","Resolve a default in the caller first (e.g. from list output or your own tracked last-created id) before invoking.","Guard in wrappers: skip the call entirely when plan_id is falsy rather than letting the tool reject it."],"exampleFix":"// before\nawait planning.execute(command='set_active')\n\n// after\nawait planning.execute(command='set_active', plan_id='p1')","handlingStrategy":"validation","validationCode":"if not plan_id:\n    raise ValueError('set_active requires plan_id')\nawait planning.execute(command='set_active', plan_id=plan_id)","typeGuard":"def is_plan_id(v: str | None) -> bool:\n    return isinstance(v, str) and bool(v.strip())","tryCatchPattern":null,"preventionTips":["Skip the set_active call entirely when plan_id is falsy instead of relying on the tool to reject it.","set_active has no active-plan fallback — always resolve a concrete ID first."],"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"}