Skip to content

Commit 1f53237

Browse files
feat(api): add agent session review and tool settings
Castiron-Internal-PR: openai/openai-python-internal#379 Castiron-Source-SHA: b39b068d9fd3d67d942499cb9fdadc660ee0fd05 Castiron-Public-Base-SHA: bd61e84
1 parent bd61e84 commit 1f53237

14 files changed

Lines changed: 206 additions & 28 deletions

File tree

‎.castiron.stats.yml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
schema_version: 1
2-
generation_id: 7b7feee1-6807-4c20-98e0-610aab05b2da
3-
openapi_spec_hash: 51b199ef7fd5542bc4910765f9becd60
4-
openapi_transformed_spec_hash: 73822d924c15a6ed58dcfe8f616bd4be
2+
generation_id: 02d4f0c7-8393-440e-a93a-39956ee04c68
3+
openapi_spec_hash: 305993fa2c84b50a0e0337094c8126c5
4+
openapi_transformed_spec_hash: 2c32c80a270cfbe9f55a0da534778ce7
55
config_hash: b707b209c892562880c415693d111ad6
6-
codegen_sha: e1054c07fb03a8025411f0ff6ee0a5ff17e09109
7-
codegen_hash: 73c66bd2bff47ee2bbd2d04a174184dec767ebe300a3bd41443938d914013ef0
6+
codegen_sha: f32119a692a8ae837d9c1cf3916100c7ffd6363c
7+
codegen_hash: 8897330eea226e74e84660fd7c0b6b0096b52a6176930760065cce69008b1d70

‎api_reference/openapi.transformed.yml‎

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33545,7 +33545,7 @@ paths:
3354533545
post:
3354633546
operationId: updateAgentSession
3354733547
summary: Update an agent session
33548-
description: Updates session metadata, model, reasoning effort, or service tier. Model settings apply to subsequent turns. Omitted fields are unchanged. See [managing sessions](https://developers.openai.com/api/docs/guides/agents-api/sessions/manage).
33548+
description: Updates session tools, metadata, model, reasoning effort, or service tier. Model settings apply to subsequent turns. Omitted fields are unchanged. See [managing sessions](https://developers.openai.com/api/docs/guides/agents-api/sessions/manage).
3354933549
tags:
3355033550
- Agents
3355133551
parameters:
@@ -85706,6 +85706,9 @@ components:
8570685706
defer_loading:
8570785707
type: boolean
8570885708
description: Whether the function is deferred and discovered through tool search.
85709+
async:
85710+
type: boolean
85711+
description: If true, Managed Agents immediately acknowledges the call to the model. The client submits only the final result.
8570985712
required:
8571085713
- type
8571185714
- name
@@ -87122,6 +87125,10 @@ components:
8712287125
type: boolean
8712387126
default: false
8712487127
description: Whether this function is deferred and discovered through tool search. Defaults to `false`.
87128+
async:
87129+
type: boolean
87130+
default: false
87131+
description: If true, Managed Agents immediately acknowledges the call to the model. The client submits only the final result. Defaults to `false`.
8712587132
required:
8712687133
- type
8712787134
- name
@@ -90675,6 +90682,9 @@ components:
9067590682
defer_loading:
9067690683
type: boolean
9067790684
description: Whether the function is deferred and discovered through tool search.
90685+
async:
90686+
type: boolean
90687+
description: If true, Managed Agents immediately acknowledges the call to the model. The client submits only the final result.
9067890688
required:
9067990689
- type
9068090690
- name
@@ -91129,6 +91139,10 @@ components:
9112991139
type: boolean
9113091140
default: false
9113191141
description: Whether this function is deferred and discovered through tool search. Defaults to `false`.
91142+
async:
91143+
type: boolean
91144+
default: false
91145+
description: If true, Managed Agents immediately acknowledges the call to the model. The client submits only the final result. Defaults to `false`.
9113291146
required:
9113391147
- type
9113491148
- name
@@ -92387,6 +92401,9 @@ components:
9238792401
- $ref: '#/components/schemas/TokenUsageResource'
9238892402
- type: 'null'
9238992403
description: Best-effort token usage for the session, or null if unknown. Recorded usage may change.
92404+
review:
92405+
$ref: '#/components/schemas/SessionReviewResource'
92406+
description: Review applied to eligible actions in this session. Omitted when review is none and automatic review is not enabled. Omission means none.
9239092407
spend_control:
9239192408
$ref: '#/components/schemas/SessionSpendControlResource'
9239292409
description: Configured spending limit and best-effort consumption, in USD cents. Unlimited sessions omit this object.
@@ -92505,6 +92522,9 @@ components:
9250592522
type: boolean
9250692523
default: false
9250792524
description: Whether to stream session events as server-sent events. Defaults to `false`.
92525+
review:
92526+
$ref: '#/components/schemas/SessionReviewParam'
92527+
description: Action review mode. Omit to use none.
9250892528
spend_control:
9250992529
anyOf:
9251092530
- $ref: '#/components/schemas/SessionSpendControlParam'
@@ -94115,14 +94135,23 @@ components:
9411594135
- type: 'null'
9411694136
description: Omit to keep the current tier. Null resets it to auto.
9411794137
x-openai-go-optional-enum: true
94138+
tools:
94139+
type:
94140+
- array
94141+
- 'null'
94142+
items:
94143+
$ref: '#/components/schemas/AgentToolConfigParam'
94144+
minItems: 0
94145+
maxItems: 16384
94146+
description: Replaces the session tools. Functions and MCP servers change on the next model call. Built-in tools change by the next turn. Omit to keep the current tools, or pass null or an empty array to clear them.
9411894147
additionalProperties: false
94119-
description: Model settings that can change after session creation.
94148+
description: Agent settings that can change after session creation.
9412094149
UpdateAgentSessionParams:
9412194150
type: object
9412294151
properties:
9412394152
agent:
9412494153
$ref: '#/components/schemas/UpdateSessionAgentParam'
94125-
description: Model settings for subsequent turns. Omitted fields stay unchanged.
94154+
description: Agent settings to update on this session. Omitted fields stay unchanged.
9412694155
metadata:
9412794156
type:
9412894157
- object
@@ -94138,6 +94167,9 @@ components:
9413894167
minProperties: 0
9413994168
maxProperties: 16
9414094169
description: Replaces all metadata. Omit to leave unchanged, or pass null or {} to clear it. Up to 16 string key-value pairs, with keys up to 64 and values up to 512 characters.
94170+
review:
94171+
$ref: '#/components/schemas/SessionReviewParam'
94172+
description: Default action review for new root turns. Existing turns and their subagents keep their review mode.
9414194173
spend_control:
9414294174
anyOf:
9414394175
- $ref: '#/components/schemas/SessionSpendControlParam'
@@ -111890,6 +111922,21 @@ components:
111890111922
- $ref: '#/components/schemas/BetaResponseCustomToolCallInputDoneEvent'
111891111923
discriminator:
111892111924
propertyName: type
111925+
SessionReviewParam:
111926+
type: string
111927+
enum:
111928+
- none
111929+
- auto_review
111930+
x-enumDescriptions:
111931+
- Keep the existing execution behavior without automatic action review.
111932+
- Review eligible actions automatically. Deny manual approval fallbacks.
111933+
description: Review applied to eligible actions in a session.
111934+
SessionReviewResource:
111935+
type: string
111936+
enum:
111937+
- none
111938+
- auto_review
111939+
description: The configured action review mode.
111893111940
SessionSpendControlResource:
111894111941
type: object
111895111942
properties:

‎scripts/castiron/generated-files.json‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@
287287
},
288288
"src/openai/resources/beta/agents/sessions/sessions.py": {
289289
"mode": "100644",
290-
"sha256": "d1719b767d0b16e9eba1c405a66e9c11874da30a6ba2fa873603d1e6a9f6f7e2"
290+
"sha256": "264c1c83bc479591e9b70166208a4384e7266c7176a3fea7971f1d876ef54294"
291291
},
292292
"src/openai/resources/beta/agents/sessions/subagents/__init__.py": {
293293
"mode": "100644",
@@ -1703,7 +1703,7 @@
17031703
},
17041704
"src/openai/types/beta/agent_session.py": {
17051705
"mode": "100644",
1706-
"sha256": "4dbf44628416d12c8cdf46a6a73e293239736ca23dfb096e39850d68ffe5daa6"
1706+
"sha256": "c3563e065a7d80a1ee1676d31cd4b835a2363a691db2ac778f8a0c13f265e37b"
17071707
},
17081708
"src/openai/types/beta/agent_session_assistant_message.py": {
17091709
"mode": "100644",
@@ -1879,11 +1879,11 @@
18791879
},
18801880
"src/openai/types/beta/agent_tool.py": {
18811881
"mode": "100644",
1882-
"sha256": "ed568481e6de6956b9deccfbb7cce718bba3cfbab6270851602886141af5230c"
1882+
"sha256": "9d25cb93e49b88d0cf80ccb7fb93880594332aeab7ee623e8f3c530d6599bbd2"
18831883
},
18841884
"src/openai/types/beta/agent_tool_param.py": {
18851885
"mode": "100644",
1886-
"sha256": "50116fba12372f68fc831149fafc3896e5b0be3f8f12bc72cc539ead14be34b3"
1886+
"sha256": "44b83c04613add6637b8de7bb48cbf4b1220ddde3d1a2e50e1edfb9d6d4b8990"
18871887
},
18881888
"src/openai/types/beta/agent_update_params.py": {
18891889
"mode": "100644",
@@ -2019,15 +2019,15 @@
20192019
},
20202020
"src/openai/types/beta/agents/session_create_params.py": {
20212021
"mode": "100644",
2022-
"sha256": "d4566c2d07b1a1469e929763fa12e626cb1dbeae6dedfd00648f8220b4af8581"
2022+
"sha256": "89d1618c6a0a6ef4791ee9376bbd8fdd512b8f0c259eb551c0c27281cbf61170"
20232023
},
20242024
"src/openai/types/beta/agents/session_list_params.py": {
20252025
"mode": "100644",
20262026
"sha256": "2de32d51ce2cfdbcf2224acfa8b04a28234717d6c373a3d68ee66bac90f75d2d"
20272027
},
20282028
"src/openai/types/beta/agents/session_update_params.py": {
20292029
"mode": "100644",
2030-
"sha256": "de3b4a42dfa9591dc07086c3ac888502c8dd0d3c7e77c82969a10a116dcee18e"
2030+
"sha256": "595ab57453c5678034088224417b1946dc37f4dd11e28c7f6df49d75d7dd3dd0"
20312031
},
20322032
"src/openai/types/beta/agents/sessions/__init__.py": {
20332033
"mode": "100644",
@@ -3403,11 +3403,11 @@
34033403
},
34043404
"src/openai/types/beta/persisted_agent_tool.py": {
34053405
"mode": "100644",
3406-
"sha256": "337c62e5505ccc43656dad66d619b0a0be532181c8f598e7ccf047b9e6ed8824"
3406+
"sha256": "d7563a66acc9614a8e4b051512760b1091c05a9aa9bbd6d7cd0606db270573dd"
34073407
},
34083408
"src/openai/types/beta/persisted_agent_tool_param.py": {
34093409
"mode": "100644",
3410-
"sha256": "d9e83ab1f8347f4acc525746b1e2c0bc42cbcf64742976dea0983cc419e8fe74"
3410+
"sha256": "11cd9c21954b53b21883fb68c5f751811663ee653bfef429c53a81a24916b934"
34113411
},
34123412
"src/openai/types/beta/persisted_mcp_transport.py": {
34133413
"mode": "100644",
@@ -7707,15 +7707,15 @@
77077707
},
77087708
"tests/api_resources/beta/agents/test_automations.py": {
77097709
"mode": "100644",
7710-
"sha256": "34501f413c83a2ccd9aa494eb59f5c0ae1ba21fa14619dd2bc41571ad8a6422a"
7710+
"sha256": "2b10ce0346ce9ff87a52782763f6e544c6a7320a0075c7972624dcc4e8b9cf78"
77117711
},
77127712
"tests/api_resources/beta/agents/test_environments.py": {
77137713
"mode": "100644",
77147714
"sha256": "529f48933850ff09980fbd8a8ec6c9bef538efa5bffa71660e14421693df02fa"
77157715
},
77167716
"tests/api_resources/beta/agents/test_sessions.py": {
77177717
"mode": "100644",
7718-
"sha256": "8cfecc54a8e76b3714fa35298725eb6b315750fe5a2b112fff6185e14df8f831"
7718+
"sha256": "bff353017fd3385cdcf0db40291e6ae63da4ac10596b48f5eac031cc02dd95f3"
77197719
},
77207720
"tests/api_resources/beta/agents/test_vaults.py": {
77217721
"mode": "100644",
@@ -7755,7 +7755,7 @@
77557755
},
77567756
"tests/api_resources/beta/test_agents.py": {
77577757
"mode": "100644",
7758-
"sha256": "6216ae37c6ea996da62e4916570840ed549aeb86603b607d61078b4b30c87d15"
7758+
"sha256": "3147acf9a9f9628c4aaed1d51aee13cde66c88bea3e9324d3c157daa68070f68"
77597759
},
77607760
"tests/api_resources/beta/test_assistants.py": {
77617761
"mode": "100644",

0 commit comments

Comments
 (0)