Commit Graph

3 Commits

Author SHA1 Message Date
Teknium
7218b9a943 fix(desktop): queue cards in other windows refresh after a paused head is cancelled
After a viewer saw one stamped turn, the execution fence dropped every
unstamped lifecycle frame. The owner publishes its idle snapshot
(`_publish_pending`: queue, revision, the session's last generation in the
payload) unstamped once no execution is claimed, so cancelling or
discarding the head of a paused queue left stale queue cards in every
other Desktop window until another turn or a reload. The queued
cancellation itself (`message.complete` stamped with the owner epoch and
the row's admission, no generation) is not a turn's completion and must
not settle a live turn either.

Distinguish them from late execution frames: an idle owner snapshot is
admitted unless its generation is older than the fenced execution's (a
retired owner's); an admission-only frame never drives turn lifecycle.
The real-frame fixture now captures a paused-queue cancel on the second
owner.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#discussion_r4213739480
2026-10-07 20:47:57 -07:00
Teknium
a257876535 fix(gateway): the authority publishes the idle session.info after message.complete
The session authority published its post-turn session.info (running=false)
before the turn's message.complete; tui_gateway and every other host emit the
completion first. A Desktop viewer reading running=false for a live turn
treats the terminal frame as lost: it settles the bubble on the heartbeat
(heartbeatSettledStreamId) and races a stored-transcript read against the
real completion. In a window that sent the turn this painted the reply twice
(stored `<ts>-N-assistant` row beside `assistant-stream-*`) for ~200 ms
(core e2e behind-window-send "both windows converge" red 2/5 loaded, 0/5
on main).

Publish the idle snapshot after the completion, inside the same stream lock.
The Desktop execution-authority fixture is regenerated from the capture
script so its fence tests replay the new real order.
2026-10-07 01:06:17 -07:00
teknium1
6207b30e1e fix(desktop): execution fence reads the owner's top-level authority_epoch stamp (X8, reported by @Xipong)
SessionEvents.publish spreads {authority_epoch (int), execution_generation} onto
the event params beside type/payload; the shared client dispatches params
unchanged. acceptExecutionEvent read payload.execution_epoch (string), so every
real frame was unversioned, no authority was ever installed, and a completion
or Stop from a retired owner epoch could still settle the current generation.

One protocol shape now: the fence and its two consumers (message-stream
dispatcher, turn-lease release) read the event's authority_epoch /
execution_generation, coercing the integer epoch to its string identity at the
boundary; session.info's "authoritative settle" check reads the same fields.

The new test replays frames captured from the real owner
(tests/gateway/fixtures/execution_frames_capture.py -> execution-authority.frames.json)
through JsonRpcGatewayClient into acceptExecutionEvent: two runtime epochs on one
session, the retired epoch's late message.complete is refused and leaves the
installed authority untouched.
2026-09-12 17:19:43 -07:00