microsoft / microsoft/amplifier
[app-cli] Emit a lifecycle event on user interrupt (Ctrl+C currently writes nothing to events.jsonl)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.1k
- Forks
- 261
- Avg merge
- 3h 28m
- Merged PRs (30d)
- 13
Description
Observed on amplifier 2026.07.06-7ec5dcd (scripted PTY, twice — once during a long bash tool call, once during a long streaming response): sending \x03 mid-turn wrote zero records to events.jsonl — no cancel:*, no prompt:complete. (In our scripted-PTY environment the turn also ran to completion, so this may interact with prompt_toolkit key handling; the on-disk silence is the part this issue is about.)
Problem. External consumers of the event log cannot distinguish "turn interrupted by the user" from "turn still running". For tooling that shows busy/idle state per session, an interrupted turn leaves a stale busy indicator until the next turn completes.
Ask. Emit a lifecycle record when a turn is interrupted/cancelled — either a cancel:* event or a prompt:complete with a status: cancelled field — so the turn's open/closed state is always recoverable from the log.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the app-cli handling for Ctrl+C or turn cancellation and the code that writes lifecycle records to events.jsonl. Reproduce an interrupt during a long bash call or streaming response, then ensure the log contains a cancellation or cancelled completion record so the turn's open/closed state is recoverable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100