Add a sandbox sample and snipsync markers for the OpenAI Agents docs guide - #351
Merged
Merged
Conversation
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
commented
Aug 18, 2026
brianstrauch
commented
Aug 18, 2026
xumaple
approved these changes
Aug 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
New
openai_agents/sandboxsample. CoversSandboxAgentthrough the plugin:SandboxClientProvideron 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 onlyOPENAI_API_KEYand 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 inagents.sandbox.sandboxes.unix_local, not theagents.extensions.sandbox.unix_localpath 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:
selectedLinesand none renders a leading# ...elision.Checklist
Closes
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 owntemporalio.contrib.openai_agents.testing.TestModelscripting oneexec_commandtool call; the sandbox itself was real. The workflow returned its output and history confirms the sandbox activities executed: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, andmypy --check-untyped-defs --namespace-packagesall pass acrossopenai_agents/(120 files).Snippet resolution was verified by pointing a local
snipsync.config.yamlat this working tree and runningyarn snipsyncfrom the documentation repo: all 18 IDs resolve and every excerpt dedents to column 0.🤖 Generated with Claude Code