Commit Graph
10470 Commits
Author SHA1 Message Date
Dylan Hurd 0d9bb8ea58 chore(context) Include guardian approval context (#15366)
## Summary
Include the guardian context in the developer message for approvals

## Testing
- [x] Updated unit tests
2026-03-21 16:31:22 +00:00
Matthew Zeng 06e06ab173 [plugins] Fix plugin explicit mention context management. (#15372)
- [x] Fix plugin explicit mention context management.
2026-03-21 00:29:29 -07:00
Channing CongerandCodex e4eedd6170 Code mode on v8 (#15276)
Moves Code Mode to a new crate with no dependencies on codex. This
create encodes the code mode semantics that we want for lifetime,
mounting, tool calling.

The model-facing surface is mostly unchanged. `exec` still runs raw
JavaScript, `wait` still resumes or terminates a `cell_id`, nested tools
are still available through `tools.*`, and helpers like `text`, `image`,
`store`, `load`, `notify`, `yield_control`, and `exit` still exist.

The major change is underneath that surface:

- Old code mode was an external Node runtime.
- New code mode is an in-process V8 runtime embedded directly in Rust.
- Old code mode managed cells inside a long-lived Node runner process.
- New code mode manages cells in Rust, with one V8 runtime thread per
active `exec`.
- Old code mode used JSON protocol messages over child stdin/stdout plus
Node worker-thread messages.
- New code mode uses Rust channels and direct V8 callbacks/events.

This PR also fixes the two migration regressions that fell out of that
substrate change:

- `wait { terminate: true }` now waits for the V8 runtime to actually
stop before reporting termination.
- synchronous top-level `exit()` now succeeds again instead of surfacing
as a script error.

---

- `core/src/tools/code_mode/*` is now mostly an adapter layer for the
public `exec` / `wait` tools.
- `code-mode/src/service.rs` owns cell sessions and async control flow
in Rust.
- `code-mode/src/runtime/*.rs` owns the embedded V8 isolate and
JavaScript execution.
- each `exec` spawns a dedicated runtime thread plus a Rust
session-control task.
- helper globals are installed directly into the V8 context instead of
being injected through a source prelude.
- helper modules like `tools.js` and `@openai/code_mode` are synthesized
through V8 module resolution callbacks in Rust.

---

Also added a benchmark for showing the speed of init and use of a code
mode env:
```
$ cargo bench -p codex-code-mode --bench exec_overhead -- --samples 30 --warm-iterations 25 --tool-counts 0,32,128
Finished [`bench` profile [optimized]](https://doc.rust-lang.org/cargo/reference/profiles.html#default-profiles) target(s) in 0.18s
     Running benches/exec_overhead.rs (target/release/deps/exec_overhead-008c440d800545ae)
exec_overhead: samples=30, warm_iterations=25, tool_counts=[0, 32, 128]
scenario       tools samples    warmups      iters      mean/exec       p95/exec       rssΔ p50       rssΔ max
cold_exec          0      30          0          1         1.13ms         1.20ms        8.05MiB        8.06MiB
warm_exec          0      30          1         25       473.43us       512.49us      912.00KiB        1.33MiB
cold_exec         32      30          0          1         1.03ms         1.15ms        8.08MiB        8.11MiB
warm_exec         32      30          1         25       509.73us       545.76us      960.00KiB        1.30MiB
cold_exec        128      30          0          1         1.14ms         1.19ms        8.30MiB        8.34MiB
warm_exec        128      30          1         25       575.08us       591.03us      736.00KiB      864.00KiB
memory uses a fresh-process max RSS delta for each scenario
```

---------

Co-authored-by: Codex <noreply@openai.com>
2026-03-20 23:36:58 -07:00
alexsong-oai ec32866c37 Pass platform param to featured plugins (#15348) 2026-03-21 01:42:40 +00:00
Dylan Hurd 60c59a7799 fix(core) disable command_might_be_dangerous when unsandboxed (#15036)
## Summary
If we are in a mode that is already explicitly un-sandboxed, then
`ApprovalPolicy::Never` should not block dangerous commands.

## Testing
- [x] Existing unit test covers old behavior
- [x] Added a unit test for this new case
2026-03-21 01:28:25 +00:00
Michael Bolin c8d2f05280 Merge 01e0584979 into sapling-pr-archive-bolinfest 2026-03-20 17:31:57 -07:00
Michael Bolin 01e0584979 fix: make more PATH reads OsString-aware 2026-03-20 17:31:47 -07:00
Michael Bolin 929bb1c472 Merge 3c64919a84 into sapling-pr-archive-bolinfest 2026-03-20 17:08:47 -07:00
Michael Bolin 13c0e31f48 Merge a73d681558 into sapling-pr-archive-bolinfest 2026-03-20 17:05:33 -07:00
Michael Bolin a73d681558 fix: build env var using OsString instead of String 2026-03-20 17:05:24 -07:00
Michael Bolin 3c64919a84 chore: refresh argument-comment-lint prebuilt wrapper 2026-03-20 16:21:10 -07:00
Michael Bolin f123384bdb merge commit for archive created by Sapling 2026-03-20 16:04:50 -07:00
Michael Bolin 2c95049a0f fix: fall back to vendored bubblewrap when system bwrap lacks --argv0 2026-03-20 16:03:28 -07:00
Dylan Hurd 7754dd1b89 chore(core) update prefix_rule guidance (#15231)
## Summary
Small tweaks to the prefix_rule guidance.

## Testing
- [x] in progress
2026-03-20 15:57:06 -07:00
Celia Chen 9eef2e91fc fix: allow restricted filesystem profiles to read helper executables (#15114)
## Summary

This PR fixes restricted filesystem permission profiles so Codex's
runtime-managed helper executables remain readable without requiring
explicit user configuration.

- add implicit readable roots for the configured `zsh` helper path and
the main execve wrapper
- allowlist the shared `$CODEX_HOME/tmp/arg0` root when the execve
wrapper lives there, so session-specific helper paths keep working
- dedupe injected paths and avoid adding duplicate read entries to the
sandbox policy
- add regression coverage for restricted read mode with helper
executable overrides

## Testing 
before this change: got this error when executing a shell command via
zsh fork:
```
"sandbox error: sandbox denied exec error, exit code: 127, stdout: , stderr: /etc/zprofile:11: operation not permitted: /usr/libexec/path_helper\nzsh:1: operation not permitted: .codex/skills/proxy-a/scripts/fetch_example.sh\n"
```

saw this change went away after this change, meaning the readable roots
and injected correctly.
2026-03-20 15:51:06 -07:00
canvrno-oai 10a936d127 Gate tui /plugins menu behind flag (#15285)
Gate /plugins menu behind `--enable plugins` flag
2026-03-20 15:49:04 -07:00
Michael Bolin 0a060b7700 Merge 3aaee0f061 into sapling-pr-archive-bolinfest 2026-03-20 15:32:59 -07:00
Michael Bolin 3aaee0f061 core: add stdin-backed sandboxed fs writes 2026-03-20 15:32:27 -07:00
Michael Bolin 86d00c0236 core: route view_image through a sandbox-backed fs helper 2026-03-20 15:32:26 -07:00
Ahmed IbrahimandCodex 3431f01776 Add realtime transcript notification in v2 (#15344)
- emit a typed `thread/realtime/transcriptUpdated` notification from
live realtime transcript deltas
- expose that notification as flat `threadId`, `role`, and `text` fields
instead of a nested transcript array
- continue forwarding raw `handoff_request` items on
`thread/realtime/itemAdded`, including the accumulated
`active_transcript`
- update app-server docs, tests, and generated protocol schema artifacts
to match the delta-based payloads

---------

Co-authored-by: Codex <noreply@openai.com>
2026-03-20 15:30:48 -07:00
Michael Bolin f31d388ac0 core: add a sandbox-backed fs helper 2026-03-20 15:19:33 -07:00
Dylan Hurd ea8b07e680 chore(core) Remove Feature::PowershellUtf8 (#15128)
## Summary
This feature has been enabled for powershell for a while now, let's get
rid of the logic

## Testing
- [x] Unit tests
2026-03-20 22:03:31 +00:00
Michael Bolin 998debbed5 merge commit for archive created by Sapling 2026-03-20 14:45:37 -07:00
Michael Bolin cd5d5077c9 fix: fall back to vendored bubblewrap when system bwrap lacks --argv0 2026-03-20 14:45:17 -07:00
Matthew Zeng dd88ed767b [apps] Use ARC for yolo mode. (#15273)
- [x] Use ARC for yolo mode.
2026-03-20 21:13:20 +00:00
Michael Bolin a7bb009653 Merge 75f47a060e into sapling-pr-archive-bolinfest 2026-03-20 13:03:19 -07:00
Michael Bolin 75f47a060e fix: fall back to vendored bubblewrap when system bwrap lacks --argv0 2026-03-20 13:03:11 -07:00
Michael Bolin 343bfe6eb3 merge commit for archive created by Sapling 2026-03-20 12:35:58 -07:00
Michael Bolin 708d86ba9e fix: fall back to vendored bubblewrap when system bwrap lacks --argv0 2026-03-20 12:35:45 -07:00
Channing Conger 1350477150 Add v8-poc consumer of our new built v8 (#15203)
This adds a dummy v8-poc project that in Cargo links against our
prebuilt binaries and the ones provided by rusty_v8 for non musl
platforms. This demonstrates that we can successfully link and use v8 on
all platforms that we want to target.

In bazel things are slightly more complicated. Since the libraries as
published have libc++ linked in already we end up with a lot of double
linked symbols if we try to use them in bazel land. Instead we fall back
to building rusty_v8 and v8 from source (cached of course) on the
platforms we ship to.

There is likely some compatibility drift in the windows bazel builder
that we'll need to reconcile before we can re-enable them. I'm happy to
be on the hook to unwind that.
2026-03-20 12:08:25 -07:00
Michael Bolin b71c13ebf0 merge commit for archive created by Sapling 2026-03-20 12:03:01 -07:00
Michael Bolin d90caa52a9 fix: fall back to vendored bubblewrap when system bwrap lacks --argv0 2026-03-20 12:02:45 -07:00
Channing Conger a941d8439d Bump aws-lc-rs (#15337)
Bump our dep.

RUSTSEC-2026-0048
Advisory: https://rustsec.org/advisories/RUSTSEC-2026-0048
2026-03-20 18:59:13 +00:00
Michael Bolin fabfdff909 Merge e1b1e33021 into sapling-pr-archive-bolinfest 2026-03-20 11:57:52 -07:00
Michael Bolin e1b1e33021 fix: fall back to vendored bubblewrap when system bwrap lacks --argv0 2026-03-20 11:57:38 -07:00
Shaqayeq 9e31aeadce Pin Python SDK app-server stdio to UTF-8 on Windows (#15244)
## TL;DR
Pin the Python app-server SDK subprocess pipes to UTF-8 so Windows users
on non-UTF-8 locales do not hit `UnicodeDecodeError` when the `codex`
child emits UTF-8 text.

- add `encoding="utf-8"` to the `subprocess.Popen(...)` call in
`AppServerClient.start()`
- add a focused regression test that asserts the client launches the
subprocess with UTF-8 text I/O
- validates with `python -m pytest
sdk/python/tests/test_client_rpc_methods.py
sdk/python/tests/test_client_process_launch.py
sdk/python/tests/test_public_api_runtime_behavior.py`

Fixes #14311.
2026-03-20 18:26:24 +00:00
jif-oai 79ad7b247b feat: change multi-agent to use path-like system instead of uuids (#15313)
This PR add an URI-based system to reference agents within a tree. This
comes from a sync between research and engineering.

The main agent (the one manually spawned by a user) is always called
`/root`. Any sub-agent spawned by it will be `/root/agent_1` for example
where `agent_1` is chosen by the model.

Any agent can contact any agents using the path.

Paths can be used either in absolute or relative to the calling agents

Resume is not supported for now on this new path
2026-03-20 18:23:48 +00:00
Michael Bolin 553449b2df merge commit for archive created by Sapling 2026-03-20 10:58:15 -07:00
Michael Bolin c59669d603 fix: flip use_legacy_landlock feature so it defaults to true again 2026-03-20 10:57:59 -07:00
pakrym-oai 4ddde54c19 Add remote test skill (#15324)
Teach codex to run remote tests.
2026-03-20 10:37:57 -07:00
jif-oai b9fa08ec61 try to fix bazel (#15328)
Fix Bazel macOS CI failures caused by the llvm module's pinned macOS SDK
URL returning 403 Forbidden from Apple's CDN.

Bump llvm to 0.6.8, switch to the new osx.from_archive(...) /
osx.frameworks(...) API, and refresh MODULE.bazel.lock so Bazel uses the
updated SDK archive configuration.
2026-03-20 10:18:19 -07:00
Eric Traut 4f28b64abc Add temporary app-server originator fallback for codex-tui (#15218)
## Summary
- make app-server treat `clientInfo.name == "codex-tui"` as a legacy
compatibility case
- fall back to `DEFAULT_ORIGINATOR` instead of sending `codex-tui` as
the originator header
- add a TODO noting this is a temporary workaround that should be
removed later

## Testing
- Not run (not requested)
2026-03-20 10:51:21 -06:00
pakrym-oai ba85a58039 Add remote env CI matrix and integration test (#14869)
`CODEX_TEST_REMOTE_ENV` will make `test_codex` start the executor
"remotely" (inside a docker container) turning any integration test into
remote test.
2026-03-20 08:02:50 -07:00
xl-openai e5f4d1fef5 feat: prefer git for curated plugin sync (#15275)
start with git clone, fallback to http.
2026-03-20 00:06:24 -07:00
Michael Bolin a224097924 merge commit for archive created by Sapling 2026-03-19 23:45:09 -07:00
Michael Bolin 65dfa94c29 core: add stdin-backed sandboxed fs writes 2026-03-19 23:44:57 -07:00
Michael Bolin 16588ffc6d core: route view_image through a sandbox-backed fs helper 2026-03-19 23:44:57 -07:00
Michael Bolin 29633f0578 core: add a sandbox-backed fs helper 2026-03-19 23:44:56 -07:00
Michael Bolin f71639542e merge commit for archive created by Sapling 2026-03-19 23:38:47 -07:00
Michael Bolin 7aca0d8e9e core: route view_image through a sandbox-backed fs helper 2026-03-19 23:34:23 -07:00