Files
codex/codex-rs/app-server-protocol/schema/json/v2/ThreadRealtimeItemStartedNotification.json
T
Zahan Malkani 5943d7acdf Persist timestamped realtime frames before acknowledging completion (#61473)
## What changed

- Record voice transcripts as `frame` items with a `voice_transcript` channel for eligible threads, while retaining legacy transcript support and the existing app-server live and mixed timeline representation.
- Assign first-observed timestamps that never move backward, retain them through completion, and restore the clock floor from history and compaction checkpoints.
- Flush realtime records before completion notifications, including file and initial directory durability barriers for local rollouts.
- Generate a distinct default session ID for each new call, use the call ID when attaching to an existing call, and derive opening record IDs from session IDs.
- Add protocol types for turn-input acceptance and session-end input receipts, excluding those receipts from live notifications and mixed timelines. Update generated schemas and SDK types.

## Testing

Add coverage for frame serialization and required voice payloads, clock rollback and checkpoint restoration, durability barrier failures and retries, per-call session IDs, and persisted transcript availability immediately after completion.

GitOrigin-RevId: 3f6632b517d563861aee085b723475b8945c391c
2026-11-14 06:14:36 +00:00

335 lines
8.4 KiB
JSON
Generated

{
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"ThreadRealtimeBemItemPresentation": {
"description": "EXPERIMENTAL - how an existing agent item appears in a realtime conversation.",
"oneOf": [
{
"properties": {
"type": {
"enum": [
"wholeItem"
],
"title": "WholeItemThreadRealtimeBemItemPresentationType",
"type": "string"
}
},
"required": [
"type"
],
"title": "WholeItemThreadRealtimeBemItemPresentation",
"type": "object"
},
{
"properties": {
"type": {
"enum": [
"inlineMarkdown"
],
"title": "InlineMarkdownThreadRealtimeBemItemPresentationType",
"type": "string"
}
},
"required": [
"type"
],
"title": "InlineMarkdownThreadRealtimeBemItemPresentation",
"type": "object"
},
{
"properties": {
"index": {
"format": "uint32",
"minimum": 0.0,
"type": "integer"
},
"type": {
"enum": [
"inlineVisualization"
],
"title": "InlineVisualizationThreadRealtimeBemItemPresentationType",
"type": "string"
}
},
"required": [
"index",
"type"
],
"title": "InlineVisualizationThreadRealtimeBemItemPresentation",
"type": "object"
}
]
},
"ThreadRealtimeFrameChannels": {
"description": "A frame holds one or more payloads, at most one per channel. They share one ID, observation time, and seal. V1 requires its only channel, `voice_transcript`.",
"properties": {
"voice_transcript": {
"$ref": "#/definitions/ThreadRealtimeVoiceTranscript"
}
},
"required": [
"voice_transcript"
],
"type": "object"
},
"ThreadRealtimeHandoffMode": {
"enum": [
"start",
"steer"
],
"type": "string"
},
"ThreadRealtimeItem": {
"description": "EXPERIMENTAL - a thread-scoped realtime item in the canonical timeline.",
"oneOf": [
{
"properties": {
"type": {
"enum": [
"realtimeSessionStarted"
],
"title": "RealtimeSessionStartedThreadRealtimeItemType",
"type": "string"
}
},
"required": [
"type"
],
"title": "RealtimeSessionStartedThreadRealtimeItem",
"type": "object"
},
{
"properties": {
"channels": {
"$ref": "#/definitions/ThreadRealtimeFrameChannels"
},
"type": {
"enum": [
"frame"
],
"title": "FrameThreadRealtimeItemType",
"type": "string"
}
},
"required": [
"channels",
"type"
],
"title": "FrameThreadRealtimeItem",
"type": "object"
},
{
"properties": {
"role": {
"$ref": "#/definitions/ThreadRealtimeTranscriptRole"
},
"text": {
"type": "string"
},
"type": {
"enum": [
"transcriptSegment"
],
"title": "TranscriptSegmentThreadRealtimeItemType",
"type": "string"
}
},
"required": [
"role",
"text",
"type"
],
"title": "TranscriptSegmentThreadRealtimeItem",
"type": "object"
},
{
"properties": {
"item_id": {
"type": "string"
},
"presentation": {
"$ref": "#/definitions/ThreadRealtimeBemItemPresentation"
},
"turn_id": {
"type": "string"
},
"type": {
"enum": [
"bemItemPromoted"
],
"title": "BemItemPromotedThreadRealtimeItemType",
"type": "string"
}
},
"required": [
"item_id",
"presentation",
"turn_id",
"type"
],
"title": "BemItemPromotedThreadRealtimeItem",
"type": "object"
},
{
"properties": {
"outcome": {
"$ref": "#/definitions/ThreadRealtimeSessionOutcome"
},
"type": {
"enum": [
"realtimeSessionClosed"
],
"title": "RealtimeSessionClosedThreadRealtimeItemType",
"type": "string"
}
},
"required": [
"outcome",
"type"
],
"title": "RealtimeSessionClosedThreadRealtimeItem",
"type": "object"
},
{
"properties": {
"handoff_id": {
"type": "string"
},
"input": {
"type": "string"
},
"input_item_id": {
"type": "string"
},
"mode": {
"$ref": "#/definitions/ThreadRealtimeHandoffMode"
},
"source_event_ids": {
"items": {
"type": "string"
},
"type": "array"
},
"turn_id": {
"type": "string"
},
"type": {
"enum": [
"turnInputAccepted"
],
"title": "TurnInputAcceptedThreadRealtimeItemType",
"type": "string"
}
},
"required": [
"handoff_id",
"input",
"input_item_id",
"mode",
"source_event_ids",
"turn_id",
"type"
],
"title": "TurnInputAcceptedThreadRealtimeItem",
"type": "object"
},
{
"properties": {
"input": {
"type": "string"
},
"input_item_id": {
"type": "string"
},
"source_event_ids": {
"items": {
"type": "string"
},
"type": "array"
},
"type": {
"enum": [
"sessionEndInputSaved"
],
"title": "SessionEndInputSavedThreadRealtimeItemType",
"type": "string"
}
},
"required": [
"input",
"input_item_id",
"source_event_ids",
"type"
],
"title": "SessionEndInputSavedThreadRealtimeItem",
"type": "object"
}
],
"properties": {
"id": {
"type": "string"
},
"observedAtMs": {
"description": "Canonical observation time in Unix milliseconds for eligible voice calls.",
"format": "int64",
"type": [
"integer",
"null"
]
},
"realtimeSessionId": {
"type": "string"
}
},
"required": [
"id",
"realtimeSessionId"
],
"type": "object"
},
"ThreadRealtimeSessionOutcome": {
"enum": [
"ended",
"failed"
],
"type": "string"
},
"ThreadRealtimeTranscriptRole": {
"enum": [
"user",
"assistant"
],
"type": "string"
},
"ThreadRealtimeVoiceTranscript": {
"properties": {
"role": {
"$ref": "#/definitions/ThreadRealtimeTranscriptRole"
},
"text": {
"type": "string"
}
},
"required": [
"role",
"text"
],
"type": "object"
}
},
"description": "EXPERIMENTAL - a realtime timeline item started before its content streams.",
"properties": {
"item": {
"$ref": "#/definitions/ThreadRealtimeItem"
},
"threadId": {
"type": "string"
}
},
"required": [
"item",
"threadId"
],
"title": "ThreadRealtimeItemStartedNotification",
"type": "object"
}