hermes-agent/tests/tui_gateway
brooklyn! 3dd9d5e692
fix(tui_gateway): tolerate late clarify + terminal.read replies after timeout (#69773)
`_block()` bridges four blocking request types — secret, sudo, clarify,
terminal.read — with an identical lifecycle: on timeout the tool gives up and
returns empty, but a slow renderer (or a WebSocket reconnect that dropped
tool.complete) can still answer afterward. Only secret and sudo tolerated that
late reply; clarify and terminal.read still hit the generic 4009 "no pending
request" error, which clients surface as a raw JSON-RPC string (and at least
one desktop fork re-armed the pending request on the error).

Bring the two stragglers in line with the pair that already works:
- `_block` now emits `{event}.expire` on timeout for all four request types.
- `clarify.respond` and `terminal.read.respond` pass `allow_expired=True`, so a
  late answer resolves to `{"status": "expired"}` instead of erroring.

Tests parametrize the timeout-expiry and late-idempotent-response cases over
all four bridges; the old test asserting clarify stays a 4009 error is updated
to the new graceful contract.

Supersedes #56571 (clarify) and #64886 (terminal.read) — same root cause, one fix.

Co-authored-by: liuhao1024 <liuhao1024@users.noreply.github.com>
Co-authored-by: pierrenode <pierrenode@users.noreply.github.com>
2026-07-22 23:24:42 -05:00
..
__init__.py
test_billing_rpc.py
test_codex_app_server_live_events.py feat(codex): stream live app-server events to TUI/desktop tool cards 2026-07-17 13:44:12 -07:00
test_compaction_status.py fix(desktop): synchronize context usage and compaction status 2026-07-22 16:58:58 -07:00
test_compute_host.py feat(dashboard): isolate turns in compute host (#65895) 2026-07-16 15:24:03 -04:00
test_compute_host_phase1.py fix(desktop): salvage /compress cluster — session.compress RPC + dedicated RPC routing (#68229) 2026-07-22 16:40:06 -04:00
test_custom_provider_session_persistence.py
test_delegation_session_lifecycle.py fix(delegation): fail-closed orphan handling + session-scoped delegation lifecycle 2026-07-08 07:06:15 -07:00
test_entry_sys_path.py
test_fast_session_scope.py fix(desktop): session-scope fast mode, surface profile ownership + pinned model override 2026-07-17 14:31:10 -04:00
test_finalize_session_persist.py fix tui finalize persist drop conversation_history so disconnect saves chat 2026-07-10 07:47:10 -07:00
test_gateway_owned_session_reap.py fix(tui): derive gateway-owned sources from the Platform enum, not a hardcoded list 2026-07-07 22:15:36 -07:00
test_goal_command.py feat(moa): make /moa one-shot only; route preset switching through the model picker 2026-06-27 03:09:09 -07:00
test_image_routing_stale_model.py fix(tui): route images with the live switched model 2026-07-17 09:08:30 -07:00
test_inline_rpc_gil_starvation.py fix(desktop): prevent false runtime-not-ready under gateway load (#66174) 2026-07-20 10:51:27 -04:00
test_interim_assistant_callback.py fix(desktop, ink): don't wipe messages before final message (#65919) 2026-07-20 11:42:29 -04:00
test_iso_certify_seam.py fix(ci): make tests, workflows, and attribution reliable under load (#66373) 2026-07-17 20:55:24 +00:00
test_make_agent_provider.py
test_mcp_late_refresh_thread_owner.py fix(mcp): late-refresh must see desktop/dashboard discovery thread owner (#55514) 2026-06-30 02:08:37 -07:00
test_mcp_reload_rev.py fix(tui): revision-aware reload.mcp — an ack now means the revision was LOADED 2026-07-21 20:27:15 -05:00
test_moa_reference_emit.py feat(moa): render reference-model blocks in TUI and desktop, not just CLI (#53855) 2026-06-27 18:46:20 -07:00
test_model_switch_marker_role.py fix(tui): use role=user for model switch marker to avoid HTTP 400 on strict providers (#48338) 2026-06-28 04:34:55 -07:00
test_pet_generate_rpc.py feat(pets): polish generate flow and reduce hatch CPU pressure 2026-06-24 19:08:06 -05:00
test_project_tree.py fix(desktop): mirror Windows path identity in live overlay + WSL spelling 2026-07-12 04:33:05 -04:00
test_projects_rpc.py feat(desktop): configure repository discovery (supersedes #67630) (#68642) 2026-07-21 10:09:31 -04:00
test_protocol.py fix(tui_gateway): tolerate late clarify + terminal.read replies after timeout (#69773) 2026-07-22 23:24:42 -05:00
test_reasoning_config_per_model.py feat(config): support per-model reasoning_effort overrides 2026-07-14 11:46:40 -07:00
test_reasoning_session_scope.py fix(desktop,tui-gateway,zai): stop thinking-off from reverting to medium 2026-07-02 15:23:47 -05:00
test_render.py
test_review_summary_callback.py
test_session_platform_resolution.py test: deflake CI and dev-machine flaky tests in bulk (11 tests, 10 files) (#61816) 2026-07-09 20:03:11 -07:00
test_slash_worker_ansi.py fix(tui_gateway): strip ANSI from slash-worker output for desktop chat 2026-07-01 16:28:34 -05:00
test_slash_worker_mcp_discovery.py test(tui): cover profile-local MCP discovery 2026-07-10 18:09:17 +05:30
test_slash_worker_profile_home.py fix(tui): pass profile_home to slash_worker subprocess for profile-local skill discovery (#40677) 2026-07-07 05:14:00 -07:00
test_slash_worker_sys_path.py fix(tui): use shared harden_import_path guard in slash_worker 2026-07-01 05:29:22 -07:00
test_subagent_child_mirror.py
test_undo_command.py test: deflake CI and dev-machine flaky tests in bulk (11 tests, 10 files) (#61816) 2026-07-09 20:03:11 -07:00
test_wait_for_mcp_discovery.py fix(ci): make tests, workflows, and attribution reliable under load (#66373) 2026-07-17 20:55:24 +00:00