{"record":{"id":"c2f984c4af04bc93","repo":"FoundationAgents/OpenManus","slug":"invalid-step-index-step-index-valid-indices-ra","errorCode":null,"errorMessage":"Invalid step_index: {step_index}. Valid indices range from 0 to {len(plan['steps'])-1}.","messagePattern":"Invalid step_index: (.+?)\\. Valid indices range from 0 to (.+?)\\.","errorType":"exception","errorClass":"ToolError","httpStatus":null,"severity":"error","filePath":"app/tool/planning.py","lineNumber":282,"sourceCode":"        \"\"\"Mark a step with a specific status and optional notes.\"\"\"\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        if step_index is None:\n            raise ToolError(\"Parameter `step_index` is required for command: mark_step\")\n\n        plan = self.plans[plan_id]\n\n        if step_index < 0 or step_index >= len(plan[\"steps\"]):\n            raise ToolError(\n                f\"Invalid step_index: {step_index}. Valid indices range from 0 to {len(plan['steps'])-1}.\"\n            )\n\n        if step_status and step_status not in [\n            \"not_started\",\n            \"in_progress\",\n            \"completed\",\n            \"blocked\",\n        ]:\n            raise ToolError(\n                f\"Invalid step_status: {step_status}. Valid statuses are: not_started, in_progress, completed, blocked\"\n            )\n\n        if step_status:\n            plan[\"step_statuses\"][step_index] = step_status\n\n        if step_notes:\n            plan[\"step_notes\"][step_index] = step_notes","sourceCodeStart":264,"sourceCodeEnd":300,"githubUrl":"https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/tool/planning.py#L264-L300","documentation":"Error \"Invalid step_index: {step_index}. Valid indices range from 0 to {len(plan['steps'])-1}.\" thrown in FoundationAgents/OpenManus.","triggerScenarios":"Raised when `mark_step` receives a `step_index` that is negative or greater than the last valid index of the plan's steps list.","commonSituations":"See trigger scenarios.","solutions":["Use a step_index between 0 and len(plan['steps'])-1 as shown in the error message.","Call the planning tool with command `get` for the plan_id to list current steps and their indices before marking a step."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"52a13f2a57d8c7f6737eefb02ccf569594d44273","analyzedAt":"2026-08-15T02:33:49.993Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}