Commit Graph

10231 Commits

Author SHA1 Message Date
Michael Bolin
f6f8ada11b merge commit for archive created by Sapling 2026-03-26 21:20:04 -07:00
Michael Bolin
f9451bde24 codex-tools: extract dynamic tool adapters 2026-03-26 21:19:44 -07:00
Michael Bolin
41fe98b185 fix: increase timeout for rust-ci to 45 minutes for now (#15948)
https://github.com/openai/codex/pull/15478 raised the timeout to 35
minutes for `windows-arm64` only, though I just hit 35 minutes on
https://github.com/openai/codex/actions/runs/23628986591/job/68826740108?pr=15944,
so let's just increase it to 45 minutes. As noted, I'm hoping that we
can bring it back down once we no longer have two copies of the `tui`
crate.
2026-03-26 20:54:55 -07:00
Michael Bolin
e191d9e898 Merge 99fe9ab8e8 into sapling-pr-archive-bolinfest 2026-03-26 20:50:28 -07:00
Michael Bolin
99fe9ab8e8 fix: increase timeout for rust-ci to 45 minutes for now 2026-03-26 20:50:19 -07:00
Michael Bolin
5f06b045dc Merge 03f6dda330 into sapling-pr-archive-bolinfest 2026-03-26 19:59:07 -07:00
Michael Bolin
03f6dda330 codex-tools: extract dynamic tool adapters 2026-03-26 19:57:41 -07:00
Michael Bolin
be5afc65d3 codex-tools: extract MCP schema adapters (#15928)
## Why

`codex-tools` already owns the shared tool input schema model and parser
from the first extraction step, but `core/src/tools/spec.rs` still owned
the MCP-specific adapter that normalizes `rmcp::model::Tool` schemas and
wraps `structuredContent` into the call result output schema.

Keeping that adapter in `codex-core` means the reusable MCP schema path
is still split across crates, and the unit tests for that logic stay
anchored in `codex-core` even though the runtime orchestration does not
need to move yet.

This change takes the next small step by moving the reusable MCP schema
adapter into `codex-tools` while leaving `ResponsesApiTool` assembly in
`codex-core`.

## What changed

- added `tools/src/mcp_tool.rs` and sibling
`tools/src/mcp_tool_tests.rs`
- introduced `ParsedMcpTool`, `parse_mcp_tool()`, and
`mcp_call_tool_result_output_schema()` in `codex-tools`
- updated `core/src/tools/spec.rs` to consume parsed MCP tool parts from
`codex-tools`
- removed the now-redundant MCP schema unit tests from
`core/src/tools/spec_tests.rs`
- expanded `codex-rs/tools/README.md` to describe this second migration
step

## Test plan

- `cargo test -p codex-tools`
- `cargo test -p codex-core --lib tools::spec::`
2026-03-26 19:57:26 -07:00
Michael Bolin
12dac1c06c merge commit for archive created by Sapling 2026-03-26 19:43:54 -07:00
Michael Bolin
00a3cea3bb permissions: start using PermissionProfile as the canonical runtime model 2026-03-26 19:43:49 -07:00
Michael Bolin
384b0527ac merge commit for archive created by Sapling 2026-03-26 19:08:05 -07:00
Michael Bolin
82bebb3212 permissions: start using PermissionProfile as the canonical runtime model 2026-03-26 19:06:03 -07:00
Michael Bolin
d838c23867 fix: use matrix.target instead of matrix.os for actions/cache build action (#15933)
This seems like a more precise cache key.
2026-03-27 01:32:13 +00:00
Michael Bolin
d76124d656 fix: make MACOS_DEFAULT_PREFERENCES_POLICY part of MACOS_SEATBELT_BASE_POLICY (#15931) 2026-03-26 18:23:14 -07:00
Michael Bolin
758ffbd095 Merge 82f8680619 into sapling-pr-archive-bolinfest 2026-03-26 17:55:59 -07:00
Michael Bolin
82f8680619 permissions: start using PermissionProfile as the canonical runtime model 2026-03-26 17:55:53 -07:00
Michael Bolin
9698a8c553 Merge eb3dbd0a5f into sapling-pr-archive-bolinfest 2026-03-26 17:31:26 -07:00
Michael Bolin
eb3dbd0a5f fix: use matrix.target instead of matrix.os for actions/cache build action 2026-03-26 17:31:19 -07:00
viyatb-oai
81fa04783a feat(windows-sandbox): add network proxy support (#12220)
## Summary

This PR makes Windows sandbox proxying enforceable by routing proxy-only
runs through the existing `offline` sandbox user and reserving direct
network access for the existing `online` sandbox user.

In brief:

- if a Windows sandbox run should be proxy-enforced, we run it as the
`offline` user
- the `offline` user gets firewall rules that block direct outbound
traffic and only permit the configured localhost proxy path
- if a Windows sandbox run should have true direct network access, we
run it as the `online` user
- no new sandbox identity is introduced

This brings Windows in line with the intended model: proxy use is not
just env-based, it is backed by OS-level egress controls. Windows
already has two sandbox identities:

- `offline`: intended to have no direct network egress
- `online`: intended to have full network access

This PR makes proxy-enforced runs use that model directly.

### Proxy-enforced runs

When proxy enforcement is active:

- the run is assigned to the `offline` identity
- setup extracts the loopback proxy ports from the sandbox env
- Windows setup programs firewall rules for the `offline` user that:
  - block all non-loopback outbound traffic
  - block loopback UDP
  - block loopback TCP except for the configured proxy ports
- optionally allow broader localhost access when `allow_local_binding=1`

So the sandboxed process can only talk to the local proxy. It cannot
open direct outbound sockets or do local UDP-based DNS on its own.The
proxy then performs the real outbound network access outside that
restricted sandbox identity.

### Direct-network runs

When proxy enforcement is not active and full network access is allowed:

- the run is assigned to the `online` identity
- no proxy-only firewall restrictions are applied
- the process gets normal direct network access

### Unelevated vs elevated

The restricted-token / unelevated path cannot enforce per-identity
firewall policy by itself.

So for Windows proxy-enforced runs, we transparently use the logon-user
sandbox path under the hood, even if the caller started from the
unelevated mode. That keeps enforcement real instead of best-effort.

---------

Co-authored-by: Codex <noreply@openai.com>
2026-03-26 17:27:38 -07:00
Michael Bolin
da382a3297 Merge 0c3493cf3e into sapling-pr-archive-bolinfest 2026-03-26 17:22:01 -07:00
Michael Bolin
0c3493cf3e fix: make MACOS_DEFAULT_PREFERENCES_POLICY part of MACOS_SEATBELT_BASE_POLICY 2026-03-26 17:21:52 -07:00
Michael Bolin
4a9cff84a4 merge commit for archive created by Sapling 2026-03-26 17:15:26 -07:00
Michael Bolin
ffbbe793bc fix: make MACOS_DEFAULT_PREFERENCES_POLICY part of MACOS_SEATBELT_BASE_POLICY 2026-03-26 17:14:30 -07:00
Michael Bolin
e6e2999209 permissions: remove macOS seatbelt extension profiles (#15918)
## Why

`PermissionProfile` should only describe the per-command permissions we
still want to grant dynamically. Keeping
`MacOsSeatbeltProfileExtensions` in that surface forced extra macOS-only
approval, protocol, schema, and TUI branches for a capability we no
longer want to expose.

## What changed

- Removed the macOS-specific permission-profile types from
`codex-protocol`, the app-server v2 API, and the generated
schema/TypeScript artifacts.
- Deleted the core and sandboxing plumbing that threaded
`MacOsSeatbeltProfileExtensions` through execution requests and seatbelt
construction.
- Simplified macOS seatbelt generation so it always includes the fixed
read-only preferences allowlist instead of carrying a configurable
profile extension.
- Removed the macOS additional-permissions UI/docs/test coverage and
deleted the obsolete macOS permission modules.
- Tightened `request_permissions` intersection handling so explicitly
empty requested read lists are preserved only when that field was
actually granted, avoiding zero-grant responses being stored as active
permissions.
2026-03-26 17:12:45 -07:00
Michael Bolin
71934d3b15 Merge 2be6954608 into sapling-pr-archive-bolinfest 2026-03-26 17:08:41 -07:00
Michael Bolin
2be6954608 codex-tools: extract MCP schema adapters 2026-03-26 17:08:30 -07:00
Michael Bolin
44d28f500f codex-tools: extract shared tool schema parsing (#15923)
## Why

`parse_tool_input_schema` and the supporting `JsonSchema` model were
living in `core/src/tools/spec.rs`, but they already serve callers
outside `codex-core`.

Keeping that shared schema parsing logic inside `codex-core` makes the
crate boundary harder to reason about and works against the guidance in
`AGENTS.md` to avoid growing `codex-core` when reusable code can live
elsewhere.

This change takes the first extraction step by moving the schema parsing
primitive into its own crate while keeping the rest of the tool-spec
assembly in `codex-core`.

## What changed

- added a new `codex-tools` crate under `codex-rs/tools`
- moved the shared tool input schema model and sanitizer/parser into
`tools/src/json_schema.rs`
- kept `tools/src/lib.rs` exports-only, with the module-level unit tests
split into `json_schema_tests.rs`
- updated `codex-core` to use `codex-tools::JsonSchema` and re-export
`parse_tool_input_schema`
- updated `codex-app-server` dynamic tool validation to depend on
`codex-tools` directly instead of reaching through `codex-core`
- wired the new crate into the Cargo workspace and Bazel build graph
2026-03-27 00:03:35 +00:00
Son Luong Ngoc
a27cd2d281 bazel: re-organize bazelrc (#15522)
Replaced ci.bazelrc and v8-ci.bazelrc by custom configs inside the main
.bazelrc file. As a result, github workflows setup is simplified down to
a single '--config=<foo>' flag usage.

Moved the build metadata flags to config=ci.
Added custom tags metadata to help differentiate invocations based on
workflow (bazel vs v8) and os (linux/macos/windows).

Enabled users to override the default values in .bazelrc by using a
user.bazelrc file locally.
Added user.bazelrc to gitignore.
2026-03-26 16:50:07 -07:00
Michael Bolin
a5beab59bd Merge 46988862f3 into sapling-pr-archive-bolinfest 2026-03-26 16:41:23 -07:00
Michael Bolin
46988862f3 permissions: start using PermissionProfile as the canonical runtime model 2026-03-26 16:41:17 -07:00
Siggi Simonarson
c264c6eef9 Preserve bazel repository cache in github actions (#14495)
Highlights:

- Trimmed down to just the repository cache for faster upload / download
- Made the cache key only include files that affect external
dependencies (since that's what the repository cache caches) -
MODULE.bazel, codex-rs/Cargo.lock, codex-rs/Cargo.toml
- Split the caching action in to explicit restore / save steps (similar
to your rust CI) which allows us to skip uploads on cache hit, and not
fail the build if upload fails

This should get rid of 842 network fetches that are happening on every
Bazel CI run, while also reducing the Github flakiness @bolinfest
reported. Uploading should be faster (since we're not caching many small
files), and will only happen when MODULE.bazel or Cargo.lock /
Cargo.toml files change.

In my testing, it [took 3s to save the repository
cache](https://github.com/siggisim/codex/actions/runs/23014186143/job/66832859781).
2026-03-26 16:41:15 -07:00
Michael Bolin
33bbadaf52 merge commit for archive created by Sapling 2026-03-26 16:40:48 -07:00
Michael Bolin
7e471a93a4 permissions: start using PermissionProfile as the canonical runtime model 2026-03-26 16:40:34 -07:00
viyatb-oai
aea82c63ea fix(network-proxy): fail closed on network-proxy DNS lookup errors (#15909)
## Summary

Fail closed when the network proxy's local/private IP pre-check hits a
DNS lookup error or timeout, instead of treating the hostname as public
and allowing the request.

## Root cause

`host_resolves_to_non_public_ip()` returned `false` on resolver failure,
which created a fail-open path in the `allow_local_binding = false`
boundary. The eventual connect path performs its own DNS resolution
later, so a transient pre-check failure is not evidence that the
destination is public.

## Changes

- Treat DNS lookup errors/timeouts as local/private for blocking
purposes
- Add a regression test for an allowlisted hostname that fails DNS
resolution

## Validation

- `cargo test -p codex-network-proxy`
- `cargo clippy -p codex-network-proxy --all-targets -- -D warnings`
- `just fmt`
- `just argument-comment-lint`
2026-03-26 23:18:04 +00:00
Michael Bolin
0626eccf61 Merge a2c1f5d0df into sapling-pr-archive-bolinfest 2026-03-26 16:15:25 -07:00
Michael Bolin
a2c1f5d0df Extract tool schema parsing into codex-tools 2026-03-26 16:15:18 -07:00
Michael Bolin
d1fbfaa4f4 Merge 64d5689267 into sapling-pr-archive-bolinfest 2026-03-26 16:02:57 -07:00
Michael Bolin
64d5689267 permissions: remove macOS seatbelt extension profiles 2026-03-26 16:02:50 -07:00
Michael Bolin
65dc32d47d merge commit for archive created by Sapling 2026-03-26 16:00:32 -07:00
Michael Bolin
9dfeb92eed permissions: remove macOS seatbelt extension profiles 2026-03-26 16:00:02 -07:00
Michael Bolin
97e2e0ebcc Merge ec5a2d4892 into sapling-pr-archive-bolinfest 2026-03-26 15:58:30 -07:00
Michael Bolin
ec5a2d4892 Extract tool schema parsing into codex-tools 2026-03-26 15:58:15 -07:00
Michael Bolin
565f6d5b22 merge commit for archive created by Sapling 2026-03-26 15:57:02 -07:00
Michael Bolin
9a02418cb6 permissions: remove macOS seatbelt extension profiles 2026-03-26 15:56:45 -07:00
Michael Bolin
5763e48246 merge commit for archive created by Sapling 2026-03-26 15:41:55 -07:00
Michael Bolin
ab7ce315fb permissions: remove macOS seatbelt extension profiles 2026-03-26 15:40:36 -07:00
Michael Bolin
5906c6a658 chore: remove skill metadata from command approval payloads (#15906)
## Why

This is effectively a follow-up to
[#15812](https://github.com/openai/codex/pull/15812). That change
removed the special skill-script exec path, but `skill_metadata` was
still being threaded through command-approval payloads even though the
approval flow no longer uses it to render prompts or resolve decisions.

Keeping it around added extra protocol, schema, and client surface area
without changing behavior.

Removing it keeps the command-approval contract smaller and avoids
carrying a dead field through app-server, TUI, and MCP boundaries.

## What changed

- removed `ExecApprovalRequestSkillMetadata` and the corresponding
`skillMetadata` field from core approval events and the v2 app-server
protocol
- removed the generated JSON and TypeScript schema output for that field
- updated app-server, MCP server, TUI, and TUI app-server approval
plumbing to stop forwarding the field
- cleaned up tests that previously constructed or asserted
`skillMetadata`

## Testing

- `cargo test -p codex-app-server-protocol`
- `cargo test -p codex-protocol`
- `cargo test -p codex-app-server-test-client`
- `cargo test -p codex-mcp-server`
- `just argument-comment-lint`
2026-03-26 15:32:03 -07:00
Michael Bolin
4a82ab2446 Merge 9df4851671 into sapling-pr-archive-bolinfest 2026-03-26 15:21:59 -07:00
Michael Bolin
9df4851671 permissions: start using PermissionProfile as the canonical runtime model 2026-03-26 15:21:46 -07:00
viyatb-oai
b52abff279 chore: move bwrap config helpers into dedicated module (#15898)
## Summary
- move the bwrap PATH lookup and warning helpers out of config/mod.rs
- move the related tests into a dedicated bwrap_tests.rs file

## Validation
- git diff --check
- skipped heavier local tests per request

Follow-up to #15791.
2026-03-26 15:15:59 -07:00