mirror of
https://github.com/openai/codex.git
synced 2026-10-28 18:58:46 +00:00
Add experimental thread prediction protocol types (#49480)
## What changed Define `thread/prediction/request` with `threadId` and `sourceTurnId`, and `thread/prediction/updated` with a `completed` result containing optional text or a `failed` result. Update generated JSON schemas, TypeScript types, and Python notification models. Route prediction notifications to their thread in the TUI and ignore them in the chat widget. The request remains unimplemented and returns a method-not-found error. GitOrigin-RevId: 09922f583d5c56f808d018121c651dcd92734515
This commit is contained in:
@@ -5613,6 +5613,39 @@ class ThreadNameUpdatedNotification(BaseModel):
|
||||
thread_name: Annotated[str | None, Field(alias="threadName")] = None
|
||||
|
||||
|
||||
class CompletedThreadPredictionResult(BaseModel):
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
)
|
||||
text: str | None = None
|
||||
type: Annotated[Literal["completed"], Field(title="CompletedThreadPredictionResultType")]
|
||||
|
||||
|
||||
class FailedThreadPredictionResult(BaseModel):
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
)
|
||||
type: Annotated[Literal["failed"], Field(title="FailedThreadPredictionResultType")]
|
||||
|
||||
|
||||
class ThreadPredictionResult(
|
||||
RootModel[CompletedThreadPredictionResult | FailedThreadPredictionResult]
|
||||
):
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
)
|
||||
root: CompletedThreadPredictionResult | FailedThreadPredictionResult
|
||||
|
||||
|
||||
class ThreadPredictionUpdatedNotification(BaseModel):
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
)
|
||||
result: ThreadPredictionResult
|
||||
source_turn_id: Annotated[str, Field(alias="sourceTurnId")]
|
||||
thread_id: Annotated[str, Field(alias="threadId")]
|
||||
|
||||
|
||||
class ThreadProjectUpdatedNotification(BaseModel):
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
@@ -9178,6 +9211,24 @@ class ThreadAttachmentUpdatedServerNotification(BaseModel):
|
||||
params: ThreadAttachmentUpdatedNotification
|
||||
|
||||
|
||||
class ThreadPredictionUpdatedServerNotification(BaseModel):
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
)
|
||||
emitted_at_ms: Annotated[
|
||||
int | None,
|
||||
Field(
|
||||
alias="emittedAtMs",
|
||||
description="Unix timestamp (in milliseconds) when app-server emitted this notification.",
|
||||
),
|
||||
] = None
|
||||
method: Annotated[
|
||||
Literal["thread/prediction/updated"],
|
||||
Field(title="Thread/prediction/updatedNotificationMethod"),
|
||||
]
|
||||
params: ThreadPredictionUpdatedNotification
|
||||
|
||||
|
||||
class ThreadGoalClearedServerNotification(BaseModel):
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
@@ -12859,6 +12910,7 @@ class ServerNotification(
|
||||
| ThreadNameUpdatedServerNotification
|
||||
| ThreadAttachmentUpdatedServerNotification
|
||||
| ThreadGoalUpdatedServerNotification
|
||||
| ThreadPredictionUpdatedServerNotification
|
||||
| ThreadGoalClearedServerNotification
|
||||
| ThreadQueueChangedServerNotification
|
||||
| ProjectChangedServerNotification
|
||||
@@ -12948,6 +13000,7 @@ class ServerNotification(
|
||||
| ThreadNameUpdatedServerNotification
|
||||
| ThreadAttachmentUpdatedServerNotification
|
||||
| ThreadGoalUpdatedServerNotification
|
||||
| ThreadPredictionUpdatedServerNotification
|
||||
| ThreadGoalClearedServerNotification
|
||||
| ThreadQueueChangedServerNotification
|
||||
| ProjectChangedServerNotification
|
||||
|
||||
Reference in New Issue
Block a user