hermes-agent/apps/desktop/src
Austin Pickett 2bb531b67a
fix(desktop): extend read aloud + transcription timeouts (salvage of #39286) (#68056)
* fix(desktop): extend read aloud timeout

Hermes Desktop Read Aloud can show a false failure after 15s even when
backend TTS synthesis succeeds. The Desktop renderer bridge request to
/api/audio/speak blocks until provider synthesis, audio file read, and
base64 response encoding finish, so larger messages or slower remote TTS
providers can legitimately exceed the default 15s Electron backend
timeout (DEFAULT_FETCH_TIMEOUT_MS in hardening.ts).

Give only the blocking Read Aloud request a bounded TTS-specific timeout
(180s floor, 600s cap, text-length scaling). Normal Desktop API requests
keep the short default so real backend hangs still fail promptly.

Salvage of #39286 rebased onto current main (original branch conflicted
in apps/desktop/src/hermes.ts and hermes.test.ts against the newly-added
STARTUP_REQUEST_TIMEOUT_MS / PROMPT_SUBMIT_REQUEST_TIMEOUT_MS constants
and model-options tests). Both additions coexist; no behavior changed.

Co-authored-by: Ruslan Vasylev <ruslan.vasylev.vfx@gmail.com>

* fix(desktop): extend read aloud + transcription timeouts

Hermes Desktop Read Aloud can show a false failure after 15s even when
backend TTS synthesis succeeds. The Desktop renderer bridge request to
/api/audio/speak blocks until provider synthesis, audio file read, and
base64 response encoding finish, so larger messages or slower remote TTS
providers can legitimately exceed the default 15s Electron backend
timeout (DEFAULT_FETCH_TIMEOUT_MS in hardening.ts).

/api/audio/transcribe is the sibling blocking endpoint with the same bug
class: it blocks on provider STT + file handling + encoding behind the
same 15s default, so long clips / remote providers hit the same spurious
timeout. Give both requests a bounded, endpoint-specific timeout (180s
floor, 600s cap) — speak scales on text length, transcribe on the base64
payload length. Every other Desktop API request keeps the short default
so real backend hangs still fail promptly.

Salvage of #39286 rebased onto current main. The original PR was scoped
to /api/audio/speak only; this extends it to also close the transcribe
twin per OutThisLife's review suggestion on #39286, closing the whole
'audio endpoints time out at 15s' class in one shot.

Co-authored-by: Ruslan Vasylev <ruslan.vasylev.vfx@gmail.com>

---------

Co-authored-by: Ruslan Vasylev <ruslan.vasylev.vfx@gmail.com>
2026-07-20 09:51:31 -04:00
..
app feat(desktop): inline TTS voice/model settings in the Capabilities tab (#68017) 2026-07-20 05:38:38 -07:00
components fmt(js): npm run fix on merge (#67995) 2026-07-20 10:47:15 +00:00
contrib feat(desktop): expose ctx.i18n on the plugin SDK 2026-07-19 00:05:08 -04:00
fonts fix(desktop): crisp terminal text via opaque xterm canvas 2026-06-12 19:36:30 -05:00
hooks perf(desktop): kill the layout-thrash cascade on session switch (#66033) 2026-07-16 22:46:08 -04:00
i18n feat(desktop): custom endpoint settings (supersedes #42745) (#67759) 2026-07-19 19:59:46 -04:00
lib refactor(desktop): extract shared rafCoalesce helper for sash drags 2026-07-19 22:38:57 -05:00
plugins feat(desktop): plugin manager, runtime loader, and plugins settings 2026-07-13 17:57:53 -04:00
sdk feat(desktop): expose ctx.i18n on the plugin SDK 2026-07-19 00:05:08 -04:00
store fmt(js): npm run fix on merge (#67995) 2026-07-20 10:47:15 +00:00
themes refactor(desktop): retire desktop-controller for the contribution shell; views as contributions 2026-07-13 17:57:54 -04:00
types feat(desktop): inline TTS voice/model settings in the Capabilities tab (#68017) 2026-07-20 05:38:38 -07:00
global.d.ts feat(desktop): electron — openDir IPC + ⌘W menu bridge (tabs, not windows) 2026-07-13 17:57:54 -04:00
hermes-cron-scope.test.ts fix(desktop): scope the cron jobs list to the active profile 2026-07-19 12:19:22 -07:00
hermes-parity.test.ts feat(desktop): CLI/dashboard parity — skills hub, MCP test/toggle/catalog, maintenance ops, log filters (#57441) 2026-07-03 01:02:47 -07:00
hermes-profile-scope.test.ts fix(memory): profile-scope the provider config endpoints 2026-07-07 10:53:43 -04:00
hermes.test.ts fix(desktop): extend read aloud + transcription timeouts (salvage of #39286) (#68056) 2026-07-20 09:51:31 -04:00
hermes.ts fix(desktop): extend read aloud + transcription timeouts (salvage of #39286) (#68056) 2026-07-20 09:51:31 -04:00
main.tsx bench(desktop): measure the full picture — prod build, cold-start, first-token (#67697) 2026-07-19 17:52:39 -05:00
styles.css refactor(desktop): retire desktop-controller for the contribution shell; views as contributions 2026-07-13 17:57:54 -04:00
vite-env.d.ts Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00