Skip to content

Pi extension errors after approving a plan #804

Closed

Description

@xz-dev

Bug

When a user approves a Plannotator plan in the Pi extension, the extension can emit:

Extension "<runtime>" error: Agent is already processing. Specify streamingBehavior ('steer' or 'followUp') to queue the message.

Cause

The approve path returns terminate: true, then the agent_end handler sends the continuation prompt with:

pi.sendUserMessage("Continue with the approved plan.");

Because the Pi runtime may still consider the agent turn active immediately after termination, sendUserMessage needs an explicit queued delivery mode.

The deny path does not hit this because it returns normally and does not set justApprovedPlan, so the agent_end handler does not send the continuation prompt.

Expected fix

Send the continuation with { deliverAs: "followUp" } and remove the setTimeout(0) workaround.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions