hermes-agent/apps/desktop/src/app
Brooklyn Nicholson 81436e143e fix(approval): carry allow_permanent to TUI + desktop approval prompts
When a tirith content-security warning is present the approval backend
forces allow_permanent=False and silently downgrades an "always" choice to
session scope (the persistence loop in check_all_command_guards only honors
"always" → permanent when no tirith finding exists). But the gateway notify
payload that drives the TUI and the Electron desktop app never carried that
flag, so both surfaces always rendered "Always allow" — offering a permanent
allow the backend would quietly refuse to persist.

Plumb allow_permanent end-to-end:
- tools/approval.py: include `allow_permanent: not has_tirith` in the gateway
  approval_data the notify callback emits as `approval.request`.
- ui-tui: thread `allowPermanent` through the event handler, gateway types,
  and ApprovalReq; ApprovalPrompt drops the "always" option (and renumbers the
  quick-pick keys) when it's false.
- apps/desktop: thread `allow_permanent` through the gateway payload type, the
  per-session approval store, and the inline ApprovalBar, which now hides the
  "Always allow…" dropdown item when permanent allow is disallowed — reusing
  the existing DropdownMenu / confirm-Dialog UI.

The desktop/TUI render path for approvals already landed in #38578 (the root
cause of approvals not surfacing in the GUI); this completes the salvage of
#37856 by carrying allow_permanent across both surfaces. #37856's original
thread-local _block() approach is dropped: desktop/TUI approvals resolve via
approval.respond → resolve_gateway_approval (the per-session queue), not the
_block()/request_id correlation, so a worker-thread callback waiting on _block
would never be released by the real UI.

Tests: gateway notify payload carries allow_permanent (True without tirith,
False with a tirith warning); ui-tui approvalAction reduced option set +
event-handler allowPermanent propagation; desktop store round-trip + the
ApprovalBar showing/hiding "Always allow".

Supersedes #37856
Closes #37812

Co-authored-by: LeonSGP43 <cine.dreamer.one@gmail.com>
2026-06-11 18:23:59 -05:00
..
agents feat(desktop): add i18n with Simplified Chinese (zh-Hans) support 2026-06-05 10:32:26 -07:00
artifacts feat(desktop): add i18n with Simplified Chinese (zh-Hans) support 2026-06-05 10:32:26 -07:00
chat fix(desktop): carve sidebar nav rows out of the titlebar drag region (#44453) 2026-06-11 15:10:09 -05:00
command-center feat(desktop): unified overlay design system, BrandMark & onboarding redesign (#40708) 2026-06-06 16:32:47 -05:00
command-palette fix(desktop): apply the shared HUD tokens to the marketplace submenu 2026-06-09 23:43:29 -05:00
cron fix(desktop): cron overlay mutations sync the sidebar instantly 2026-06-06 16:47:46 -05:00
gateway/hooks fix(desktop): scope remote workspace defaults 2026-06-11 09:41:35 -07:00
hooks feat(desktop): resizable VS Code-themed terminal pane + palette polish (#42521) 2026-06-09 23:15:20 -05:00
messaging Show platform sources in desktop sessions 2026-06-07 23:44:04 -07:00
overlays refactor(desktop): converge cron overlay onto profiles' split layout 2026-06-06 16:39:56 -05:00
profiles refactor(desktop): converge cron overlay onto profiles' split layout 2026-06-06 16:39:56 -05:00
right-sidebar fix(desktop): stop file tree throwing "Cannot have two HTML5 backends" on remount (#43541) 2026-06-11 11:47:34 -07:00
session/hooks fix(approval): carry allow_permanent to TUI + desktop approval prompts 2026-06-11 18:23:59 -05:00
settings Merge pull request #43292 from NousResearch/bb/vscode-marketplace-themes 2026-06-09 23:53:59 -05:00
shell fix(desktop): keep model runtime state per session (#43702) 2026-06-10 18:16:50 +00:00
skills feat(desktop): unified overlay design system, BrandMark & onboarding redesign (#40708) 2026-06-06 16:32:47 -05:00
desktop-controller.tsx refactor(cron): rebrand Cron Recipes -> Automation Blueprints 2026-06-11 10:49:47 -07:00
floating-hud.ts style(desktop): use the nous overlay surface (--stroke-nous + --shadow-nous) for the HUDs 2026-06-09 23:49:02 -05:00
index.tsx Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
layout-constants.ts feat(desktop): hover-reveal collapsed sidebars as fixed overlays (#41670) 2026-06-07 22:41:21 -05:00
model-picker-overlay.tsx Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
model-visibility-overlay.tsx feat(desktop): inline model picker in the status bar 2026-06-02 19:09:41 -05:00
page-search-shell.tsx feat(desktop): add i18n with Simplified Chinese (zh-Hans) support 2026-06-05 10:32:26 -07:00
routes.ts chore(desktop): zero eslint/typecheck debt + prettier pass (#39100) 2026-06-04 14:10:38 +00:00
session-picker-overlay.tsx desktop: registry-driven slash commands + first-class /resume & /handoff (#42351) 2026-06-11 01:49:24 +00:00
session-switcher.tsx feat(desktop): theme the terminal ANSI palette + restyle the Cmd-K / Ctrl-Tab HUDs 2026-06-09 23:37:50 -05:00
types.ts fix(desktop): refresh session model metadata on switch (#43977) 2026-06-11 10:05:32 -04:00
updates-overlay.tsx fix(desktop): close the backend update overlay on success; error on no-return 2026-06-08 08:58:26 -07:00