feat(pheby): add authenticated GPT-Live voice setup

Use Hermes to exchange WebRTC offers for the connector profile. Keep cancellation acknowledgments private and guard replacement runs against stale delivery.
This commit is contained in:
Chris Mendoza
2026-11-20 12:36:28 -05:00
parent 3bfb300a2f
commit 49b180922d
8 changed files with 462 additions and 72 deletions
+21 -1
View File
@@ -210,7 +210,27 @@ another `chat.send` receives `run_active`. Never infer state from text.
Cancellation uses Hermes's supported interrupt mechanism (agent interrupt +
run-generation invalidation) — the conversation stays consistent and
resumable. A stale `run_id`, missing run, or run that Hermes can no longer
interrupt returns `not_found`; success emits exactly one cancelled event.
interrupt returns `not_found`. If the request carries a `request_id`, the caller
gets a correlated `run.finished` reply. Every authenticated client also gets the
same terminal event without the request ID.
### GPT-Live setup
Both HTTP routes accept `Authorization: Bearer <Pheby secret>`.
- `GET /voice-live/status` returns `available`, `reason`, `model`, and `voice`
when supported. Availability describes whether Hermes can resolve a key.
- `POST /voice-live/session` accepts `{"sdp":"<WebRTC offer>"}` and returns
`{"session_id":"<Live session ID>","sdp":"<WebRTC answer>"}`. Keep SDP line
endings intact. The connector supplies the Hermes voice prompt and uses
client delegation.
Submit a delegated voice turn through `chat.send` with the existing
`conversation_id`. `voice_context` marks a spoken turn and can include the
superseded request for a correction (up to 6000 characters, or an empty string
for the initial request). Hermes receives the context as a turn note. The
`run_id` in `run.accepted` correlates the primary
`message.complete` and `run.finished` with that turn.
---