Skip to content

After a crash with an ask_user prompt on screen, resuming the session shows the same prompt but it can't be answered or dismissed; rewinding is the only way out #5019

Description

@mandyallstars

Describe the bug

If the CLI crashes or exits unexpectedly while an ask_user form is on screen, copilot --resume restores the session with that same form showing. The form doesn't respond: you can't select options, type an answer, submit, cancel or exit it.

The only way out is to rewind to an earlier turn. That causes three problems:

  • At least one turn is lost.
  • The agent has to redo the work from the rewound turn (tool calls, reads, analysis). That costs time and AI credits and may repeat side effects.
  • The user has to remember what the prompt asked and re-state the context, because the rewind removes the prompt from history.

Steps to reproduce

  1. Start an interactive session and give it a task where the agent calls ask_user, so a structured form is on screen.
  2. While the form is showing, the CLI process crashes or is killed. We saw this with real crashes; killing the process should reproduce it.
  3. Run copilot --resume and pick that session.
  4. The same ask_user form appears but doesn't respond to input. Esc and Ctrl+C don't dismiss it.
  5. The only recovery is rewinding (/rewind or Esc Esc) to a turn before the prompt.

Expected behavior

One of these, in order of preference:

  1. The restored prompt works normally and the answer goes back to the pending tool call.
  2. The CLI detects the orphaned ask_user call, since it has tool.execution_start but no tool.execution_complete. It then completes the call with a cancelled or interrupted result and returns control to the user without losing the turn. The agent can then re-ask.
  3. At minimum, Esc or Ctrl+C cancels the restored prompt instead of leaving the session stuck.

Notes

Environment

  • CLI: 1.0.88 (now on 1.0.89; not yet re-observed)
  • OS: Windows 11 (10.0.26200)
  • Shell: PowerShell 7.6.6
  • Terminal: VS Code integrated terminal
  • Model: claude-opus-5.5

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions