Files
hermes-agent/apps
teknium1 85b93771d2 fix(desktop): a stopped clarify no longer swallows the next turn's question
After #108525 the turn-settle seal stopped writing `result: {}` onto abandoned
tool calls and left them result-less with `completedAt`. Two clarify consumers
still keyed "pending" on `result === undefined` alone:

- `findPendingClarifyLocation` adopted the sealed call as the "sole open
  clarify" fallback for an uncorrelated request, so a new clarify raised after
  the user stopped an earlier one re-armed the OLD row (`streamId` = old turn)
  and the new question never got a card.
- `ClarifyTool` reads the session's live clarify request, so once the new
  request arrived the sealed row painted the NEW question too: two live cards
  for one question, the stopped one with no request id behind it.

Sealed calls now only re-arm on a genuine correlation (request id / question
match, which is the resume case; the seal comes off so the row renders live)
and never as the uncorrelated fallback; in the timeline a settled-without-result
clarify renders as the generic history row, as every other tool already does.

Live Desktop A/B (real Electron, loopback provider, stop Q1 then ask for Q2):
before 2 live clarify cards both showing Q2; after 1 live card (Q2), Q1 shown
as "Result unavailable", answer reaches the provider.
2026-09-14 10:18:17 -07:00
..