{"record":{"id":"33fa7e58e994e20b","repo":"FoundationAgents/OpenManus","slug":"no-active-plan-please-specify-a-plan-id-or-set-an","errorCode":null,"errorMessage":"No active plan. Please specify a plan_id or set an active plan.","messagePattern":"No active plan\\. Please specify a plan_id or set an active plan\\.","errorType":"exception","errorClass":"ToolError","httpStatus":null,"severity":"warning","filePath":"app/tool/planning.py","lineNumber":233,"sourceCode":"\n        output = \"Available plans:\\n\"\n        for plan_id, plan in self.plans.items():\n            current_marker = \" (active)\" if plan_id == self._current_plan_id else \"\"\n            completed = sum(\n                1 for status in plan[\"step_statuses\"] if status == \"completed\"\n            )\n            total = len(plan[\"steps\"])\n            progress = f\"{completed}/{total} steps completed\"\n            output += f\"• {plan_id}{current_marker}: {plan['title']} - {progress}\\n\"\n\n        return ToolResult(output=output)\n\n    def _get_plan(self, plan_id: Optional[str]) -> ToolResult:\n        \"\"\"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","sourceCodeStart":215,"sourceCodeEnd":251,"githubUrl":"https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/tool/planning.py#L215-L251","documentation":"Raised by _get_plan (app/tool/planning.py:233) when command='get' is called without plan_id and no plan has ever been set active (self._current_plan_id is None). The active plan is set implicitly by create (which sets _current_plan_id) or explicitly by set_active; a fresh process, or one where all plans were deleted, has none.","triggerScenarios":"Calling `planning.execute(command='get')` in a brand-new session before any create/set_active; after deleting the active plan (delete does not necessarily clear/replace the pointer, but a fresh store has none); multi-worker deployments where the active plan lives in another process's memory.","commonSituations":"Agent boot sequences that query the current plan before creating one; resumed sessions after restart (class-level state lost); calling get right after a failed create that raised before setting _current_plan_id.","solutions":["Create a plan first (create auto-sets it active) or call set_active with an existing plan_id.","Pass plan_id explicitly to get when you know which plan you want — it bypasses the active-plan requirement entirely.","Call command='list' to see available plans and pick one before get."],"exampleFix":"// before\nresult = await planning.execute(command='get')  # nothing active yet\n\n// after\nresult = await planning.execute(command='list')  # discover plans\nresult = await planning.execute(command='get', plan_id='p1')  # explicit target","handlingStrategy":"validation","validationCode":"if not plan_id and not has_active_plan():\n    listing = await planning.execute(command='list')\n    if no_plans(listing):\n        await planning.execute(command='create', plan_id=pid, title=t, steps=s)  # auto-activates\nresult = await planning.execute(command='get', plan_id=plan_id)","typeGuard":null,"tryCatchPattern":"try:\n    result = await planning.execute(command='get')\nexcept ToolError as e:\n    if 'No active plan' in str(e):\n        result = await planning.execute(command='list')\n        # pick a plan, set_active, then retry get\n    else:\n        raise","preventionTips":["Always pass plan_id to get when the ID is known — it never depends on active-plan state.","Ensure create/set_active succeeds before bare get calls in a session bootstrap."],"tags":["planning","state","active-plan"],"backgroundTag":null,"analyzedSha":"52a13f2a57d8c7f6737eefb02ccf569594d44273","analyzedAt":"2026-08-15T02:33:49.993Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}