Skip to content

fix(desktop): expose react_to_message on remote-desktop sessions - #80659

Closed
fluxkapacitor wants to merge 1 commit into
NousResearch:mainfrom
fluxkapacitor:fix/reactions-remote-desktop-gate
Closed

fix(desktop): expose react_to_message on remote-desktop sessions#80659
fluxkapacitor wants to merge 1 commit into
NousResearch:mainfrom
fluxkapacitor:fix/reactions-remote-desktop-gate

Conversation

@fluxkapacitor

@fluxkapacitor fluxkapacitor commented Aug 7, 2026

Copy link
Copy Markdown

Summary

Fixes #80259 — the message-reactions agent tool (react_to_message) stays gated off for desktop sessions served by the current serve backend — both local and remote — even when the user opted in via Settings → Appearance.

Root cause

check_react_requirements() required HERMES_DESKTOP=1:

if not env_var_enabled("HERMES_DESKTOP"):
    return False

That env var is only set by two spawn paths: the legacy dashboard backend spawn and the remote-SSH spawn. The current serve backend the desktop app spawns locally gets it from neither — buildDesktopBackendEnv (apps/desktop/electron/backend-env.ts) sets only PYTHONPATH/PYTHONUTF8/PATH — and sessions recorded by serve carry the webui platform label, not source='desktop'. So the gate fails for local desktop sessions too, and for remote-desktop topologies (Desktop client on machine A → always-on dashboard/gateway on machine B — e.g. laptop → home mini :9120), the opt-in (display.message_reactions) is never reached, and the tool is simply absent from the agent's toolset.

Fix

The backend binds one reliable per-turn marker for every desktop session: HERMES_SESSION_SOURCE=desktop (the same durable signal CLI/TUI sessions use, per gateway/session_context.py). The gate now accepts that marker before falling back to the DB source='desktop' check:

  • tools/react_to_message_tool.py_desktop_session_context() accepts HERMES_SESSION_SOURCE=desktop
  • tests/test_message_reactions.py — +2 tests: the serve-backend shape (no HERMES_DESKTOP, session source webui, per-turn marker present) must pass; the browser-WebUI shape without the desktop marker must stay gated (so the third-party/headless WebUI never gets the tool)

Behavior preserved

  • Opt-in still required (display.message_reactions) — no surface gets the tool by default
  • Non-desktop surfaces stay gated (bluebubbles, CLI, browser-WebUI without the marker) — covered by tests
  • Sibling GUI tools (read_terminal, focus_pane, open_preview, …) keep their existing gates; if maintainers want the whole family unified on the session-source signal, that's a natural follow-up (happy to do it)

Testing

  • scripts/run_tests.sh tests/test_message_reactions.py — 19/19 green
  • Live gate check evaluates True on both the local serve-backend shape and the remote-dashboard shape

This PR is deliberately not mixed with any other carry (e.g. the bluebubbles webhook fix in #69593).

The reaction tool's gate required HERMES_DESKTOP=1, which only the local
Electron spawn and remote-SSH spawn set. Remote-desktop topologies
(Desktop client on machine A -> always-on dashboard/gateway on machine B)
never get that env var, so react_to_message stayed hidden even when
opted in via Settings -> Appearance.

The backend binds HERMES_SESSION_SOURCE=desktop for every desktop turn;
accept it (before the DB source='desktop' fallback) so remote-desktop
sessions pass the gate while browser-WebUI sessions without the marker
stay gated. Opt-in is still required.

Fixes NousResearch#80259
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/desktop Electron desktop app (apps/desktop/*) area/sessions Session lifecycle, resume, persistence, history sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state labels Aug 7, 2026
@fluxkapacitor

Copy link
Copy Markdown
Author

Superseded by upstream commit 7ad9ace ("fix(agent): the desktop's tools reach it on remote and cloud backends too", by Brooklyn Nicholson) — which replaced the HERMES_DESKTOP=1 env gate with session-source-based gating, covering the same six tools (open_preview, read_preview, read_terminal, close_terminal, focus_pane, react_to_message) on plain-URL and cloud backends.

This PR's env-var approach is obsolete; the upstream fix is verified working from a remote-gateway desktop session (reactions round-trip both directions, preview read live). Closing in favor of the merged upstream fix. Issue #80259 already closed as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/sessions Session lifecycle, resume, persistence, history comp/desktop Electron desktop app (apps/desktop/*) 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.

fix(desktop): message reactions gated off for remote-desktop sessions (HERMES_DESKTOP only set locally)

2 participants