FoundationAgents/OpenManus · warning · ToolError

A plan with ID '{plan_id}' already exists. Use 'update' to m

Error message

A plan with ID '{plan_id}' already exists. Use 'update' to modify existing plans.

What it means

Raised by _create_plan (app/tool/planning.py:128) when creating a plan whose plan_id already exists in the in-memory store self.plans. Creation is intentionally non-destructive: the tool refuses to overwrite and points you at the update command instead. Note plans are process-memory only (class-level dict), so IDs persist across calls within the same process/session.

Source

Thrown at app/tool/planning.py:128

            return self._set_active_plan(plan_id)
        elif command == "mark_step":
            return self._mark_step(plan_id, step_index, step_status, step_notes)
        elif command == "delete":
            return self._delete_plan(plan_id)
        else:
            raise ToolError(
                f"Unrecognized command: {command}. Allowed commands are: create, update, list, get, set_active, mark_step, delete"
            )

    def _create_plan(
        self, plan_id: Optional[str], title: Optional[str], steps: Optional[List[str]]
    ) -> ToolResult:
        """Create a new plan with the given ID, title, and steps."""
        if not plan_id:
            raise ToolError("Parameter `plan_id` is required for command: create")

        if plan_id in self.plans:
            raise ToolError(
                f"A plan with ID '{plan_id}' already exists. Use 'update' to modify existing plans."
            )

        if not title:
            raise ToolError("Parameter `title` is required for command: create")

        if (
            not steps
            or not isinstance(steps, list)
            or not all(isinstance(step, str) for step in steps)
        ):
            raise ToolError(
                "Parameter `steps` must be a non-empty list of strings for command: create"
            )

        # Create a new plan with initialized step statuses
        plan = {
            "plan_id": plan_id,

View on GitHub (pinned to 52a13f2a57)

Solutions

  1. If you intend to modify the existing plan, use command='update' with the same plan_id.
  2. If you want a fresh plan, either delete first (command='delete') or use a unique plan_id (timestamp/uuid suffix).
  3. Check existence before creating: call command='list' and compare IDs, or maintain the set of used IDs in the caller.

Example fix

// before
await planning.execute(command='create', plan_id='main', title='T', steps=['a'])  # second time -> ToolError

// after
if 'main' in used_ids:
    await planning.execute(command='update', plan_id='main', title='T', steps=['a'])
else:
    await planning.execute(command='create', plan_id='main', title='T', steps=['a'])
Defensive patterns

Strategy: validation

Validate before calling

existing = {p.split(':')[0] for p in (await planning.execute(command='list')).output.splitlines()}
# simpler: track ids you created in this session
if plan_id in created_ids:
    await planning.execute(command='update', plan_id=plan_id, title=title, steps=steps)
else:
    created_ids.add(plan_id)
    await planning.execute(command='create', plan_id=plan_id, title=title, steps=steps)

Try / catch

try:
    await planning.execute(command='create', plan_id=pid, title=t, steps=s)
except ToolError as e:
    if 'already exists' in str(e):
        await planning.execute(command='update', plan_id=pid, title=t, steps=s)
    else:
        raise

Prevention

When it happens

Trigger: Calling command='create' twice with the same plan_id; re-running a create after a previous successful create in the same process; plan IDs reused across agent turns (e.g. always 'main') while the process is still alive.

Common situations: Agent retry loops that re-issue the create after a partially failed later step; prompts that hardcode a plan_id like 'current'; class-level mutable state (plans: dict = {}) shared across instances, making collisions appear even between separate tool instances in one process.

Related errors


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