mirror of
https://github.com/openai/codex.git
synced 2026-10-24 18:18:41 +00:00
Persist additional tool definitions in rollout history (#50435)
## Why `additional_tools` response items were excluded from rollout persistence, dropping their tool definitions from saved history. ## What changed - Persist `additional_tools` items in both legacy and paginated history modes. - Expose the variant in generated JSON schemas, TypeScript types, and Python models, with an optional `id`, a `role`, and arbitrary JSON tool definitions. ## Testing Add a recorder round-trip test that verifies tool definitions survive recording and loading in both history modes without parse errors. GitOrigin-RevId: 0e7c7b1c10401ec6513fb744de642a1cf9e461d7
This commit is contained in:
@@ -3934,6 +3934,16 @@ class ResourceTemplate(BaseModel):
|
||||
uri_template: Annotated[str, Field(alias="uriTemplate")]
|
||||
|
||||
|
||||
class AdditionalToolsResponseItem(BaseModel):
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
)
|
||||
id: str | None = None
|
||||
role: str
|
||||
tools: list
|
||||
type: Annotated[Literal["additional_tools"], Field(title="AdditionalToolsResponseItemType")]
|
||||
|
||||
|
||||
class AgentMessageResponseItem(BaseModel):
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
@@ -11147,7 +11157,8 @@ class CustomToolCallOutputResponseItem(BaseModel):
|
||||
|
||||
class ResponseItem(
|
||||
RootModel[
|
||||
MessageResponseItem
|
||||
AdditionalToolsResponseItem
|
||||
| MessageResponseItem
|
||||
| AgentMessageResponseItem
|
||||
| ReasoningResponseItem
|
||||
| LocalShellCallResponseItem
|
||||
@@ -11170,7 +11181,8 @@ class ResponseItem(
|
||||
populate_by_name=True,
|
||||
)
|
||||
root: (
|
||||
MessageResponseItem
|
||||
AdditionalToolsResponseItem
|
||||
| MessageResponseItem
|
||||
| AgentMessageResponseItem
|
||||
| ReasoningResponseItem
|
||||
| LocalShellCallResponseItem
|
||||
|
||||
Reference in New Issue
Block a user