Files
codex/codex-rs/app-server-protocol/schema/json/v2/ThreadRealtimeItemCompletedNotification.json
T
Zahan Malkani 29cb67623c Gate local realtime frame history on paginated storage (#62271)
## Why

Legacy rollout migration rewrites rolled-back history and can disrupt
the realtime stream. Enroll local threads once they use paginated history
so the stream stays intact.

## What changed

- Add the off-by-default `features.realtime_frames_local` flag for
  paginated local threads with a state database. Accept runtime updates
  through the app server and keep threads enrolled once they have a
  persisted canonical session start.
- Add thread-store APIs to recover a realtime session and look up the
  latest session ID from durable history. Route frame completion through
  a store seal so completion acknowledges durable writes.
- Add a local seal for accepted model input that writes source frames
  before the input and lets callers retry an uncertain flush without
  appending the input twice.

## Testing

Cover enrollment for legacy and paginated threads, continued enrollment
after disabling the flag, and retrying a local input seal after a failed
directory sync.

GitOrigin-RevId: 2012feeca3857da90f9b026f077b31a26d15191b
2026-11-18 12:55:14 +00:00

346 lines
8.6 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. Currently, `voice_transcript` is required.",
"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"
},
"reason": {
"$ref": "#/definitions/ThreadRealtimeSessionInputReason"
},
"source_event_ids": {
"items": {
"type": "string"
},
"type": "array"
},
"type": {
"enum": [
"sessionInputSaved"
],
"title": "SessionInputSavedThreadRealtimeItemType",
"type": "string"
}
},
"required": [
"input",
"input_item_id",
"reason",
"source_event_ids",
"type"
],
"title": "SessionInputSavedThreadRealtimeItem",
"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"
},
"ThreadRealtimeSessionInputReason": {
"enum": [
"chunk",
"sessionEnd"
],
"type": "string"
},
"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 published after canonical commit.",
"properties": {
"item": {
"$ref": "#/definitions/ThreadRealtimeItem"
},
"threadId": {
"type": "string"
}
},
"required": [
"item",
"threadId"
],
"title": "ThreadRealtimeItemCompletedNotification",
"type": "object"
}