goals

Mint Goal Voice Conversation

Changed on

Admit one conversation, and name the id its audio rides (#2362).

The three browser signals are the same ones every unsafe goals route takes — the harness's JSON-body cookie was a relay artifact, and a deployed caller's cookie rides its own request. This is where the browser boundary is paid: the delegated turns run :func:~cheshire.goals.turn.run_goal_turn in process against the session the socket resolves, so a spoken conversation crosses it once rather than once per utterance (#2463).

Either credential mints, and the same one opens the socket (#2635). The mint reads either, so an install is charged and ticketed like a page. The page's handshake then presents its cookie, and the app's presents the same bearer in Authorization, which a native client can set on a handshake and a browser cannot (:func:_admit_bearer_socket).

Nothing is dialed here. The audio is the WebSocket the page opens next and the vendor session is minted inside it, so this route's whole job is to admit the conversation once, here, where the browser's three signals are all readable: a browser's WebSocket handshake carries a cookie and an Origin and no header of ours at all. The id it answers with is the ticket that socket presents, and it is the whole of the answer (#2587): there is one way to hold a conversation, so there is nothing left for a page to branch on.

An offer is refused rather than read (#2587). While two lanes existed a page could not know which one it was on until this route answered, so an offer it was about to throw away was ignored. looking-glass#894 stopped sending one and shipped first, so a body still carrying sdp is a page older than that deploy, and naming the field it got wrong beats reading a field this service has no lane for. The refusal belongs to the model (:class:~cheshire.schemas.goals.GoalVoiceConversationRequest forbids extras), so it lands before the conversation is charged.

The fleet seat this conversation was admitted into rides the ticket, because the conversation it belongs to has not started yet and will not end when this response does: the socket releases it (#2363).

post/goals/voice/session

Request

  • Base URL
    https://api.imperfect.co (the document declares no server; this is the origin it was published from)
  • URL
    https://api.imperfect.co/goals/voice/session
  • Auth
    HTTP bearer

Headers

x-device-timezonestring nullable
x-device-hintstring nullable
x-client-platformstring nullable

Request body

localestring nullable
units'metric' | 'imperial' nullable
resumeboolean
reviseboolean
arrivalstring nullable
racestring nullable

Response

Successful Response

session_idstring required

Changes