Expand description
The question asked before a quit that would stop agents in the middle of a turn.
Quitting stops every agent. A window’s own close warns first (frontend/app/window/window-close.ts);
a quit that comes from outside a window does not pass a page. So whoever starts such a quit asks
srv who is working (GET /agentmux/quit-question) and, when srv says to ask, puts the question in
a native dialog of its own: one that needs no window and that no page or agent can answer.
The launcher asks for the tray’s Quit (crates/launcher/src/quit_ask.rs); the host asks for the
macOS app menu’s Quit and Cmd+Q (crates/cef/src/macos_menu.rs). They share this: the question,
the text, and the macOS dialog.
Quitting must always work. No answer from srv within [ANSWER_WITHIN] (srv is gone, hung or from
a version without the question), or no way to show a dialog, quits as before. Only an explicit
“keep running” stops the quit.
Structs§
- Question
- What srv said when it said to ask.
Constants§
Functions§
- ask_srv
- Ask srv. Blocking, bounded by [
ANSWER_WITHIN] for the connection and for each read. - goes_
ahead - Whether the quit goes ahead: always, unless there is a question and the person answers it with
“keep running”.
confirmisNonewhen no dialog could be shown. - macos_
answer - What
osascriptsaid. The alert ([MACOS_ALERT]) exits 0 and printsbutton returned:and the title of the button clicked: Quit, or Keep running. The “User canceled” error, -128, is what adisplay dialogwith a cancel button gives for Keep running; it is read as Keep running too. Any other failure is an alert that was never answered:None, and the quit goes ahead. - text
- The dialog’s text.