Skip to content

Add a sandbox sample and snipsync markers for the OpenAI Agents docs guide - #351

Merged
brianstrauch merged 3 commits into
mainfrom
snipsync/openai-agents-and-sandbox-sample
Aug 19, 2026
Merged

Add a sandbox sample and snipsync markers for the OpenAI Agents docs guide#351
brianstrauch merged 3 commits into
mainfrom
snipsync/openai-agents-and-sandbox-sample

Conversation

@brianstrauch

Copy link
Copy Markdown
Member

What changed

New openai_agents/sandbox sample. Covers SandboxAgent through the plugin: SandboxClientProvider on the worker, temporal_sandbox_client() in the workflow, and a run that writes a file in the sandbox, reads it back, and reports what it found.

It uses UnixLocalSandboxClient, so it runs with only OPENAI_API_KEY and no Daytona/E2B account — at the cost of giving the agent a shell on the worker host, which the sample README calls out and points at the remote clients for production. Worth knowing: that class lives in agents.sandbox.sandboxes.unix_local, not the agents.extensions.sandbox.unix_local path the contrib README shows (fixed in temporalio/sdk-python#1764).

Snipsync markers on the 16 existing samples the docs guide walks through.

Why?

Python is currently the only Temporal OpenAI Agents integration with no guide on docs.temporal.io — the SDK index and the integrations grid both send readers to the contrib README on GitHub. The companion docs PR adds that guide, and it needs code to pull from here rather than hand-maintaining inline copies. Sandbox is the one section with no sample to pull from, hence the new one.

Two details worth flagging for review:

  • Markers are scoped to exactly the code the guide shows, so no docs block needs selectedLines and none renders a leading # ... elision.
  • Markers that wrap indented code sit at that code's indent level rather than column 0, keeping snipsync's dedenting working — the same fix as Scope google_genai snippet markers to the excerpted code #346.

Checklist

  1. Closes

  2. How was this tested:

The sandbox sample was run end to end against temporal server start-dev. With no OpenAI key available, the model was driven by the plugin's own temporalio.contrib.openai_agents.testing.TestModel scripting one exec_command tool call; the sandbox itself was real. The workflow returned its output and history confirms the sandbox activities executed:

invoke_model_activity
local-sandbox_client_create
local-sandbox_session_start
local-sandbox_session_running
local-sandbox_session_pty_exec_start
local-sandbox_session_stop
local-sandbox_session_shutdown
local-sandbox_client_delete

Also confirmed the worker registers all 16 activities under the local- provider prefix, and that it boots and polls the task queue.

ruff check --select I, ruff format --check, and mypy --check-untyped-defs --namespace-packages all pass across openai_agents/ (120 files).

Snippet resolution was verified by pointing a local snipsync.config.yaml at this working tree and running yarn snipsync from the documentation repo: all 18 IDs resolve and every excerpt dedents to column 0.

🤖 Generated with Claude Code

The Python OpenAI Agents SDK integration guide on docs.temporal.io
currently sends readers to the SDK contrib README. Give it code to pull
from here instead.

Adds openai_agents/sandbox, covering SandboxAgent through the plugin. It
uses UnixLocalSandboxClient, so it runs with only OPENAI_API_KEY and no
sandbox account — at the cost of giving the agent a shell on the worker
host, which the README calls out. Note the class lives in
agents.sandbox.sandboxes.unix_local, not the
agents.extensions.sandbox.unix_local path the contrib README shows.

Adds snipsync markers to the samples that guide walks through, scoped to
exactly the code it shows so no block needs selectedLines. Markers around
indented code sit at that code's indent level, keeping snipsync's dedent
working (see #346).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@brianstrauch
brianstrauch requested review from a team as code owners August 18, 2026 21:43
Comment thread openai_agents/README.md
Comment thread openai_agents/README.md Outdated
@brianstrauch
brianstrauch merged commit e652a4d into main Aug 19, 2026
11 checks passed
@brianstrauch
brianstrauch deleted the snipsync/openai-agents-and-sandbox-sample branch August 19, 2026 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants