Skip to content

fix(desktop): keep clarify answerable across reconnect/hydration + tool-progress off - #69795

Merged
OutThisLife merged 4 commits into
mainfrom
bb/salvage-47544-clarify-hydration
Jul 23, 2026
Merged

fix(desktop): keep clarify answerable across reconnect/hydration + tool-progress off#69795
OutThisLife merged 4 commits into
mainfrom
bb/salvage-47544-clarify-hydration

Conversation

@OutThisLife

Copy link
Copy Markdown
Collaborator

Salvages #47544 by @lidises (정수환). The original patched the pre-split
use-message-stream.ts; the TS half is re-authored onto the current
use-message-stream/gateway-event.ts. The Python half is cherry-picked
verbatim (authorship preserved).

Two clarify-blocking races this closes

  1. Reconnect / hydration race (TS). The inline clarify UI normally mounts
    from the tool.start row. If that row is missed on a stream reconnect, the
    sidebar shows "needs input" but the transcript has nowhere to render the
    choices — the agent blocks on clarify.respond forever. We now upsert a
    stable pending clarify tool row directly from clarify.request (keyed on
    the request id, so a later real tool.start/complete merges rather than
    duplicates).

  2. Tool-progress = off (Python). When a session has tool progress
    disabled, clarify's lifecycle events were suppressed like ordinary tool
    chrome, again leaving only the sidebar dot. _tool_lifecycle_required_for_ui
    whitelists clarify so its tool.start/tool.complete always emit;
    non-interactive tools (e.g. terminal) stay hidden.

Tests

  • clarify-hydration.test.tsx — new: dispatches clarify.request through the
    real useMessageStream and asserts an answerable clarify row appears, and
    that a same-id tool.start merges (no duplicate).
  • tests/test_tui_gateway_server.py — clarify lifecycle emits with progress
    off; a non-interactive tool stays hidden.

One of the clarify "renders with no selectable choices" triggers (family: #69122).

Supersedes #47544.

Co-authored-by: 정수환 centerid@naver.com

lidises and others added 3 commits July 22, 2026 22:17
Re-authored onto the current use-message-stream/gateway-event.ts (the
original patched the pre-split use-message-stream.ts). When the tool.start
row that normally mounts the inline clarify UI is missed (stream reconnect
/ hydration race), upsert a stable pending clarify tool row from
clarify.request itself so the prompt stays answerable; a real
tool.start/complete with the same request id merges rather than duplicates.

Co-authored-by: 정수환 <centerid@naver.com>
Attribution mapping for the salvaged #47544 commit.
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/desktop Electron desktop app (apps/desktop/*) comp/tui Terminal UI (ui-tui/ + tui_gateway/) sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state labels Jul 23, 2026
@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

૮ >ﻌ< ა ci review

ran on 6adeb8e

ℹ️ Info

Desktop E2E visual evidence · View test artifacts · View job

1 visual diff.

inline evidence is publishing...

…uplicate

The hydrated row (from clarify.request's request_id) and the real tool.start
row (the model's tool_call_id) have different ids, so id-only matching appended
a second clarify card in the normal path (caught by the BLOCKING_CLARIFY e2e:
'question' resolved to 2 elements). Add 'question' to the tool match-value keys
so a clarify upsert merges into the existing pending clarify row regardless of
id (same request<->args correlation ClarifyToolPending already uses); when no
row exists yet (reconnect/hydration) it still creates one.
@OutThisLife
OutThisLife merged commit d21165c into main Jul 23, 2026
44 checks passed
@OutThisLife
OutThisLife deleted the bb/salvage-47544-clarify-hydration branch July 23, 2026 04:25
randlee pushed a commit to randlee/hermes-agent that referenced this pull request Aug 11, 2026
…ol-progress off (NousResearch#69795)

* fix(desktop): keep clarify lifecycle when tool progress is off

* fix(desktop): render clarify prompt from the request event

Re-authored onto the current use-message-stream/gateway-event.ts (the
original patched the pre-split use-message-stream.ts). When the tool.start
row that normally mounts the inline clarify UI is missed (stream reconnect
/ hydration race), upsert a stable pending clarify tool row from
clarify.request itself so the prompt stays answerable; a real
tool.start/complete with the same request id merges rather than duplicates.

Co-authored-by: 정수환 <centerid@naver.com>

* chore(contributors): map centerid@naver.com -> lidises

Attribution mapping for the salvaged NousResearch#47544 commit.

* fix(desktop): correlate clarify rows by question so hydration can't duplicate

The hydrated row (from clarify.request's request_id) and the real tool.start
row (the model's tool_call_id) have different ids, so id-only matching appended
a second clarify card in the normal path (caught by the BLOCKING_CLARIFY e2e:
'question' resolved to 2 elements). Add 'question' to the tool match-value keys
so a clarify upsert merges into the existing pending clarify row regardless of
id (same request<->args correlation ClarifyToolPending already uses); when no
row exists yet (reconnect/hydration) it still creates one.

---------

Co-authored-by: 정수환 <centerid@naver.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/desktop Electron desktop app (apps/desktop/*) comp/tui Terminal UI (ui-tui/ + tui_gateway/) P2 Medium — degraded but workaround exists sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants