The /queue docs said move acts on the pending queue mid-run; it is
refused for prompts the gateway holds. They now also say that
/queue list|rm|edit|clear act on the session's shared gateway queue
(every window's and automation's queued prompts), that queue-mode Enter
uses the same queue, and that a slash command typed after your own
/queue prompt waits briefly for its turn.
Code notes: what a QueueOutcomeUnknown leaves behind (the turn runs
once but is not painted live here), and why an unknown /queue admission
stays tracked and is re-read once per pending list.
Refs #134889 (N5)
/queue X then /new (or /undo, /retry) typed during a turn: on main both
sat in _pending_input in that order. With X in the owner's FIFO, the
input loop took /new first; X's turn is adopted only once the owner's
message.start arrives, so /new could detach the session and X ran in a
session this terminal had left.
The input loop now holds a local item while this viewer's own /queue
admission is at the head of the owner's queue (gateway_queue
.OwnQueueHold). A turn the owner runs meanwhile (the adopted admission,
a notification header) runs first; the held item runs once that
admission was taken or left the queue. The wait is bounded: an unknown
row (a paused FIFO) never starts a hold, an idle list beyond the one a
settling turn publishes ends it, and OWN_QUEUE_HOLD_S (2 s) caps it.
The admission itself is never touched.
Refs #134889 (N5)
The owner commits a queued prompt before it answers. A timeout or a
dropped socket after the request was sent is a GatewayClientError, and
the CLI printed the refusal copy: "Nothing was queued; send it again".
Each resend got a fresh submission_id, so both copies could run.
Now only an owner verdict (GatewayRPCError) or a request that never
reached a socket is reported as nothing queued. A lost answer is asked
once more under the same submission_id. The owner returns the admission
it already holds (admit_session_input matches it by principal, session
and request id, hermes_state_runtime.py:149-155), so the prompt is
queued once. If that also gets no answer, the CLI says the outcome is
unknown and points to /queue list instead of asking for a resend (new
cli.queue.submit_unknown key in all 17 catalogs).
Refs #134889 (N5)
/queue rm and /queue edit reused the submit refusal: "The gateway did not
queue it ... Nothing was queued; send it again when the turn ends." That
was false for a removal or edit the owner refused, and it told the user
to resend a prompt that was already running.
Each outcome now gets its own message:
- a refusal names the item and the reason (could not remove or edit
queue item N);
- a row the drain had already claimed (stale_generation or
admission_started) says it already started and runs as it was sent;
- an rm that raced the claim, which the owner answers by interrupting
that run, says the gateway stopped it (before, it printed nothing);
- an rm or edit with no answer says the outcome is unknown and points
to /queue list.
Only a cancelled row leaves queued_inputs, so a turn that started still
gets painted. The new strings are in all 17 locale catalogs.
Refs #134889 (N5)
published_queue added every queued_inputs entry missing from the owner's
published pending list. When Ink or Desktop cancelled, replaced or steered
this CLI's queued prompt, the owner's next list left it out, and the dock
still showed it as queued for the rest of the process.
The owner's published list is now authoritative. An entry is shown from
queued_inputs only while no list has been published since its submit,
which covers the short gap between the submit's receipt and the owner's
next session.info. The first list published after that decides.
queued_inputs itself still owes the turn a paint (F2), so the dock reads
the publish order instead of trimming it.
Refs #134889 (N5)
A fast queued turn can finish while the CLI is still busy. queued_rows
then read its receipt as terminal and dropped the queued_inputs entry.
The idle tick later met that admission's buffered message.start with
nothing to match it, so it skipped it, and the user never saw the reply.
Listing now only leaves a started or settled admission out of the list.
It marks the admission for the idle tick, which paints the turn or, if
it never ran, forgets it. Queue membership comes from the owner's
receipt, and the "not painted yet" record is retired only by painting or
by a never-ran outcome.
Refs #134889 (N5)
The classic CLI held a busy-time /queue prompt in its own _pending_input.
That put it outside session_admissions and the restart contract, so an
owner restart or a disconnect (N2) lost or failed it.
Now /queue <prompt> typed while a turn runs is an ordinary queued
admission (prompt.submit {queued: true}), the way Ink and Desktop queue
busy input. The owner commits it when it accepts it, keeps it across a
restart and runs it once, in FIFO order. The CLI keeps no copy it could
send again. It records only which admissions it queued, so when the owner
starts one the idle tick paints it as the user's turn and
run_conversation pumps that admission without a second submit.
/queue list, edit, rm and clear read and change the owner's queue
(prompt.receipt, prompt.replace_queued, prompt.cancel). The live-work
dock shows the owner's published pending list. /queue move refuses to
reorder an owner row, because the FIFO runs rows in the order they were
sent. A refused submit is reported, and nothing is held locally. While
the session is idle, /queue still queues locally: the next turn
submits it at once.
Refs #134889 (N5)
Refs #134889 only