15 Commits

Author SHA1 Message Date
tes a42038b825 Diagnostics: forward upstream events + errors to device as 'debug' envelopes
Coolify container logs aren't accessible from the dev sandbox, so the only
log surface we can read is the Pi journal. The relay now forwards every
upstream event type to the device as {type:'debug', message:'relay evt=<T>'}
and every mid-session upstream error event as {type:'error',code:'upstream_<C>'}.

The client's Session.dispatch handles 'debug' as an INFO log line. Updates
the wake-flow integration test's receive-loop to skip over the new debug
envelopes via a ReceiveUntil helper.
2026-06-12 06:59:14 +00:00
tes 8bb0ce51b1 Plan 3 fix: GA turn_detection auto-create_response + reset state on WS reconnect
GA Realtime API requires create_response:true and interrupt_response:true
inside turn_detection — without them the model never auto-generates a
reply after VAD detects speech_stopped, so the relay idles out at 30s
with no assistant audio. Add both.

Client side: when the /device WS drops (Coolify rolling deploy, etc.),
Session.run_forever reconnects but the StateMachine kept whatever state
it was in — usually LISTENING, which permanently disables the wakeword.
Add StateMachine.force_idle() and a Callbacks.on_disconnected() hook;
main.py wires it to force the state back to IDLE on every disconnect.
Also harden Session's fire-and-forget send_* helpers to swallow
ConnectionClosed instead of bubbling up as unhandled task exceptions.
2026-06-12 06:50:00 +00:00
tes d01b78b225 Relay: log upstream events + forward error envelopes to device for diagnostics
Plan 3 smoke surfaced 'session_ended reason=error' on every wake with no
context. The relay now logs every upstream event type at INFO and forwards
any upstream 'error' event to the device as 'error code=upstream_<code>'
so it appears in the Pi's journal alongside the wake/session_ended pair.

Also extends the client's wakeword.predict with per-frame RMS + score
diagnostics and the bridge loop with a 5 s heartbeat for triage.
2026-06-12 06:28:58 +00:00
tes 8662dbe8a7 Plan 3: main.py composition root (audio + state + wakeword + session + playback wired) 2026-06-11 22:52:01 +00:00
tes b1eeaa8af3 Plan 3: backend WS client + dispatch + tool round-trip 2026-06-11 22:51:23 +00:00
tes fa245d87a5 Plan 3: playback worker + wake/sleep wav + software volume gain 2026-06-11 22:50:13 +00:00
tes d0bd141082 Plan 3: openwakeword wrapper with threshold + cooldown 2026-06-11 22:49:40 +00:00
tes 55257b8867 Plan 3: USB device discovery + persistent audio streams 2026-06-11 22:49:20 +00:00
tes d155af4b70 Plan 3: pair CLI (POST /api/pair, write config.json) 2026-06-11 22:48:46 +00:00
tes 781ef9377a Plan 3: 24 kHz->16 kHz downsample helper for the wakeword feed 2026-06-11 22:48:16 +00:00
tes 4d83f2d9fd Plan 3: load/save ~/assistant/state/config.json with mode 0600 2026-06-11 22:47:50 +00:00
tes d75129c4f9 Plan 3: state machine (IDLE -> WAKE_PENDING -> LISTENING <-> ASSISTANT_SPEAKING -> IDLE_PENDING -> IDLE) 2026-06-11 22:47:23 +00:00
tes 908e3f4907 Plan 3: add client.log structured logger 2026-06-11 22:46:44 +00:00
tes 79d6e923a6 Plan 3: scaffold Python test harness and stub client package 2026-06-11 22:46:25 +00:00
tes a7e5e13ac8 Add Python client placeholders for bundle build (full impl in Plan 3) 2026-06-11 19:04:18 +00:00