FoundationAgents/OpenManus · error · ToolError

Invalid step_index: {step_index}. Valid indices range from 0

Error message

Invalid step_index: {step_index}. Valid indices range from 0 to {len(plan['steps'])-1}.

What it means

Error "Invalid step_index: {step_index}. Valid indices range from 0 to {len(plan['steps'])-1}." thrown in FoundationAgents/OpenManus.

Source

Thrown at app/tool/planning.py:282

        """Mark a step with a specific status and optional notes."""
        if not plan_id:
            # If no plan_id is provided, use the current active plan
            if not self._current_plan_id:
                raise ToolError(
                    "No active plan. Please specify a plan_id or set an active plan."
                )
            plan_id = self._current_plan_id

        if plan_id not in self.plans:
            raise ToolError(f"No plan found with ID: {plan_id}")

        if step_index is None:
            raise ToolError("Parameter `step_index` is required for command: mark_step")

        plan = self.plans[plan_id]

        if step_index < 0 or step_index >= len(plan["steps"]):
            raise ToolError(
                f"Invalid step_index: {step_index}. Valid indices range from 0 to {len(plan['steps'])-1}."
            )

        if step_status and step_status not in [
            "not_started",
            "in_progress",
            "completed",
            "blocked",
        ]:
            raise ToolError(
                f"Invalid step_status: {step_status}. Valid statuses are: not_started, in_progress, completed, blocked"
            )

        if step_status:
            plan["step_statuses"][step_index] = step_status

        if step_notes:
            plan["step_notes"][step_index] = step_notes

View on GitHub (pinned to 52a13f2a57)

Solutions

  1. Use a step_index between 0 and len(plan['steps'])-1 as shown in the error message.
  2. Call the planning tool with command `get` for the plan_id to list current steps and their indices before marking a step.

When it happens

Trigger: Raised when `mark_step` receives a `step_index` that is negative or greater than the last valid index of the plan's steps list.

Common situations: See trigger scenarios.


AI-assisted analysis of FoundationAgents/OpenManus@52a13f2a57 (2026-08-15). Data as JSON: /api/errors/c2f984c4af04bc93. Report an issue: GitHub.