mirror of
https://github.com/openai/codex.git
synced 2026-12-01 00:20:48 +00:00
Derive realtime input receipts from thread history (#62251)
## Why Accepted handoffs and saved transcript chunks need to appear in realtime history. Their text can come from the same user message that model history uses, avoiding a second persisted copy for the receipt. ## What changed - Reconstruct `turnInputAccepted` and transcript chunk receipts from user messages annotated with realtime provenance. Use the stored observation time when restoring the realtime clock. - Replace `sessionEndInputSaved` in the app-server protocol with `sessionInputSaved` and a `reason` of `chunk` or `sessionEnd`. Update the generated schemas and bindings. ## Testing Add coverage for reconstructing both receipt types, preserving rollout order in paginated realtime history, and restoring observation time across a restart after wall-clock rollback. GitOrigin-RevId: fcb4e0e539f4e4066726e83fa1e945fb659a2ca8
This commit is contained in:
@@ -6520,27 +6520,6 @@ class TurnInputAcceptedThreadRealtimeItem(BaseModel):
|
||||
]
|
||||
|
||||
|
||||
class SessionEndInputSavedThreadRealtimeItem(BaseModel):
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
)
|
||||
id: str
|
||||
observed_at_ms: Annotated[
|
||||
int | None,
|
||||
Field(
|
||||
alias="observedAtMs",
|
||||
description="Canonical observation time in Unix milliseconds for eligible voice calls.",
|
||||
),
|
||||
] = None
|
||||
realtime_session_id: Annotated[str, Field(alias="realtimeSessionId")]
|
||||
input: str
|
||||
input_item_id: str
|
||||
source_event_ids: list[str]
|
||||
type: Annotated[
|
||||
Literal["sessionEndInputSaved"], Field(title="SessionEndInputSavedThreadRealtimeItemType")
|
||||
]
|
||||
|
||||
|
||||
class ThreadRealtimeItemAddedNotification(BaseModel):
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
@@ -6579,6 +6558,11 @@ class ThreadRealtimeSdpNotification(BaseModel):
|
||||
thread_id: Annotated[str, Field(alias="threadId")]
|
||||
|
||||
|
||||
class ThreadRealtimeSessionInputReason(Enum):
|
||||
chunk = "chunk"
|
||||
session_end = "sessionEnd"
|
||||
|
||||
|
||||
class ThreadRealtimeSessionOutcome(Enum):
|
||||
ended = "ended"
|
||||
failed = "failed"
|
||||
@@ -11405,6 +11389,28 @@ class RealtimeSessionClosedThreadRealtimeItem(BaseModel):
|
||||
]
|
||||
|
||||
|
||||
class SessionInputSavedThreadRealtimeItem(BaseModel):
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
)
|
||||
id: str
|
||||
observed_at_ms: Annotated[
|
||||
int | None,
|
||||
Field(
|
||||
alias="observedAtMs",
|
||||
description="Canonical observation time in Unix milliseconds for eligible voice calls.",
|
||||
),
|
||||
] = None
|
||||
realtime_session_id: Annotated[str, Field(alias="realtimeSessionId")]
|
||||
input: str
|
||||
input_item_id: str
|
||||
reason: ThreadRealtimeSessionInputReason
|
||||
source_event_ids: list[str]
|
||||
type: Annotated[
|
||||
Literal["sessionInputSaved"], Field(title="SessionInputSavedThreadRealtimeItemType")
|
||||
]
|
||||
|
||||
|
||||
class ThreadRealtimeItem(
|
||||
RootModel[
|
||||
RealtimeSessionStartedThreadRealtimeItem
|
||||
@@ -11413,7 +11419,7 @@ class ThreadRealtimeItem(
|
||||
| BemItemPromotedThreadRealtimeItem
|
||||
| RealtimeSessionClosedThreadRealtimeItem
|
||||
| TurnInputAcceptedThreadRealtimeItem
|
||||
| SessionEndInputSavedThreadRealtimeItem
|
||||
| SessionInputSavedThreadRealtimeItem
|
||||
]
|
||||
):
|
||||
root: Annotated[
|
||||
@@ -11423,7 +11429,7 @@ class ThreadRealtimeItem(
|
||||
| BemItemPromotedThreadRealtimeItem
|
||||
| RealtimeSessionClosedThreadRealtimeItem
|
||||
| TurnInputAcceptedThreadRealtimeItem
|
||||
| SessionEndInputSavedThreadRealtimeItem,
|
||||
| SessionInputSavedThreadRealtimeItem,
|
||||
Field(
|
||||
description="EXPERIMENTAL - a thread-scoped realtime item in the canonical timeline."
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user