v0.171.0Release

A calmer close, and sessions that get time to finish

Closing Pekan while an agent was working used to produce a grey Windows message box, and confirming it killed every child process on the spot. Both halves of that have changed.

The warning is now part of Pekan. It uses the same modal styling as the rest of the app, and instead of a sentence of prose it lists exactly what is at stake: how many agent runs are active, how many terminal sessions are open, and how many worktree operations are still in flight. Keep Pekan open is the focused action, so pressing Enter by reflex keeps working. Escape, a click outside the modal, and any error in the interface itself all mean the same thing: nothing stops. The native dialog is still there as a fallback for the cases where the interface cannot answer, such as a crashed window, so you always get asked something.

Choosing to close now starts a real shutdown phase rather than an instant kill. Pekan stops accepting new runs, terminals, hook commands and worktree operations, then asks the work that is already running to finish. Interactive terminals get a genuine interrupt first, so a coding agent can stop its turn and save its session. Non-interactive runs get the least destructive exit request the platform offers. Preparations and hook commands get their existing cancellation, while a delivery or push already talking to Git is left to complete so you never end up with a half-written push.

That wait is bounded at eight seconds, shown in a Stopping active work state that cannot be dismissed. Anything still alive when the deadline passes is force stopped, so the app can never hang on a command that refuses to exit. Whatever was interrupted is then recorded properly: each affected run is closed out as cancelled with an end time, its final output is kept, and the token usage it had already reported is parsed and written before the app quits.

Two things are worth being clear about. Windows does not offer proper signal handling for this kind of child process, so a command line tool's own cleanup or telemetry hooks may not get to run before the force stop. And an operating system shutdown or a crash skips this path entirely. Both limits are documented rather than papered over.

Everything now goes through one place: the window close button, Alt and F4, Ctrl and W, the menu Quit item, and Restart to update all share the same confirmation and the same cleanup, so there are no duplicate prompts and no chance of cleanup running twice. The existing unsaved editor protection still comes last and still wins: if you cancel it, no process is stopped and the next close asks again.

Highlights

  • The close warning now uses Pekan styling instead of the operating system message box.
  • It lists live counts of active agent runs, terminal sessions, and in-flight worktree operations.
  • Keep Pekan open is the focused action, and Escape, a backdrop click, or an interface error never stop work.
  • Confirming shows a Stopping active work state and drains sessions for up to eight seconds before force stopping the rest.
  • Terminals receive a real interrupt first, so an interactive agent can save its session before the shell goes away.
  • Interrupted runs are recorded as cancelled with an end time, and pending token usage is written before the app quits.
  • Window close, Alt and F4, menu Quit, and Restart to update all share one confirmation and one cleanup sequence.

← Browse all Pekan releases