Commit Graph

597 Commits

Author SHA1 Message Date
Matthew.K 9d963e8f0c fix: bound manifest description truncation (#2974) 2026-04-20 22:03:50 +00:00
Matthew.K 902c5999a3 fix: tighten LocalSnapshot restorable checks (#2975) 2026-04-20 22:03:32 +00:00
Kazuhiro Sera 5515283d5e fix: windows errors with #2956 (#2979) 2026-04-20 21:58:07 +00:00
Kazuhiro Sera 12b5471aa3 fix: prepare Daytona workspace root before start (#2956) 2026-04-21 06:20:38 +09:00
Kazuhiro Sera cc57bb1648 fix: #2962 normalize sandbox paths and add Windows CI (#2963) 2026-04-21 06:20:17 +09:00
Kazuhiro Sera da82b2cd66 fix: #2951 warn for tool name character replacement (#2953) 2026-04-19 02:18:10 +00:00
Cocoon-Break cebc76397b docs: move module docstring to top of handoff_filters.py (#2950) 2026-04-19 01:23:00 +00:00
Kazuhiro Sera 82eaf15ad8 fix: #2938 make sandboxes importable on Windows (#2948) 2026-04-19 08:58:08 +09:00
Nilesh Patil 61443ca8af fix: #2929 surface run-loop exceptions after stream_events() completes (#2931) 2026-04-18 09:01:57 +09:00
qiyaoq-oai 377204714d feat: support sandbox extra path grants (#2920)
- Add SandboxPathGrant manifest support for explicit access to absolute
paths outside sandbox workspace.
- Centralize path handling in WorkspacePathPolicy.normalize_path(...),
including extra grant matching, symlink-aware host validation, and
most-specific grant selection.
- Harden access boundaries by rejecting filesystem-root grants, // root
aliases, and grants that resolve to /.
- Preserve nested grant semantics, including writable parent + read-only
child cases through remote symlink targets and macOS exec confinement.
- Update sandbox provider integrations to use shared path policy across
Docker, Unix-local, Runloop, Vercel, Cloudflare, E2B, Modal, Daytona,
and Blaxel.
2026-04-17 15:26:51 -07:00
Steve Coffey dd3f59e399 Loosen sandbox compaction model parsing (#2930)
### Summary

This pull request fixes sandbox compaction defaults so Azure/custom
deployment names do not fail before the model request is sent. It makes
compaction model-window lookup separator-insensitive for known
OpenAI-style names like `gpt-5-2`, adds a non-throwing lookup path, and
falls back to the static compaction threshold when the model window
cannot be inferred.

### Test plan

- `make format`
- `make lint`
- `uv run pytest tests/sandbox/test_compaction.py
tests/sandbox/capabilities/test_compaction_capability.py
tests/test_sandbox_runtime_agent_preparation.py -q`
- `uv run mypy src/agents/sandbox/capabilities/compaction.py
tests/sandbox/test_compaction.py
tests/sandbox/capabilities/test_compaction_capability.py`
- `uv run pyright src/agents/sandbox/capabilities/compaction.py
tests/sandbox/test_compaction.py
tests/sandbox/capabilities/test_compaction_capability.py`

Full `make tests` / `make typecheck` are currently blocked in this
workspace by missing optional dependencies and unrelated existing
failures (`numpy`, `litellm`, `sqlalchemy`, `temporalio`, `boto3`,
runloop extra, and one PTY timing assertion).

### Issue number

Refs #2927

### Checks

- [x] I've added new tests (if relevant)
- [ ] I've added/updated the relevant documentation
- [x] I've run `make lint` and `make format`
- [ ] I've made sure tests pass
2026-04-17 11:22:06 -07:00
Alex Bevilacqua 67fb85a17f feat(extensions): add MongoDB session backend (#2902) 2026-04-17 21:44:23 +09:00
Kazuhiro Sera f84ef7f649 fix: normalize compacted Responses user inputs before session reuse (#2925) 2026-04-17 18:25:11 +09:00
Eric B b7ba44688d fix: #604 handle None choices in ChatCompletion response (#2850)
Co-authored-by: Kazuhiro Sera <seratch@openai.com>
2026-04-17 14:07:20 +09:00
Scott Trinh b58d059f4d fix: Trust filesystem permissions for Vercel roots (#2910)
Instead of trying to constraint the agent to only work in the workspace,
allow it to fail freely without sudo.
2026-04-16 20:41:45 -07:00
yu 4f3c8a5379 fix: #1876 LiteLLM extra_body forwarding (#2900) 2026-04-16 06:34:22 +00:00
Kazuhiro Sera 47ecb38d07 feat: #2228 persist tool origin metadata in run items (#2654)
Co-authored-by: Hassan Abu Alhaj <136383052+habema@users.noreply.github.com>
2026-04-16 05:01:04 +09:00
Andrew Beveridge ☄️ 48ad4aae19 fix: tolerate None text in ResponseOutputText content items (#2883) 2026-04-16 04:55:46 +09:00
Javier De Jesus 09ea6aa420 fix: remove_all_tools missing hosted tool types (#2885) 2026-04-16 04:49:08 +09:00
Abdulrahman Alfozan 2cef83b477 fix: sanitize OpenAI tracing export payloads (#2896)
### Summary

Updates the OpenAI tracing exporter to align usage metadata with the
trace ingest payload shape.

For the default OpenAI tracing endpoint, usage metadata is now only
included on generation spans, where it is normalized to the supported
token-count shape. Other tracing endpoints continue to receive the raw
SDK payload.

Adds regression coverage for OpenAI endpoint sanitization and custom
endpoint behavior.

### Test plan

- `make format`
- `make lint`
- `make sync && make typecheck`
- `uv run pytest
tests/test_openai_responses.py::test_get_response_span_exports_usage
tests/test_trace_processor.py` (46 passed)
- Manual tracing repro: `Runner.run(...)` completed, `flush_traces()`
completed, and no tracing client errors were emitted.
- `make tests` reached 3858 passed, 10 failed locally in sandbox tests
because `sandbox-exec` returned `sandbox_apply: Operation not
permitted`.

### Issue number

N/A

### Checks

- [x] I've added new tests (if relevant)
- [ ] I've added/updated the relevant documentation
- [x] I've run `make lint` and `make format`
- [ ] I've made sure tests pass
2026-04-15 12:19:30 -07:00
Kazuhiro Sera fa049a26fb fix: stop streamed tool execution after known input guardrail tripwire (#2688) 2026-04-16 03:50:01 +09:00
Kazuhiro Sera 901348023d fix: #2873 preserve computer driver compatibility for modifier keys (#2877) 2026-04-16 03:43:15 +09:00
Kazuhiro Sera 83b3833382 fix #2151 shield server-managed handoffs from unsupported history rewrites (#2747) 2026-04-16 03:17:00 +09:00
HuxleyHu98 bd871cddb2 docs: clarify ToolContext availability in function-tool lifecycle hooks (#2687) 2026-04-16 02:55:53 +09:00
Steve Coffey 2d665c9a67 Sandbox Agents (#2889)
### Sandbox Agents

This release adds **Sandbox Agents**, a beta SDK surface for running
agents with a persistent, isolated workspace. Sandbox agents keep the
normal `Agent` and `Runner` flow, but add workspace manifests,
sandbox-native capabilities, sandbox clients, snapshots, and resume
support so agents can work over real files, run commands, edit
repositories, generate artifacts, and continue work across runs.

Key pieces:

- `SandboxAgent`: an `Agent` with sandbox defaults such as
`default_manifest`, sandbox instructions, capabilities, and `run_as`.
- `Manifest`: a fresh-workspace contract for files, directories, local
files, local directories, Git repos, environment, users, groups, and
mounts.
- `SandboxRunConfig`: per-run sandbox wiring for client creation, live
session injection, serialized session resume, manifest overrides,
snapshots, and materialization concurrency limits.
- Built-in capabilities for shell access, filesystem editing and image
inspection, skills, memory, and compaction.
- Workspace snapshots and serialized sandbox session state for
reconnecting to existing work or seeding a fresh sandbox from saved
contents.

### Sandbox clients and hosted providers

Sandbox agents now support local, containerized, and hosted execution
backends:

- `UnixLocalSandboxClient` for fast local development.
- `DockerSandboxClient` for container isolation and image parity.
- Hosted sandbox clients for Blaxel, Cloudflare, Daytona, E2B, Modal,
Runloop, and Vercel through optional extras.

The release also adds provider-specific examples and mount strategies
for common storage backends, including S3, Cloudflare R2, Google Cloud
Storage, Azure Blob Storage, and S3 Files where supported by the
selected backend.

### Sandbox memory

Adds a sandbox memory capability that lets future sandbox-agent runs
learn from prior runs. Memory stores extracted lessons in the sandbox
workspace, injects a concise summary into later runs, and uses
progressive disclosure so agents can search deeper rollout summaries
only when useful.

Memory supports:

- Read-only or generate-only modes.
- Live updates when the agent discovers stale memory.
- Multi-turn grouping through `conversation_id`, SDK `Session`,
`RunConfig.group_id`, or generated run IDs.
- Separate memory layouts for isolating memory across agents or
workflows.
- S3-backed examples for persisted memory across runs.

### Workspace mounts, snapshots, and resume

This release adds a full workspace entry and mount model for sandbox
sessions:

- Local files and directories.
- Synthetic files and directories.
- Git repository entries.
- Remote storage mounts for S3, R2, GCS, Azure Blob Storage, and S3
Files.
- Provider-specific mount strategies across Docker, Modal, Cloudflare,
Blaxel, Daytona, E2B, and Runloop.
- Portable snapshots with path normalization, symlink preservation,
mount-safe snapshotting, and remote snapshot support.
- Resume paths through runner-managed `RunState`, explicit
`SandboxSessionState`, or saved snapshots.

### Examples and tutorials

Adds a large `examples/sandbox/` suite covering:

- Local Unix and Docker sandbox runners.
- Docker mount smoke tests for S3, GCS, Azure Blob Storage, and S3
Files.
- Sandbox coding tasks with skills.
- Sandbox agents as tools and handoff patterns.
- Memory examples, including multi-agent/multi-turn memory and S3-backed
memory.
- Tax-prep and healthcare-support workflows.
- Dataroom QA and metric extraction tutorials.
- Repository code review tutorial.
- Vision website clone tutorial.
- Provider examples for Blaxel, Cloudflare, Daytona, E2B, Modal,
Runloop, Temporal, and Vercel.

### Runtime, tracing, and model plumbing

The release includes the runtime plumbing needed to make sandbox agents
work naturally inside the existing SDK:

- Runner-managed sandbox preparation, capability binding, session
lifecycle, state serialization, and resume behavior.
- Sandbox-aware `RunState` serialization.
- Unified sandbox tracing with SDK spans.
- Token usage on tracing spans.
- Runner-managed prompt cache key defaults.
- OpenAI agent registration and harness ID configuration.
- Safer redaction of sensitive MCP tool outputs when sensitive tracing
is disabled.
- Additional OpenAI client/model utilities and Chat Completions
coverage.


## Documentation & Other Changes

- docs: add Asqav to external tracing processors list.
- docs: update translated document pages.

Co-authored-by: Abdulrahman Alfozan <alfozan@openai.com>
Co-authored-by: Aditya Singh <60082699+adityasingh2400@users.noreply.github.com>
Co-authored-by: Andi Liu <andi@openai.com>
Co-authored-by: Aron <263346377+aron-cf@users.noreply.github.com>
Co-authored-by: ashwinnathan-openai <ashwinnathan@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: cploujoux <cploujoux@blaxel.ai>
Co-authored-by: elainegan-openai <168589666+elainegan-openai@users.noreply.github.com>
Co-authored-by: Elias Freider <freider@users.noreply.github.com>
Co-authored-by: Erik Dunteman <erik@erikds-macbook-air.local>
Co-authored-by: Jason Liu <jasonliu@openai.com>
Co-authored-by: Jason Steving <32336750+jasonsteving99@users.noreply.github.com>
Co-authored-by: Kazuhiro Sera <seratch@openai.com>
Co-authored-by: Lovre Pešut <lovre.pesut@gmail.com>
Co-authored-by: Lucas Wang <lucas_wang@lucas-futures.com>
Co-authored-by: Matt Brockman <matt.brockman@e2b.dev>
Co-authored-by: Mish Ushakov <mishushakov@users.noreply.github.com>
Co-authored-by: Naresh <ghostwriternr@gmail.com>
Co-authored-by: nicholasclark-openai <nicholasclark@openai.com>
Co-authored-by: qiyaoq-oai <qiyaoq@openai.com>
Co-authored-by: Scott Trinh <scott@scotttrinh.com>
Co-authored-by: tode-rl <tony@runloop.ai>
Co-authored-by: Wendy Jiao <wendyjiao@openai.com>
2026-04-15 10:00:40 -07:00
Kazuhiro Sera 690079e2b9 fix: #2863 lazy-load SQLiteSession exports (#2864) 2026-04-09 12:13:48 +09:00
Kazuhiro Sera fb67680fae fix: #2856 stop recursive trace preview truncation (#2860) 2026-04-08 20:08:33 +09:00
Kazuhiro Sera c06cd45004 fix: harden SQLAlchemySession against transient SQLite locks (#2854) 2026-04-08 08:21:37 +09:00
Kazuhiro Sera 7a3f6b70d1 feat: #2135 add public flush_traces API (#2844) 2026-04-04 12:19:50 +09:00
Kazuhiro Sera 6a89f1b564 fix: serialize SQLite session writes with shared file locks (#2843) 2026-04-04 12:19:29 +09:00
祝子祺 fe9e70fd4d fix: #2823 AnyLLM reasoning extraction for iterable vLLM/any-llm Reasoning objects (#2822) 2026-04-02 14:50:28 +09:00
Kazuhiro Sera 976bccedc4 feat: #2807 support callable approval policies for local MCP servers (#2818) 2026-04-01 14:14:01 +09:00
Kazuhiro Sera 40aada1a8b fix: #2806 sanitize AnyLLM responses replay input before validation (#2813) 2026-03-31 19:35:22 +09:00
Kazuhiro Sera 9f5575ada4 fix: #2798 avoid stale hydrated input ids in server conversation tracker (#2800) 2026-03-28 11:06:03 +09:00
Kazuhiro Sera a7b4851e69 fix: #2797 accept raw image_url content parts on chat completions input (#2799) 2026-03-28 11:02:39 +09:00
Kazuhiro Sera c5e132142c fix: #2783 depend on griffelib directly for docstring parsing (#2791) 2026-03-27 08:18:04 +09:00
ふぁー c52d25f4f9 feat: #2785 add external_web_access to WebSearchTool (#2786) 2026-03-26 21:40:18 +09:00
Kazuhiro Sera c2f6690ff2 fix: #2776 keep private tool metadata out of persisted session items (#2781) 2026-03-26 20:09:37 +09:00
Kazuhiro Sera 9a96d9e787 fix: #2778 keep LiteLLM reasoning_effort portable across providers (#2782) 2026-03-26 15:05:22 +09:00
Kazuhiro Sera 8fdb45da69 fix: update default reasoning effort for newer models (#2773) 2026-03-25 22:10:15 +09:00
elainegan-openai 90884968b3 fix: optionize initialized notification tolerance (#2765) 2026-03-25 14:35:54 +09:00
elainegan-openai 687e974046 fix: handle cancelled single function tools as tool failures (#2762) 2026-03-25 14:17:20 +09:00
Kazuhiro Sera 1c0ff599c8 feat: add any-llm model support with responses-compatible routing (#2706) 2026-03-25 11:38:43 +09:00
Kazuhiro Sera 8e1915ef60 fix: preserve static MCP meta in converted function tools (#2769) 2026-03-25 09:23:26 +09:00
Kazuhiro Sera 0cc4805c00 fix: #2760 wait for realtime response.done before follow-up response.create (#2763) 2026-03-25 07:59:29 +09:00
kanchi 681320eeec fix: remove duplicate CompactionItem from RunItem union (#2761) 2026-03-24 07:30:43 +09:00
Kazuhiro Sera 58d3ed2303 fix: preserve streamed output guardrail tripwires in the run loop (#2758) 2026-03-23 13:08:19 +09:00
Joaquin Hui 49f593b575 fix: remove_all_tools missing MCP and reasoning item types (#2700) 2026-03-21 09:20:04 +09:00
Aditya Singh 1005106454 feat(mcp): expose list_resources, list_resource_templates, and read_resource on MCPServer (#2721) 2026-03-21 09:11:10 +09:00
Kazuhiro Sera 34ff8481bb feat: #2669 add opt-in reasoning content replay for chat completion models (#2670) 2026-03-20 16:20:36 +09:00