codex-sdk-python 0.87.0__tar.gz → 0.88.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {codex_sdk_python-0.87.0 → codex_sdk_python-0.88.0}/PKG-INFO +14 -1
- {codex_sdk_python-0.87.0 → codex_sdk_python-0.88.0}/README.md +13 -0
- {codex_sdk_python-0.87.0 → codex_sdk_python-0.88.0}/pyproject.toml +1 -1
- {codex_sdk_python-0.87.0 → codex_sdk_python-0.88.0}/src/codex_sdk/__init__.py +3 -1
- {codex_sdk_python-0.87.0 → codex_sdk_python-0.88.0}/src/codex_sdk/app_server.py +3 -0
- {codex_sdk_python-0.87.0 → codex_sdk_python-0.88.0}/src/codex_sdk/exec.py +41 -1
- {codex_sdk_python-0.87.0 → codex_sdk_python-0.88.0}/src/codex_sdk/options.py +23 -1
- {codex_sdk_python-0.87.0 → codex_sdk_python-0.88.0}/src/codex_sdk/thread.py +5 -0
- {codex_sdk_python-0.87.0 → codex_sdk_python-0.88.0}/src/codex_sdk/abort.py +0 -0
- {codex_sdk_python-0.87.0 → codex_sdk_python-0.88.0}/src/codex_sdk/codex.py +0 -0
- {codex_sdk_python-0.87.0 → codex_sdk_python-0.88.0}/src/codex_sdk/config_overrides.py +0 -0
- {codex_sdk_python-0.87.0 → codex_sdk_python-0.88.0}/src/codex_sdk/events.py +0 -0
- {codex_sdk_python-0.87.0 → codex_sdk_python-0.88.0}/src/codex_sdk/exceptions.py +0 -0
- {codex_sdk_python-0.87.0 → codex_sdk_python-0.88.0}/src/codex_sdk/hooks.py +0 -0
- {codex_sdk_python-0.87.0 → codex_sdk_python-0.88.0}/src/codex_sdk/integrations/__init__.py +0 -0
- {codex_sdk_python-0.87.0 → codex_sdk_python-0.88.0}/src/codex_sdk/integrations/pydantic_ai.py +0 -0
- {codex_sdk_python-0.87.0 → codex_sdk_python-0.88.0}/src/codex_sdk/integrations/pydantic_ai_model.py +0 -0
- {codex_sdk_python-0.87.0 → codex_sdk_python-0.88.0}/src/codex_sdk/items.py +0 -0
- {codex_sdk_python-0.87.0 → codex_sdk_python-0.88.0}/src/codex_sdk/telemetry.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: codex-sdk-python
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.88.0
|
|
4
4
|
Summary: Python SDK for the Codex CLI agent with async threads, streaming events, and structured outputs
|
|
5
5
|
Keywords: codex,sdk,python,api,cli,agent,async,streaming
|
|
6
6
|
Author: Vectorfy Co
|
|
@@ -244,6 +244,9 @@ ThreadOptions(
|
|
|
244
244
|
working_directory="/path/to/project",
|
|
245
245
|
skip_git_repo_check=True,
|
|
246
246
|
model_reasoning_effort="high",
|
|
247
|
+
model_instructions_file="/path/to/instructions.md",
|
|
248
|
+
model_personality="friendly",
|
|
249
|
+
max_threads=4,
|
|
247
250
|
network_access_enabled=True,
|
|
248
251
|
web_search_mode="cached",
|
|
249
252
|
shell_snapshot_enabled=True,
|
|
@@ -251,6 +254,8 @@ ThreadOptions(
|
|
|
251
254
|
apply_patch_freeform_enabled=False,
|
|
252
255
|
exec_policy_enabled=True,
|
|
253
256
|
remote_models_enabled=False,
|
|
257
|
+
collaboration_modes_enabled=True,
|
|
258
|
+
responses_websockets_enabled=True,
|
|
254
259
|
request_compression_enabled=True,
|
|
255
260
|
approval_policy="on-request",
|
|
256
261
|
additional_directories=["../shared"],
|
|
@@ -264,6 +269,9 @@ Important mappings to the Codex CLI:
|
|
|
264
269
|
- `additional_directories` maps to repeated `--add-dir`.
|
|
265
270
|
- `skip_git_repo_check` maps to `--skip-git-repo-check`.
|
|
266
271
|
- `model_reasoning_effort` maps to `--config model_reasoning_effort=...`.
|
|
272
|
+
- `model_instructions_file` maps to `--config model_instructions_file=...`.
|
|
273
|
+
- `model_personality` maps to `--config model_personality=...`.
|
|
274
|
+
- `max_threads` maps to `--config agents.max_threads=...`.
|
|
267
275
|
- `network_access_enabled` maps to `--config sandbox_workspace_write.network_access=...`.
|
|
268
276
|
- `web_search_mode` maps to `--config web_search="disabled|cached|live"`.
|
|
269
277
|
- `web_search_enabled`/`web_search_cached_enabled` map to `--config web_search=...` for legacy
|
|
@@ -273,12 +281,16 @@ Important mappings to the Codex CLI:
|
|
|
273
281
|
- `apply_patch_freeform_enabled` maps to `--config features.apply_patch_freeform=...`.
|
|
274
282
|
- `exec_policy_enabled` maps to `--config features.exec_policy=...`.
|
|
275
283
|
- `remote_models_enabled` maps to `--config features.remote_models=...`.
|
|
284
|
+
- `collaboration_modes_enabled` maps to `--config features.collaboration_modes=...`.
|
|
285
|
+
- `responses_websockets_enabled` maps to `--config features.responses_websockets=...`.
|
|
276
286
|
- `request_compression_enabled` maps to `--config features.enable_request_compression=...`.
|
|
277
287
|
- `feature_overrides` maps to `--config features.<key>=...` (explicit options take precedence).
|
|
278
288
|
- `approval_policy` maps to `--config approval_policy=...`.
|
|
279
289
|
- `config_overrides` maps to repeated `--config key=value` entries.
|
|
280
290
|
|
|
281
291
|
Note: `skills_enabled` is deprecated in Codex 0.80+ (skills are always enabled).
|
|
292
|
+
Note: Codex 0.88.0+ ignores `experimental_instructions_file`; use
|
|
293
|
+
`model_instructions_file` instead.
|
|
282
294
|
|
|
283
295
|
Feature overrides example:
|
|
284
296
|
|
|
@@ -336,6 +348,7 @@ The SDK also exposes helpers for most app-server endpoints:
|
|
|
336
348
|
- Skills: `skills_list`
|
|
337
349
|
- Turns/review: `turn_start`, `turn_interrupt`, `review_start`, `turn_session`
|
|
338
350
|
- Models: `model_list`
|
|
351
|
+
- Collaboration modes: `collaboration_mode_list`
|
|
339
352
|
- One-off commands: `command_exec`
|
|
340
353
|
- MCP auth/status: `mcp_server_oauth_login`, `mcp_server_refresh`, `mcp_server_status_list`
|
|
341
354
|
- Account: `account_login_start`, `account_login_cancel`, `account_logout`,
|
|
@@ -208,6 +208,9 @@ ThreadOptions(
|
|
|
208
208
|
working_directory="/path/to/project",
|
|
209
209
|
skip_git_repo_check=True,
|
|
210
210
|
model_reasoning_effort="high",
|
|
211
|
+
model_instructions_file="/path/to/instructions.md",
|
|
212
|
+
model_personality="friendly",
|
|
213
|
+
max_threads=4,
|
|
211
214
|
network_access_enabled=True,
|
|
212
215
|
web_search_mode="cached",
|
|
213
216
|
shell_snapshot_enabled=True,
|
|
@@ -215,6 +218,8 @@ ThreadOptions(
|
|
|
215
218
|
apply_patch_freeform_enabled=False,
|
|
216
219
|
exec_policy_enabled=True,
|
|
217
220
|
remote_models_enabled=False,
|
|
221
|
+
collaboration_modes_enabled=True,
|
|
222
|
+
responses_websockets_enabled=True,
|
|
218
223
|
request_compression_enabled=True,
|
|
219
224
|
approval_policy="on-request",
|
|
220
225
|
additional_directories=["../shared"],
|
|
@@ -228,6 +233,9 @@ Important mappings to the Codex CLI:
|
|
|
228
233
|
- `additional_directories` maps to repeated `--add-dir`.
|
|
229
234
|
- `skip_git_repo_check` maps to `--skip-git-repo-check`.
|
|
230
235
|
- `model_reasoning_effort` maps to `--config model_reasoning_effort=...`.
|
|
236
|
+
- `model_instructions_file` maps to `--config model_instructions_file=...`.
|
|
237
|
+
- `model_personality` maps to `--config model_personality=...`.
|
|
238
|
+
- `max_threads` maps to `--config agents.max_threads=...`.
|
|
231
239
|
- `network_access_enabled` maps to `--config sandbox_workspace_write.network_access=...`.
|
|
232
240
|
- `web_search_mode` maps to `--config web_search="disabled|cached|live"`.
|
|
233
241
|
- `web_search_enabled`/`web_search_cached_enabled` map to `--config web_search=...` for legacy
|
|
@@ -237,12 +245,16 @@ Important mappings to the Codex CLI:
|
|
|
237
245
|
- `apply_patch_freeform_enabled` maps to `--config features.apply_patch_freeform=...`.
|
|
238
246
|
- `exec_policy_enabled` maps to `--config features.exec_policy=...`.
|
|
239
247
|
- `remote_models_enabled` maps to `--config features.remote_models=...`.
|
|
248
|
+
- `collaboration_modes_enabled` maps to `--config features.collaboration_modes=...`.
|
|
249
|
+
- `responses_websockets_enabled` maps to `--config features.responses_websockets=...`.
|
|
240
250
|
- `request_compression_enabled` maps to `--config features.enable_request_compression=...`.
|
|
241
251
|
- `feature_overrides` maps to `--config features.<key>=...` (explicit options take precedence).
|
|
242
252
|
- `approval_policy` maps to `--config approval_policy=...`.
|
|
243
253
|
- `config_overrides` maps to repeated `--config key=value` entries.
|
|
244
254
|
|
|
245
255
|
Note: `skills_enabled` is deprecated in Codex 0.80+ (skills are always enabled).
|
|
256
|
+
Note: Codex 0.88.0+ ignores `experimental_instructions_file`; use
|
|
257
|
+
`model_instructions_file` instead.
|
|
246
258
|
|
|
247
259
|
Feature overrides example:
|
|
248
260
|
|
|
@@ -300,6 +312,7 @@ The SDK also exposes helpers for most app-server endpoints:
|
|
|
300
312
|
- Skills: `skills_list`
|
|
301
313
|
- Turns/review: `turn_start`, `turn_interrupt`, `review_start`, `turn_session`
|
|
302
314
|
- Models: `model_list`
|
|
315
|
+
- Collaboration modes: `collaboration_mode_list`
|
|
303
316
|
- One-off commands: `command_exec`
|
|
304
317
|
- MCP auth/status: `mcp_server_oauth_login`, `mcp_server_refresh`, `mcp_server_status_list`
|
|
305
318
|
- Account: `account_login_start`, `account_login_cancel`, `account_logout`,
|
|
@@ -4,7 +4,7 @@ build-backend = "uv_build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "codex-sdk-python"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.88.0"
|
|
8
8
|
description = "Python SDK for the Codex CLI agent with async threads, streaming events, and structured outputs"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = {text = "Apache-2.0"}
|
|
@@ -60,6 +60,7 @@ from .items import (
|
|
|
60
60
|
from .options import (
|
|
61
61
|
ApprovalMode,
|
|
62
62
|
CodexOptions,
|
|
63
|
+
ModelPersonality,
|
|
63
64
|
ModelReasoningEffort,
|
|
64
65
|
SandboxMode,
|
|
65
66
|
ThreadOptions,
|
|
@@ -76,7 +77,7 @@ from .thread import (
|
|
|
76
77
|
Turn,
|
|
77
78
|
)
|
|
78
79
|
|
|
79
|
-
__version__ = "0.
|
|
80
|
+
__version__ = "0.88.0"
|
|
80
81
|
|
|
81
82
|
__all__ = [
|
|
82
83
|
"AbortController",
|
|
@@ -132,6 +133,7 @@ __all__ = [
|
|
|
132
133
|
"ApprovalMode",
|
|
133
134
|
"SandboxMode",
|
|
134
135
|
"ModelReasoningEffort",
|
|
136
|
+
"ModelPersonality",
|
|
135
137
|
"WebSearchMode",
|
|
136
138
|
"CodexError",
|
|
137
139
|
"CodexAbortError",
|
|
@@ -614,6 +614,9 @@ class AppServerClient:
|
|
|
614
614
|
params["limit"] = limit
|
|
615
615
|
return await self._request_dict("model/list", params or None)
|
|
616
616
|
|
|
617
|
+
async def collaboration_mode_list(self) -> Dict[str, Any]:
|
|
618
|
+
return await self._request_dict("collaborationMode/list", {})
|
|
619
|
+
|
|
617
620
|
async def command_exec(
|
|
618
621
|
self,
|
|
619
622
|
*,
|
|
@@ -27,7 +27,13 @@ from typing import (
|
|
|
27
27
|
from .abort import AbortSignal
|
|
28
28
|
from .config_overrides import encode_config_overrides
|
|
29
29
|
from .exceptions import CodexAbortError, CodexCLIError, CodexError
|
|
30
|
-
from .options import
|
|
30
|
+
from .options import (
|
|
31
|
+
ApprovalMode,
|
|
32
|
+
ModelPersonality,
|
|
33
|
+
ModelReasoningEffort,
|
|
34
|
+
SandboxMode,
|
|
35
|
+
WebSearchMode,
|
|
36
|
+
)
|
|
31
37
|
from .telemetry import span
|
|
32
38
|
|
|
33
39
|
INTERNAL_ORIGINATOR_ENV = "CODEX_INTERNAL_ORIGINATOR_OVERRIDE"
|
|
@@ -51,6 +57,9 @@ class CodexExecArgs:
|
|
|
51
57
|
skip_git_repo_check: Optional[bool] = None
|
|
52
58
|
output_schema_file: Optional[str] = None
|
|
53
59
|
model_reasoning_effort: Optional[ModelReasoningEffort] = None
|
|
60
|
+
model_instructions_file: Optional[Union[str, Path]] = None
|
|
61
|
+
model_personality: Optional[ModelPersonality] = None
|
|
62
|
+
max_threads: Optional[int] = None
|
|
54
63
|
network_access_enabled: Optional[bool] = None
|
|
55
64
|
web_search_mode: Optional[WebSearchMode] = None
|
|
56
65
|
web_search_enabled: Optional[bool] = None
|
|
@@ -61,6 +70,8 @@ class CodexExecArgs:
|
|
|
61
70
|
apply_patch_freeform_enabled: Optional[bool] = None
|
|
62
71
|
exec_policy_enabled: Optional[bool] = None
|
|
63
72
|
remote_models_enabled: Optional[bool] = None
|
|
73
|
+
collaboration_modes_enabled: Optional[bool] = None
|
|
74
|
+
responses_websockets_enabled: Optional[bool] = None
|
|
64
75
|
request_compression_enabled: Optional[bool] = None
|
|
65
76
|
feature_overrides: Optional[Mapping[str, bool]] = None
|
|
66
77
|
approval_policy: Optional[ApprovalMode] = None
|
|
@@ -199,6 +210,23 @@ class CodexExec:
|
|
|
199
210
|
["--config", f'model_reasoning_effort="{args.model_reasoning_effort}"']
|
|
200
211
|
)
|
|
201
212
|
|
|
213
|
+
if args.model_instructions_file:
|
|
214
|
+
instructions_path = str(args.model_instructions_file)
|
|
215
|
+
command_args.extend(
|
|
216
|
+
[
|
|
217
|
+
"--config",
|
|
218
|
+
f"model_instructions_file={json.dumps(instructions_path)}",
|
|
219
|
+
]
|
|
220
|
+
)
|
|
221
|
+
|
|
222
|
+
if args.model_personality:
|
|
223
|
+
command_args.extend(
|
|
224
|
+
["--config", f'model_personality="{args.model_personality}"']
|
|
225
|
+
)
|
|
226
|
+
|
|
227
|
+
if args.max_threads is not None:
|
|
228
|
+
command_args.extend(["--config", f"agents.max_threads={args.max_threads}"])
|
|
229
|
+
|
|
202
230
|
if args.feature_overrides:
|
|
203
231
|
for key in sorted(args.feature_overrides):
|
|
204
232
|
enabled = args.feature_overrides[key]
|
|
@@ -254,6 +282,18 @@ class CodexExec:
|
|
|
254
282
|
enabled_str = "true" if args.remote_models_enabled else "false"
|
|
255
283
|
command_args.extend(["--config", f"features.remote_models={enabled_str}"])
|
|
256
284
|
|
|
285
|
+
if args.collaboration_modes_enabled is not None:
|
|
286
|
+
enabled_str = "true" if args.collaboration_modes_enabled else "false"
|
|
287
|
+
command_args.extend(
|
|
288
|
+
["--config", f"features.collaboration_modes={enabled_str}"]
|
|
289
|
+
)
|
|
290
|
+
|
|
291
|
+
if args.responses_websockets_enabled is not None:
|
|
292
|
+
enabled_str = "true" if args.responses_websockets_enabled else "false"
|
|
293
|
+
command_args.extend(
|
|
294
|
+
["--config", f"features.responses_websockets={enabled_str}"]
|
|
295
|
+
)
|
|
296
|
+
|
|
257
297
|
if args.request_compression_enabled is not None:
|
|
258
298
|
enabled_str = "true" if args.request_compression_enabled else "false"
|
|
259
299
|
command_args.extend(
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
from dataclasses import dataclass
|
|
6
|
-
from
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
from typing import Any, List, Literal, Mapping, Optional, Union
|
|
7
8
|
|
|
8
9
|
from .abort import AbortSignal
|
|
9
10
|
|
|
@@ -13,6 +14,7 @@ SandboxMode = Literal["read-only", "workspace-write", "danger-full-access"]
|
|
|
13
14
|
|
|
14
15
|
ModelReasoningEffort = Literal["minimal", "low", "medium", "high", "xhigh"]
|
|
15
16
|
WebSearchMode = Literal["disabled", "cached", "live"]
|
|
17
|
+
ModelPersonality = Literal["friendly", "pragmatic"]
|
|
16
18
|
|
|
17
19
|
|
|
18
20
|
@dataclass
|
|
@@ -55,6 +57,9 @@ class ThreadOptions:
|
|
|
55
57
|
working_directory: Working directory for the thread.
|
|
56
58
|
skip_git_repo_check: Skip Git repository safety check.
|
|
57
59
|
model_reasoning_effort: Model reasoning effort preset.
|
|
60
|
+
model_instructions_file: Optional path to a file containing model instructions.
|
|
61
|
+
model_personality: Optional personality preset for the model.
|
|
62
|
+
max_threads: Maximum number of concurrent threads allowed by the agent.
|
|
58
63
|
network_access_enabled: Enable/disable network access in workspace-write sandbox.
|
|
59
64
|
web_search_mode: Web search mode ("disabled", "cached", or "live").
|
|
60
65
|
web_search_enabled: Enable/disable web search feature.
|
|
@@ -65,6 +70,8 @@ class ThreadOptions:
|
|
|
65
70
|
apply_patch_freeform_enabled: Enable/disable freeform apply_patch tool.
|
|
66
71
|
exec_policy_enabled: Enable/disable exec policy enforcement.
|
|
67
72
|
remote_models_enabled: Enable/disable remote model list refresh.
|
|
73
|
+
collaboration_modes_enabled: Enable/disable collaboration mode tooling.
|
|
74
|
+
responses_websockets_enabled: Enable/disable responses websocket transport.
|
|
68
75
|
request_compression_enabled: Enable/disable request body compression.
|
|
69
76
|
feature_overrides: Arbitrary feature flag overrides (key -> bool).
|
|
70
77
|
approval_policy: Approval policy for tool execution.
|
|
@@ -88,6 +95,15 @@ class ThreadOptions:
|
|
|
88
95
|
# Model reasoning effort preset
|
|
89
96
|
model_reasoning_effort: Optional[ModelReasoningEffort] = None
|
|
90
97
|
|
|
98
|
+
# Optional path to a file containing model instructions
|
|
99
|
+
model_instructions_file: Optional[Union[str, Path]] = None
|
|
100
|
+
|
|
101
|
+
# Optional personality preset for the model
|
|
102
|
+
model_personality: Optional[ModelPersonality] = None
|
|
103
|
+
|
|
104
|
+
# Maximum number of concurrent threads allowed by the agent
|
|
105
|
+
max_threads: Optional[int] = None
|
|
106
|
+
|
|
91
107
|
# Enable/disable network access in workspace-write sandbox
|
|
92
108
|
network_access_enabled: Optional[bool] = None
|
|
93
109
|
|
|
@@ -118,6 +134,12 @@ class ThreadOptions:
|
|
|
118
134
|
# Enable/disable remote model list refresh
|
|
119
135
|
remote_models_enabled: Optional[bool] = None
|
|
120
136
|
|
|
137
|
+
# Enable/disable collaboration mode tooling
|
|
138
|
+
collaboration_modes_enabled: Optional[bool] = None
|
|
139
|
+
|
|
140
|
+
# Enable/disable responses websocket transport
|
|
141
|
+
responses_websockets_enabled: Optional[bool] = None
|
|
142
|
+
|
|
121
143
|
# Enable/disable request body compression
|
|
122
144
|
request_compression_enabled: Optional[bool] = None
|
|
123
145
|
|
|
@@ -276,6 +276,9 @@ class Thread:
|
|
|
276
276
|
skip_git_repo_check=self._thread_options.skip_git_repo_check,
|
|
277
277
|
output_schema_file=schema_path,
|
|
278
278
|
model_reasoning_effort=self._thread_options.model_reasoning_effort,
|
|
279
|
+
model_instructions_file=self._thread_options.model_instructions_file,
|
|
280
|
+
model_personality=self._thread_options.model_personality,
|
|
281
|
+
max_threads=self._thread_options.max_threads,
|
|
279
282
|
network_access_enabled=self._thread_options.network_access_enabled,
|
|
280
283
|
web_search_mode=self._thread_options.web_search_mode,
|
|
281
284
|
web_search_enabled=self._thread_options.web_search_enabled,
|
|
@@ -286,6 +289,8 @@ class Thread:
|
|
|
286
289
|
apply_patch_freeform_enabled=self._thread_options.apply_patch_freeform_enabled,
|
|
287
290
|
exec_policy_enabled=self._thread_options.exec_policy_enabled,
|
|
288
291
|
remote_models_enabled=self._thread_options.remote_models_enabled,
|
|
292
|
+
collaboration_modes_enabled=self._thread_options.collaboration_modes_enabled,
|
|
293
|
+
responses_websockets_enabled=self._thread_options.responses_websockets_enabled,
|
|
289
294
|
request_compression_enabled=self._thread_options.request_compression_enabled,
|
|
290
295
|
feature_overrides=self._thread_options.feature_overrides,
|
|
291
296
|
approval_policy=self._thread_options.approval_policy,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{codex_sdk_python-0.87.0 → codex_sdk_python-0.88.0}/src/codex_sdk/integrations/pydantic_ai.py
RENAMED
|
File without changes
|
{codex_sdk_python-0.87.0 → codex_sdk_python-0.88.0}/src/codex_sdk/integrations/pydantic_ai_model.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|