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
- Start an interactive session and give it a task where the agent calls
ask_user, so a structured form is on screen.
- While the form is showing, the CLI process crashes or is killed. We saw this with real crashes; killing the process should reproduce it.
- Run
copilot --resume and pick that session.
- The same
ask_user form appears but doesn't respond to input. Esc and Ctrl+C don't dismiss it.
- The only recovery is rewinding (
/rewind or Esc Esc) to a turn before the prompt.
Expected behavior
One of these, in order of preference:
- The restored prompt works normally and the answer goes back to the pending tool call.
- 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.
- 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
Describe the bug
If the CLI crashes or exits unexpectedly while an
ask_userform is on screen,copilot --resumerestores 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:
Steps to reproduce
ask_user, so a structured form is on screen.copilot --resumeand pick that session.ask_userform appears but doesn't respond to input. Esc and Ctrl+C don't dismiss it./rewindor Esc Esc) to a turn before the prompt.Expected behavior
One of these, in order of preference:
ask_usercall, since it hastool.execution_startbut notool.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.Notes
--resumereplays orphaned permission.requested events (no matching permission.completed) after mid-prompt process death #4259 and Orphaned permission.requested event replays on every session resume, causing repeated directory-access prompts that can't be dismissed #4469: an interactive request left pending across a process death gets replayed on resume but can't be resolved. Those issues involvepermission.requested; this one involves theask_usertool call.tool.execution_startfromevents.jsonl, so afterwards there's no local trace of the problem. That makes it hard to attach logs after the fact.Environment