mirror of
https://github.com/openai/codex.git
synced 2026-09-16 12:13:30 +00:00
Remove the deprecated thread/rollback API (#44915)
## What changed Remove `thread/rollback`, its request and response types, generated bindings, and the core `Op::ThreadRollback` operation. Requests now follow the generic unknown-method rejection path. Document `thread/revert` as the alternative for paginated threads. Keep historical `ThreadRolledBack` markers and legacy error deserialization so existing rollouts remain compatible with replay and migration. ## Testing Adapt retained-context and Guardian history tests to append legacy rollback markers and resume threads, preserving coverage of surviving instructions, answers, and review history. GitOrigin-RevId: b3da1becdf86b1869275aacb0ffc2817cee5af2e
This commit is contained in:
@@ -5833,21 +5833,6 @@ class ThreadRevertedNotification(BaseModel):
|
||||
thread_id: Annotated[str, Field(alias="threadId")]
|
||||
|
||||
|
||||
class ThreadRollbackParams(BaseModel):
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
)
|
||||
num_turns: Annotated[
|
||||
int,
|
||||
Field(
|
||||
alias="numTurns",
|
||||
description="The number of turns to drop from the end of the thread. Must be >= 1.\n\nThis only modifies the thread's history and does not revert local file changes that have been made by the agent. Clients are responsible for reverting these changes.",
|
||||
ge=0,
|
||||
),
|
||||
]
|
||||
thread_id: Annotated[str, Field(alias="threadId")]
|
||||
|
||||
|
||||
class ThreadSearchSortKey(Enum):
|
||||
created_at = "created_at"
|
||||
updated_at = "updated_at"
|
||||
@@ -6815,15 +6800,6 @@ class ThreadApproveGuardianDeniedActionRequest(BaseModel):
|
||||
params: ThreadApproveGuardianDeniedActionParams
|
||||
|
||||
|
||||
class ThreadRollbackRequest(BaseModel):
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
)
|
||||
id: RequestId
|
||||
method: Annotated[Literal["thread/rollback"], Field(title="Thread/rollbackRequestMethod")]
|
||||
params: ThreadRollbackParams
|
||||
|
||||
|
||||
class ThreadRevertRequest(BaseModel):
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
@@ -11767,7 +11743,7 @@ class Thread(BaseModel):
|
||||
turns: Annotated[
|
||||
list[Turn],
|
||||
Field(
|
||||
description="Only populated on `thread/resume`, `thread/rollback`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list."
|
||||
description="Only populated on `thread/resume`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list."
|
||||
),
|
||||
]
|
||||
updated_at: Annotated[
|
||||
@@ -11934,18 +11910,6 @@ class ThreadRevertResponse(BaseModel):
|
||||
] = None
|
||||
|
||||
|
||||
class ThreadRollbackResponse(BaseModel):
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
)
|
||||
thread: Annotated[
|
||||
Thread,
|
||||
Field(
|
||||
description="The updated thread after applying the rollback, with `turns` populated.\n\nThe ThreadItems stored in each Turn are lossy since we explicitly do not persist all agent interactions, such as command executions. This is the same behavior as `thread/resume`."
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
class ThreadSearchResult(BaseModel):
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
@@ -12169,7 +12133,6 @@ class ClientRequest(
|
||||
| ThreadCompactStartRequest
|
||||
| ThreadShellCommandRequest
|
||||
| ThreadApproveGuardianDeniedActionRequest
|
||||
| ThreadRollbackRequest
|
||||
| ThreadRevertRequest
|
||||
| ThreadListRequest
|
||||
| ThreadSectionListRequest
|
||||
@@ -12277,7 +12240,6 @@ class ClientRequest(
|
||||
| ThreadCompactStartRequest
|
||||
| ThreadShellCommandRequest
|
||||
| ThreadApproveGuardianDeniedActionRequest
|
||||
| ThreadRollbackRequest
|
||||
| ThreadRevertRequest
|
||||
| ThreadListRequest
|
||||
| ThreadSectionListRequest
|
||||
|
||||
Reference in New Issue
Block a user