mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-31 19:16:29 +00:00
Queued messages in the desktop app lived in localStorage and were drained
by a React useEffect on the busy->false edge — if the session tab wasn't
mounted, the effect never ran and queued prompts sat dormant forever.
Move the queue into the agent process where steer already lives:
- agent/turn_queue.py: TurnQueue, a thread-safe FIFO on AIAgent (wired in
agent_init next to _pending_steer). Entries carry a `source` field
("queue" vs "busy_submit") so drain events tell clients whether the
text was already echoed optimistically.
- tui_gateway: _enqueue_prompt/_drain_queued_prompt delegate to
agent.turn_queue; new session.queue.add/list/remove/clear/promote/update
RPCs; queue.updated + queue.drained events; queue in session.info.
An idle-session enqueue drains immediately — the gateway owns every
drain path. session.interrupt clears the queue (keep_queue opts out
for the promote+interrupt "send now" gesture). A leftover pending_steer
returned by run_conversation is re-queued as the next turn instead of
being silently dropped.
- steer honesty: new agent._on_steer_event observer fires steer.applied
at the two real injection sites (pre-API drain + tool-batch drain) and
steer.dropped when an interrupt discards the pending steer. The desktop
shows steers as pending in the queue panel and only appends the steer:
transcript row when the model actually saw the text (both the primary
composer and session tiles previously painted it at RPC-accept time).
- desktop: composer-queue.ts rewritten as a gateway-backed mirror
(optimistic updates settled by queue.updated); the auto-drain effect is
deleted; "send now" promotes on the gateway; attachments resolve to
@file: refs at enqueue time so queued text is self-contained when the
gateway drains it later; one-time localStorage migration. Dead code
removed: fromQueue submit option, shouldAutoDrain, queueStuck i18n.
Tests: tests/tui_gateway/test_turn_queue.py (TurnQueue unit + RPC
integration + drain semantics), composer-queue.test.ts rewritten for the
gateway-backed store.
|
||
|---|---|---|
| .. | ||
| bootstrap-installer | ||
| desktop | ||
| shared | ||