hermes-agent/tests/tui_gateway
Brooklyn Nicholson 0b5a62c980 fix(agent): the desktop's tools reach it on remote and cloud backends too
The pane, in-app browser, and reaction tools were gated on HERMES_DESKTOP=1 —
an env var set only on backends Electron spawns itself (local and SSH). A
desktop client connected to a plain URL gateway or Hermes Cloud lost all six:
they were stripped from the schema before the model saw them, on the same
backend whose platform hint was telling it "you are chatting inside the Hermes
desktop app". open_preview, read_preview, read_terminal, close_terminal,
focus_pane, and react_to_message were all silently absent.

The client is not the host. Capability now resolves from the session's own
source, which session.create already carries:

- The six tools move into a `desktop_ui` toolset, off _HERMES_CORE_TOOLS so no
  other platform pays their schema.
- _gui_surface_toolsets(platform) folds `desktop_ui` (and the existing
  `project` tools) into the GUI gateway's resolution when the session's
  platform is the desktop app — the same answer on every topology.
- check_fn drops the env probe. It kept the one thing that is genuinely a
  per-process/user fact: react_to_message's display.message_reactions opt-in,
  which the desktop mirrors onto whichever gateway it is connected to.

react_to_message was doubly broken: it read that toggle behind the env gate, so
even a local-backend user's Settings toggle could not reach a remote session.

The embedded terminal pane keeps working correctly the other way round: it runs
`hermes --tui` against a desktop-spawned backend, and a tui-sourced session
gets no GUI tools even though HERMES_DESKTOP=1 is set on that process.
2026-08-06 20:27:00 -05:00
..
__init__.py
test_auto_continue.py
test_billing_rpc.py
test_change_watcher.py
test_codex_app_server_live_events.py
test_cold_start_gil_stall.py
test_compaction_status.py fix(update): test runs never mutate the live checkout — pytest-guard the marker and repair paths 2026-07-29 21:30:53 -07:00
test_compress_lock_skip.py
test_compute_host.py
test_compute_host_phase1.py
test_custom_provider_session_persistence.py
test_delegation_session_lifecycle.py
test_entry_import_off_main_thread.py
test_entry_picker_prewarm.py
test_entry_sys_path.py
test_failed_turn_retention.py
test_fast_session_scope.py
test_finalize_session_persist.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_gateway_owned_session_reap.py
test_goal_command.py
test_gui_surface_toolsets.py
test_image_routing_stale_model.py
test_inline_rpc_gil_starvation.py
test_interim_assistant_callback.py
test_iso_certify_seam.py
test_kanban_notify_poller.py
test_make_agent_provider.py
test_mcp_late_refresh_thread_owner.py
test_mcp_reload_rev.py
test_moa_reference_emit.py
test_model_switch_marker_role.py
test_pet_generate_rpc.py
test_project_tree.py
test_projects_rpc.py
test_protocol.py
test_reasoning_config_per_model.py
test_reasoning_session_scope.py
test_render.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_review_summary_callback.py
test_session_cwd_follow.py
test_session_id_injection.py
test_session_images_dir.py
test_session_platform_resolution.py
test_session_reclaim_notify.py
test_slash_worker_ansi.py
test_slash_worker_mcp_discovery.py
test_slash_worker_profile_home.py
test_slash_worker_sys_path.py
test_subagent_child_mirror.py
test_subprocess_encoding.py
test_undo_command.py
test_wait_for_mcp_discovery.py