Skip to content

Commit 78e6a04

Browse files
authored
docs: update document pages for v0.8.1 release (#2432)
1 parent 5949f09 commit 78e6a04

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

docs/examples.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ Check out a variety of sample implementations of the SDK in the examples section
8585
- Computer use
8686
- Image generation
8787
- Experimental Codex tool workflows (`examples/tools/codex.py`)
88+
- Experimental Codex same-thread workflows (`examples/tools/codex_same_thread.py`)
8889

8990
- **[voice](https://github.com/openai/openai-agents-python/tree/main/examples/voice):**
9091
See examples of voice agents, using our TTS and STT models, including streamed voice examples.

docs/tools.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,8 @@ Disabled tools are completely hidden from the LLM at runtime, making this useful
503503

504504
The `codex_tool` wraps the Codex CLI so an agent can run workspace-scoped tasks (shell, file edits, MCP tools)
505505
during a tool call. This surface is experimental and may change.
506+
By default, the tool name is `codex`. If you set a custom name, it must be `codex` or start with `codex_`.
507+
When an agent includes multiple Codex tools, each must use a unique name (including vs non-Codex tools).
506508

507509
```python
508510
from agents import Agent
@@ -542,11 +544,13 @@ What to know:
542544
- Thread defaults: configure `default_thread_options` for `model_reasoning_effort`, `web_search_mode` (preferred over legacy `web_search_enabled`), `approval_policy`, and `additional_directories`.
543545
- Turn defaults: configure `default_turn_options` for `idle_timeout_seconds` and cancellation `signal`.
544546
- Safety: pair `sandbox_mode` with `working_directory`; set `skip_git_repo_check=True` outside Git repos.
545-
- Behavior: `persist_session=True` reuses a single Codex thread and returns its `thread_id`.
546-
- Streaming: `on_stream` receives Codex events (reasoning, command execution, MCP tool calls, file changes, web search).
547+
- Run-context thread persistence: `use_run_context_thread_id=True` stores and reuses `thread_id` in run context, across runs that share that context. This requires a mutable run context (for example, `dict` or a writable object field).
548+
- Run-context key defaults: the stored key defaults to `codex_thread_id` for `name="codex"`, or `codex_thread_id_<suffix>` for `name="codex_<suffix>"`. Set `run_context_thread_id_key` to override.
549+
- Thread ID precedence: per-call `thread_id` input takes priority, then run-context `thread_id` (if enabled), then the configured `thread_id` option.
550+
- Streaming: `on_stream` receives thread/turn lifecycle events and item events (`reasoning`, `command_execution`, `mcp_tool_call`, `file_change`, `web_search`, `todo_list`, and `error` item updates).
547551
- Outputs: results include `response`, `usage`, and `thread_id`; usage is added to `RunContextWrapper.usage`.
548552
- Structure: `output_schema` enforces structured Codex responses when you need typed outputs.
549-
- See `examples/tools/codex.py` for a complete runnable sample.
553+
- See `examples/tools/codex.py` and `examples/tools/codex_same_thread.py` for complete runnable samples.
550554

551555
## Handling errors in function tools
552556

0 commit comments

Comments
 (0)