Answers read aloud: Voice on the menu, ElevenLabs voices per agent via the bridge (0.5.0)

- bridge: GET /v1/speech (which agents have a voice) and GET /v1/turns/{id}/speech (MP3 of the
  caller's own finished answer, markup removed, first 900 characters). ElevenLabs adapter; key
  and voice ids from the environment; per-device budget; last three clips kept in memory.
  speech.done / speech.failed log ids, lengths and durations only.
- bridge: forceCloseConnections. A request the client had abandoned kept shutdown waiting for
  ever (also true of /v1/transcribe as deployed). Regression test for both routes.
- client: 'Voice: off/on' on the opening menu when the bridge offers it and the page can play
  sound; off at every launch. With it on, a finished answer is fetched and played; it stops
  when the answer leaves the screen; the app does not leave the glasses while it plays.
- tests: fake provider, fake loudspeaker (tests/integration/voice.test.ts).
- docs: 0006, security 3g-3i, device plan E, 0.4.1 rollout and Dan's sound check report.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Dan
2026-11-29 12:11:38 -08:00
co-authored by Claude Fable 5.2
parent d65beeab77
commit 9874e1bb5b
25 changed files with 1199 additions and 17 deletions
+16
View File
@@ -94,6 +94,22 @@ Stated so they are not mistaken for protections.
touch) and asks the browser which media devices exist; output names, if the browser gives
them, are shown on the page only. It plays a tone or the phone's own voice only when a button
on the page is pressed. It sends nothing to the bridge and records nothing.
3g. **With Voice switched on (0.5.0), answers leave your infrastructure.** Until now nothing
but the agent's own model calls did. When the bridge has an ElevenLabs key and the user has
switched "Voice" on (a menu entry on the glasses, off at every launch), the app asks the
bridge for the speech of each answer and the bridge sends that answer's text, with markup
removed and cut to 900 characters, to ElevenLabs, which returns audio. What ElevenLabs keeps
is governed by its terms and the account's settings, not by this code. Questions are not
sent; only answers. The key is in `/etc/hermeven/bridge.env` and is never sent to the app.
A client can only obtain speech for its own finished turns, at most six new ones a minute,
so a stolen device credential cannot use the account to speak arbitrary text.
3h. **Where the sound comes out is not known to the app.** A page in the Even app cannot tell
which output Android is using (measured on Dan's phone, 2026-11-29: one output, no name). With
Voice on and no earbuds connected, the answer is spoken from the phone's loudspeaker, to
whoever is nearby. Voice is therefore never on by default and is not remembered.
3i. **Shutdown now closes every connection** (`forceCloseConnections`). Before, a request the
app had given up on could keep the bridge from stopping until systemd killed it after 20 s.
A request cut off by a shutdown is retried by the app as after any other network failure.
4. **In the simulator, raw audio frames are echoed to the WebView console.** Whether the phone
does the same is unknown and is on the device checklist. If it does, recordings would be
visible to whoever can read that console.