Files
hermes-agent/apps
John Paul Soliva ebdde89ea1 fix(desktop): send a queued prompt once when several windows drain it
Every desktop window auto-drains the shared composer queue: ChatBar drains
the selected session and useBackgroundQueueDrain drains every other idle
one. Since #122953 each window also sees the other windows' entries. The
drain guard is a renderer-local ref, so two windows can pick the same entry
and both submit it before either removes it. The gateway does not reject
the second copy: a queued submit to a busy session is queued server-side
and runs as its own turn.

Both drain paths now run inside withQueueDrainClaim, a per-session Web Lock
that the browser arbitrates across windows and frees when the holder closes.
The entry is picked inside the claim from the live persisted queue, so a
window that waited finds an entry the holder already sent gone and sends
nothing. ChatBar auto-drain re-locates its entry by id and does not count
"already sent elsewhere" as a failed attempt, so it can no longer run up the
stuck-queue toast.

Co-authored-by: furancis <brooklyn.bb.nicholson@gmail.com>
2026-09-29 17:30:36 -05:00
..