Repository navigation
feat(phone): GAIA texts or calls you for urgent alerts - #6790
Draft
kovtcharov wants to merge 90 commits into
Draft
kovtcharov wants to merge 90 commits into
kovtcharov wants to merge 90 commits into
Conversation
Adding Kokoro to the talk profile also put it in `gaia init --profile all`, whose model check sent every non-embedding model a chat request, so a clean install reported the voice model as broken. Init now recognises TTS models from the model registry, checks them by synthesizing one word, and labels them "speech" in `gaia init --check --load`. The docs now say to run `gaia download --agent talk` before asking the agent to read aloud, since the tool no longer downloads Kokoro itself.
Replies can now be heard: a speaker button on each Agent UI reply and /read-aloud in the TUI speak them through Lemonade's Kokoro voice, in a voice, speed and auto-read choice both apps share via ~/.gaia/config.json. - Backend: GET/PUT /api/speech/settings and POST /api/speech (WAV), with 503/502/422 that say what failed; read_aloud_voice/speed/auto config keys validated by gaia config. - Agent UI: per-reply button, Settings > Read aloud (voices grouped by accent and gender, Preview, speed, auto-read), markdown stripped and long replies spoken in pieces with the next fetched ahead. - TUI: /read-aloud and /voice, playback through the OS player, voice list embedded and pinned to KOKORO_VOICES by a drift test.
A fetch still running after Speak returned read the package-level folder while a test reset it, which the race detector caught on Linux and macOS CI.
…h tool Merges amd#6204 (the flagship text_to_speech tool) under read-aloud so GAIA has one way to make speech: the same Lemonade client, voice list and speed range, and the voice and speed the user picks for reading aloud. - text_to_speech now defaults to read_aloud_voice and read_aloud_speed from ~/.gaia/config.json when the request names neither. - Its speed bounds come from READ_ALOUD_MIN_SPEED/MAX_SPEED, the range the settings already enforce.
The speed menu's "Normal" carried the bracketed English hint, which an <option> can't style and which scrambles in rtl; option text now uses t.bare. The error detail used dir="auto", which pushed English 210px off the row's edge in Arabic; it is a <bdi> now. The rtl audit gains a rule for <option> text so the first can't come back.
# Conflicts: # hub/agents/gaia/npm/CHANGELOG.md # hub/agents/gaia/python/gaia_agent/chat_agent.py # hub/agents/gaia/python/tests/test_chat_tts_tool.py # src/gaia/audio/lemonade_tts.py
Main's new Settings layout came with fresh reference screenshots that predate this branch's Read aloud section in the sidebar.
# Conflicts: # src/gaia/apps/webui/src/components/ChatView.tsx # src/gaia/apps/webui/src/components/settings/SettingsDialog.css # src/gaia/apps/webui/src/components/settings/SettingsDialog.tsx # src/gaia/apps/webui/visual/__screenshots__/settings-general-dark-win32.png # src/gaia/apps/webui/visual/__screenshots__/settings-general-light-win32.png
# Conflicts: # hub/agents/gaia/npm/CHANGELOG.md
# Conflicts: # src/gaia/apps/webui/src/components/ChatView.tsx
# Conflicts: # hub/agents/gaia/python/tests/test_chat_tts_tool.py
# Conflicts: # src/gaia/apps/webui/src/components/ChatView.tsx
…ntract GAIA could speak replies but not listen. This adds the server half of dictation and voice mode: a session that streams the microphone to Lemonade's realtime recognizer, plays a chime when you stop talking, speaks the text the app hands it clause by clause, and drops queued speech the moment you interrupt. - gaia.voice: realtime listener, clause chunker, <spoken> splitter, PCM and G.711 helpers, the host-agnostic socket protocol. Refuses a remote Lemonade. - Agent UI server: GET /api/voice/status, POST /api/voice/models/download (voice models only), WS /api/voice/session with host, origin and mobile-access token checks. - Voice turns go through the normal chat path with reply_style "voice". The flagship (API 2.28) adds a per-turn note asking for a short <spoken> summary and status lines. An older flagship gets a clear "update GAIA" error. - Validated voice_* config keys.
The Agent UI and TUI each split <spoken> out of the answer stream, so one JSON case file now pins the behaviour all three parsers must match, including the reset when a tool step starts.
…hesis Tested against a real Lemonade 2026.44.1. Its realtime endpoint never loads a model, so the first dictation failed with "No model loaded". The listener now loads the recognizer first, as Lemonade's own example does. Kokoro takes 0.4-0.8 s per clause here, and streaming doesn't help: the first byte arrives only when the clause is done. So the next clause is now synthesized while the current one plays, and a real-time speaker never waits between clauses. Adds an integration test against a real Lemonade, run when GAIA_VOICE_TEST_LEMONADE is set. Kokoro speaks a sentence and the recognizer hears it back, starting from a recognizer that isn't downloaded.
Voice turns had no eval. The Agent UI MCP's send_message takes reply_style, and three scenarios check that a voice turn opens with a short plain spoken summary, narrates tool steps honestly, and says a failure out loud. They run in the gaia-signal lane on the next RC. The flagship's README, SPEC, SKILL, CHANGELOG and OpenAPI artifact now describe reply_style (contract 2.28) and alert_owner.
The TUI could read replies aloud but not listen. Ctrl+R (or /dictate) now
dictates into the composer, and /talk opens a hands-free voice mode with a
shimmering state line, a level meter, captions and the work log. The GAIA
daemon records the microphone and plays speech, so the Go build stays free of
cgo and audio libraries.
- Daemon: /daemon/v1/voice/{status,devices,models/download,session} behind
the client token. Capture pauses while speech plays, since the daemon has
no echo cancellation (amd#3494), and any key interrupts. A missing,
denied or busy mic is a stable error code with a message. Without
`websockets` the routes say so instead of 404ing. The [api] extra gains
websockets and sounddevice.
- TUI: a voice turn goes through the chat's normal query path with
reply_style "voice" (flagship 2.28+, refused before voice mode opens on an
older one). The Go splitter passes the shared spoken-split cases. Spoken
summaries show as a bold lead line in the history. Push-to-talk is Space to
start and Space to send, because terminals don't report key release.
- Adds github.com/coder/websocket (ISC, pure Go).
- Lint fixes in gaia.voice, and the live-Lemonade voice test is allowlisted
for CI lanes with its reason.
The Agent UI could read replies aloud but not listen. A mic button now dictates into the composer, with live partials in the box, and when the box is empty the send button opens voice mode. Voice mode is a hands-free screen with a listening ring and a speaking glow that follow the live audio, a shimmering state word, captions, and a "What GAIA did" work log. Voice turns are ordinary chat messages sent with reply_style "voice", so they are saved, shown and stopped like typed ones. The spoken summary appears as a bold lead line in the history. - Barge-in flushes playback locally first. Permission cards show inside voice mode, and GAIA says it needs your OK. Arabic answers on screen with captions, since speech is English-only for now. - Phone (mobile access): full-screen layout, tap to start audio, wake lock, pause when hidden, iOS play-and-record. - Settings › Voice: listening and voice-mode groups next to read-aloud's speaking controls. - Electron grants the microphone to the app's own page only. The macOS build gets the audio-input entitlement and usage text. - Exports and search snippets show the spoken summary as text, without tags. - Never uses the browser's SpeechRecognition or speechSynthesis; a test fails the build if the source mentions them.
…ession Review fixes. After the 5-minute dictation limit, every mic frame sent another limit event and commit. A TUI voice session whose send queue filled said it was closed but stayed open. The voice routes now use GAIA's logger.
…mulator GAIA can now reach you by text or phone call when something urgent happens, and only ever at numbers you verified. The daemon owns it, so alerts fire whether or not an app is open. - gaia.phone: phone book with 6-digit codes (hashed, 10 min, 3 tries, 3 an hour). A second number also needs a code from the first, and every change is announced. One send path reads numbers from the phone book by id. Refuses emergency, short, premium and satellite numbers. - Calls and texts say a fixed sentence per alert type, never task or agent text. Voicemail doesn't count as reached (answering-machine detection). - Escalation: notify, text, call, redial, then the next number. Cooldown merging, daily limits, a separate limit for agent alerts, quiet hours. State lives in SQLite, so a restart resumes without calling twice. - Providers: Twilio REST (inline TwiML, status by polling, no public URL) and a Simulated provider for trying everything before signing up. - Sources: failed schedules, approval cards left waiting, GAIA's model server failing for 5 minutes, and an alert_owner tool registered only when agent alerts are on. - Daemon: /daemon/v1/phone/* behind the client token, and /host/v1/alerts behind each agent's own custody secret. - Tests never reach a running daemon, so no test can ring a real phone.
Settings › Phone in the Agent UI reaches the daemon through the UI server. Changes are refused over mobile access, so who GAIA may call can only be changed at the PC; opening an alert from the phone still stops the calls.
A sleeping PC can't call, so phone alerts now hold the system (not the display) awake on AC power: SetThreadExecutionState on Windows, systemd-inhibit on Linux, caffeinate on macOS. The hold is released on battery and when phone is off. Adds the Phone Alerts guide, with Twilio setup and its trial limits.
Phone alerts are set up and watched from the terminal too. /phone covers the provider (Simulated phone or Twilio, with the token masked and cleared after submit), the phone book with its code checks, each alert rule, quiet hours, limits and keep-awake. It also shows the alerts with every call and text. An open alert shows a one-line banner in the chat, polled every 15 s, that stops quietly against a daemon without phone routes.
Turning phone on showed "not keeping the PC awake" for up to a minute, because the hold was only checked once a minute.
…nd wake word Asked to change her voice she could only make a sample file. A new tool, set_voice_setting, saves one of five voice settings and refuses any other, pointing the user to Settings. Voice mode re-reads the settings when a tool finishes, so the change is heard in the same reply. Volume moves from the browser's storage into the saved voice settings so she can set it too.
…ice, and count the new tool The flagship now registers 106 tools; the manifests, capability matrix, guide and skill playbook say so. The voice eval category added earlier is in the matrix's expected list. Voice tests share one fixture through a conftest.
…picture row The voice screen's tests stubbed the controller without the new mute and volume functions, so every case in the file failed. The volume slider gets its own accessible name.
Whisper wrote the wake phrase as "Hegaya", which the name match missed, so the request was dropped.
…he chime is a setting Speech reaches the browser faster than it plays, so the server thought GAIA had finished while the room still heard her: talking over her started a new turn but her old answer kept playing, and the new one queued behind it. The app now tells the server while playback lasts, and a new request always cuts the end of the last answer. The "heard you" tone is a setting (on by default) that GAIA can change too. Speech ignored while waiting for her name now says so, and the follow-up window is 20 seconds.
…" ends it Follow-ups needed her name again after twenty seconds. The wake word is for when it has been quiet: the window is now a minute after she last spoke, and "GAIA, go to sleep", "good night" or "that's all" sends her back to waiting for her name at once, whether or not the phrase names her.
2 tasks
kovtcharov-amd
added a commit
to kovtcharov/gaia
that referenced
this pull request
Nov 12, 2026
**This is the design the voice and phone work builds on** (amd#6789, amd#6790). The plans ship no code, and they don't block or change current release work. GAIA can read a reply aloud, but neither the Agent UI nor the TUI can listen. This plan covers two features: - **Dictation:** talk into the composer, and the text lands in the box for you to edit before sending. - **Voice mode:** a hands-free screen of its own. GAIA speaks short answers and keeps the full detail of what it did on screen: tool steps, results and files. It's built to feel instant and to stay 100% on the PC: - small streaming models (Moonshine Streaming for English, Whisper for other languages, Kokoro for speech, the chat model already loaded) - one server-side voice session - spoken status lines the model writes before each tool call - a latency budget of about 1.5 s from the end of speech to GAIA talking Arabic users get dictation, and voice mode answers them on screen until an Arabic voice exists. The plan ends with a six-PR delivery sequence, dictation first. Refs amd#702, amd#372 ## Test plan - [ ] `python util/check_doc_links.py` passes - [ ] The page renders under Roadmap › Agent UI on the Mintlify preview --------- Co-authored-by: Kalin Ovtcharov <[email protected]>
Conflicts: the capability matrix (regenerated: 106 tools) and the tool-request matcher, where main's media matches and the voice-setting match both stay.
… profile tool goldens Three checks failed on this branch against current main: the SDK page did not mention the four voice routes, the committed API schema snapshot lacked the voice models, and the profile goldens did not list set_voice_setting, which every non-chat profile now registers. The goldens' prompts are unchanged; only the tool name is added.
Conflict: the chat view's send. Main made it report whether the message was taken; the voice turn's error signal is kept on each path that now returns false.
Contributor
Author
|
Brought up to date and left as a draft. Merged the updated voice branch (#6789), which now carries current main and its fixes, so this merges with main again. No conflicts of its own. One real bug fixed here: Why it is still a draft:
Locally on the merged branch: the phone, alert-tool, approval-alert and schedule-daemon suites pass together with the voice suites and the schema, golden, packaging and capability-matrix checks (the route-doc check being the one failure); the webui suite passes (3,701) and type-checks; black, isort and flake8 are clean. |
gaia.voice was missing from setup.py's package list, so an installed (non-editable) GAIA would have had no voice code at all. Also: the doc-profile tool baseline is re-measured for the added set_voice_setting tool (46 tools; the text prompt grows by about 145 tokens), two voice eval scenarios use the corpus's own tier tags, and the TUI's new WebSocket module is recorded as ISC from the licence text it ships.
gaia.phone was missing from setup.py's package list, so an installed (non-editable) GAIA would have had no phone code.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A notification is easy to miss. GAIA can now text or call your phone when something urgent happens: a scheduled job fails, a task waits on your approval, GAIA's model server won't start, or an agent you allowed needs you. It only ever reaches numbers in a phone book verified by a code. Calls and texts say a fixed sentence per alert type, never task, email or agent text, so injected content can't speak through GAIA and voicemail holds nothing private.
Design:
docs/plans/phone-calls.mdx(#6491), reviewed twice before the build and once after. Stacked on #6789 (voice). Until that merges, this diff includes it./phoneand a banner in the TUI, each with PIN, voice and a "can calls talk?" status.Test plan
pytest tests/unit/phone tests/unit/agents/test_alert_tools.py tests/unit/chat/ui/test_phone_router.py tests/unit/chat/ui/test_approval_alerts.py tests/unit/test_schedule_daemon.pycd src/gaia/apps/webui && npm test && npm run test:rtl(phone scenes);cd tui && go test ./...docs/guides/phone-alerts.mdx, verify your number in Twilio and in GAIA, Send test alert, and your phone rings with the trial notice, then GAIA's sentence🔍 Technical details
gaia.phonelives in the daemon (/daemon/v1/phone/*, client token). Agents use/host/v1/alertswith their own custody secret, and thealert_ownertool is registered only when "Agents may alert me" is on. The UI server is a pass-through that requires the PC for changes and for the Simulated log, which holds live codes.gaia schedulehook), approval cards unanswered for N minutes (UI server watch), the embedded Lemonade failing to start for 5 minutes (owner health hook), andalert_owner.tests/conftest.pystubsgaia.phone.client.