mirror of
https://github.com/openai/codex.git
synced 2026-11-08 08:37:30 +00:00
Persist realtime events in the thread timeline (#40508)
## Why Clients need a bounded view of realtime conversations that preserves the order of speech, agent work, and turn lifecycle events without loading the full thread history. ## What changed - Persist realtime session boundaries, transcript segments, and promoted agent items in paginated thread rollouts. - Add the experimental `thread/timeline/list` API to page ordinary items, realtime items, and turn boundaries in canonical rollout order. Include `activeRealtimeSessionAtPageStart` so each page can be rendered independently. - Emit typed `thread/realtime/item/started`, `thread/realtime/item/transcript/delta`, and `thread/realtime/item/completed` notifications around durable realtime items. - Keep the existing `thread/items/list` response and legacy thread history behavior unchanged. ## Testing - Cover mixed timeline pagination, realtime-session state at page boundaries, rollout replay, subagent history prefixes, transcript streaming, steering, and promoted agent artifacts. GitOrigin-RevId: faa2c420192d63e060e8fb32446e3c797422656e
This commit is contained in:
1 parent
80e871309a
commit
41ca88e95c
80 files changed
+5140
-47
No files matched your search
+199
@@ -0,0 +1,199 @@
|
||||
{
|
||||
"$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"
|
||||
}
|
||||
]
|
||||
},
|
||||
"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": {
|
||||
"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": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"realtimeSessionId": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"realtimeSessionId"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"ThreadRealtimeSessionOutcome": {
|
||||
"enum": [
|
||||
"ended",
|
||||
"failed"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"ThreadRealtimeTranscriptRole": {
|
||||
"enum": [
|
||||
"user",
|
||||
"assistant"
|
||||
],
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"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"
|
||||
}
|
||||
Reference in new issue
Block a user