Skip to content

Plan mode invoked mid-session skips execution approval gate #1257

Description

@ASneakyToast

Describe the bug

When plan-mode is invoked during an existing session (rather than at session start), the approval gate ("Execute the plan? yes/no") is never shown. The agent writes the plan file and immediately begins executing it without waiting for user confirmation.

Steps to reproduce

  1. Start a normal (non-plan-mode) session
  2. Mid-session, explicitly invoke plan mode (e.g. via slash command or prompt)
  3. Agent writes the plan document
  4. Agent immediately proceeds to execute — no approval prompt appears

Expected behavior

After writing the plan, execution should be gated behind user approval regardless of whether plan mode was active from session start or invoked mid-session.

Actual behavior

The agent self-authorizes execution. The questionnaire tool (or equivalent gate) is never called. The transition from plan → execute is skipped entirely.

Root cause hypothesis

The approval gate appears to be wired only at session initialization. A mid-session mode switch doesn't re-arm it, so the model has no instruction to stop and wait.

Environment

  • prime-agent version: 0.7.1
  • Model: claude-sonnet-4-6

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