Repository navigation
feat(voice): add the voice gateway with spoken messages and calls - #133
Merged
Merged
Conversation
GET /v1/agents/{id}/events?partial=true fills each snapshot's partial with the reply the bot is writing. Without the parameter, partial stays empty. Adds the voice gateway to the glossary.
A voice gateway connects telephone lines to bots. It authenticates with a scoped voice gateway token on /v1/voice/*, receives its lines and the owner's numbers over an event stream, and is managed under Settings > Voice gateway. - Spoken messages carry origin via "voice" and a model-only note; the web shows "Spoken on a call". - Bots with a line that may call get call_owner, and hang_up during a call. - Calls are reported with a start and an end, kept in the settings row voice-gateway:calls, and shown as call-started and call-ended events. An ended call wakes the bot once; the server ends a call itself when the voice gateway disappears, the token changes, or the line changes.
A bot whose line has "Can call other people" proposes an outside call with request_call: the number, the callee, the goal, and its opening. The owner approves or declines the call request on a card in the bot chat, and approving dials at once. The call runs in its own call conversation, which holds only the goal, the opening, and the call rules, and whose only tool is hang_up. What the callee says never reaches the bot chat: the server routes the voice gateway's messages by the call's party and answers 409 for an outside call ID it cannot place. Call turns are left out of learning reviews and reply notifications. When the call ends, the bot chat gets one notice, and the model alone reads the goal and the escaped transcript. The web chat shows an outside call as one card that opens the call beside the chat, live while it goes on. Selecting an open job or call card again closes its panel.
Lines are now table rows with SIP username, display name, bot, Calls you and Calls others checkboxes, and a status column. Rows are selected with a checkbox column; deleting selected lines replaces the per-row button. The status names why a saved line has no registration yet (Off, Offline, Connecting, Waiting) instead of reporting it as not saved. Long reasons move into a hover title so the column doesn't wrap.
A call ended by issuing a new voice gateway token now reads "revoked or replaced" in call outcomes, refusals, and ended-call notices. The display name is described as the caller name sent to the telephone system, and hang_up's objection flag says the transcript is withheld from the owner rather than deleted. The voice gateway docs, the web client page, and the glossary now match the server: the token's reach, outside call limits, request_call, and when Crumble ends a call.
This was referenced Nov 10, 2026
|
React Doctor found no new issues. 🎉 Reviewed by React Doctor for commit |
Fallow audit reportReview needed Found 1 finding. Health (1)
Generated by fallow.
|
| } | ||
|
|
||
| // Describes the saved line only while the draft still names the same bot. | ||
| function savedLineState(gateway: VoiceGateway, line: DraftLine) { |
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.
Summary
Adds the voice gateway: a separate process (
crumble-voice) that connects telephone lines to bots. Owners set it up under Settings > Voice gateway. Bots get spoken messages, can call the owner withcall_owner, and can propose calls to other people that the owner approves in the bot chat.GET/PUT /v1/voice-gatewaysave the owner's numbers and lines, and/v1/voice-gateway/tokenissues and revokes the token. The gateway receives its lines overGET /v1/voice/events.origin.viavoice. The bot is told its reply is read aloud, and the web shows "Spoken on a call".call_ownerdials the owner's first number, andhang_upends a call. Calls are tracked in the settings rowvoice-gateway:calls, and the server ends calls that the gateway can't account for.request_callcreates a call request, and the owner approves or declines it on a card. The call runs in its own conversation that holds only the goal, the opening andhang_up, and what the callee says never reaches the bot chat.GET /v1/agents/{id}/events?partial=truestreams the reply while the bot writes it, so the gateway can start speaking early.Clients: crumble-project/apple#9, crumble-project/android#13, and the gateway crumble-project/voice#1.
Evidence
pre-pushhook passed on the pushed head:bun run check(lint, format, typecheck, OpenAPI check, tests) and theapps/docscheck and build.bun test apps/web/features/voice-gateway: 6 pass.Risk and rollback
Reversibility: Reversible. A revert leaves the
voice-gatewaysettings rows and the stored token hash in the database. They are new keys and nothing reads them after a revert.Blast radius:
/v1/voice-gateway,/v1/voice/*and call requests.voice,call,callee,call_request), newcallandcalleefields on events, and thepartialquery.call_owner,hang_upandrequest_call.voice.Outside calls are off unless a line has
callsOthersand the gateway setscall.allowOutside. The docs note that their legal situation is unsettled.