Commit Graph

2466 Commits

Author SHA1 Message Date
Roy Han
16c700fd89 test cleanup 2026-03-25 14:51:20 -07:00
Ahmed Ibrahim
8181c362a7 Extract codex-core-skills crate (#15749)
- move skill loading and management into codex-core-skills
- leave codex-core with the thin integration layer and shared wiring

- CI

---------

Co-authored-by: Codex <noreply@openai.com>
2026-03-25 14:51:20 -07:00
Matthew Zeng
06d36e0c41 [apps][tool_suggest] Remove tool_suggest's dependency on tool search. (#14856)
- [x] Remove tool_suggest's dependency on tool search.
2026-03-25 14:50:53 -07:00
evawong-oai
f8105762b8 Clarify codex_home base for MDM path resolution (#15707)
## Summary

Add the follow up code comment Michael asked for at the MDM
`managed_config_from_mdm` - a follow up from
https://github.com/openai/codex/pull/15351.

## Validation

1. `cargo fmt --all --check`
2. `cargo test -p codex-core
managed_preferences_expand_home_directory_in_workspace_write_roots --
--nocapture`
3. `cargo test -p codex-core
write_value_succeeds_when_managed_preferences_expand_home_directory_paths
-- --nocapture`
4. `./tools/argument-comment-lint/run-prebuilt-linter.sh -p codex-core`
2026-03-25 14:50:53 -07:00
Ahmed Ibrahim
a4a7ab780d Extract codex-analytics crate (#15748)
- move the analytics events client into codex-analytics
- update codex-core and app-server callsites to use the new crate

- CI

---------

Co-authored-by: Codex <noreply@openai.com>
2026-03-25 14:50:53 -07:00
Ahmed Ibrahim
1aab7b00d4 Extract codex-plugin crate (#15747)
## Summary
- extract plugin identifiers and load-outcome types into codex-plugin
- update codex-core to consume the new plugin crate

## Testing
- CI

---------

Co-authored-by: Codex <noreply@openai.com>
2026-03-25 14:43:28 -07:00
Ahmed Ibrahim
d70638b23a Extract codex-utils-plugins crate (#15746)
## Summary
- extract shared plugin path and manifest helpers into
codex-utils-plugins
- update codex-core to consume the utility crate

## Testing
- CI

---------

Co-authored-by: Codex <noreply@openai.com>
2026-03-25 14:43:28 -07:00
Ahmed Ibrahim
f6c2f9d89f Extract codex-instructions crate (#15744)
## Summary
- extract instruction fragment and user-instruction types into
codex-instructions
- update codex-core to consume the new crate

## Testing
- CI

---------

Co-authored-by: Codex <noreply@openai.com>
2026-03-25 14:43:28 -07:00
jif-oai
2b0cb03172 chore: remove read_file handler (#15773)
Co-authored-by: Codex <noreply@openai.com>
2026-03-25 14:43:28 -07:00
pakrym-oai
a4568c7407 Use AbsolutePathBuf for cwd state (#15710)
Migrate `cwd` and related session/config state to `AbsolutePathBuf` so
downstream consumers consistently see absolute working directories.

Add test-only `.abs()` helpers for `Path`, `PathBuf`, and `TempDir`, and
update branch-local tests to use them instead of
`AbsolutePathBuf::try_from(...)`.

For the remaining TUI/app-server snapshot coverage that renders absolute
cwd values, keep the snapshots unchanged and skip the Windows-only cases
where the platform-specific absolute path layout differs.
2026-03-25 14:43:27 -07:00
jif-oai
1c8bd07c9c chore: remove grep_files handler (#15775)
# External (non-OpenAI) Pull Request Requirements

Before opening this Pull Request, please read the dedicated
"Contributing" markdown file or your PR may be closed:
https://github.com/openai/codex/blob/main/docs/contributing.md

If your PR conforms to our contribution guidelines, replace this text
with a detailed and high quality description of your changes.

Include a link to a bug report or enhancement request.

---------

Co-authored-by: Codex <noreply@openai.com>
2026-03-25 14:43:27 -07:00
Fouad Matin
1dc26021c8 fix(core): default approval behavior for mcp missing annotations (#15519)
- Changed `requires_mcp_tool_approval` to apply MCP spec defaults when
annotations are missing.
- Unannotated tools now default to:
  - `readOnlyHint = false`
  - `destructiveHint = true`
  - `openWorldHint = true`
- This means unannotated MCP tools now go through approval/ARC
monitoring instead of silently bypassing it.
- Explicitly read-only tools still skip approval unless they are also
explicitly marked destructive.

**Previous behavior**
Failed open for missing annotations, which was unsafe for custom MCP
tools that omitted or forgot annotations.

---------

Co-authored-by: colby-oai <228809017+colby-oai@users.noreply.github.com>
2026-03-25 14:43:27 -07:00
jif-oai
041747bad1 chore: tty metric (#15766) 2026-03-25 14:43:27 -07:00
Matthew Zeng
b78973026c [plugins] Add a flag for tool search. (#15722)
- [x] Add a flag for tool search.
2026-03-25 14:43:27 -07:00
viyatb-oai
3e8e9262b8 fix: support split carveouts in windows restricted-token sandbox (#14172)
## Summary
- keep legacy Windows restricted-token sandboxing as the supported
baseline
- support the split-policy subset that restricted-token can enforce
directly today
- support full-disk read, the same writable root set as legacy
`WorkspaceWrite`, and extra read-only carveouts under those writable
roots via additional deny-write ACLs
- continue to fail closed for unsupported split-only shapes, including
explicit unreadable (`none`) carveouts, reopened writable descendants
under read-only carveouts, and writable root sets that do not match the
legacy workspace roots

## Example
Given a filesystem policy like:

```toml
":root" = "read"
":cwd" = "write"
"./docs" = "read"
```

the restricted-token backend can keep the workspace writable while
denying writes under `docs` by layering an extra deny-write carveout on
top of the legacy workspace-write roots.

A policy like:

```toml
"/workspace" = "write"
"/workspace/docs" = "read"
"/workspace/docs/tmp" = "write"
```

still fails closed, because the unelevated backend cannot reopen the
nested writable descendant safely.

## Stack
-> fix: support split carveouts in windows restricted-token sandbox
#14172
fix: support split carveouts in windows elevated sandbox #14568
2026-03-25 14:43:27 -07:00
Matthew Zeng
9f0fc103c7 [plugins] Flip on additional flags. (#15719)
- [x] Flip on additional flags.
2026-03-25 14:43:27 -07:00
Matthew Zeng
b160ef6b12 [plugins] Flip the flags. (#15713)
- [x] Flip the `plugins` and `apps` flags.
2026-03-25 14:43:27 -07:00
Charley Cunningham
d2e6c0f84b [codex] Defer fork context injection until first turn (#15699)
## Summary
- remove the fork-startup `build_initial_context` injection
- keep the reconstructed `reference_context_item` as the fork baseline
until the first real turn
- update fork-history tests and the request snapshot, and add a
`TODO(ccunningham)` for remaining nondiffable initial-context inputs

## Why
Fork startup was appending current-session initial context immediately
after reconstructing the parent rollout, then the first real turn could
emit context updates again. That duplicated model-visible context in the
child rollout.

## Impact
Forked sessions now behave like resume for context seeding: startup
reconstructs history and preserves the prior baseline, and the first
real turn handles any current-session context emission.

---------

Co-authored-by: Codex <noreply@openai.com>
2026-03-25 14:43:26 -07:00
Ahmed Ibrahim
0e90b07b71 Extract rollout into its own crate (#15548) 2026-03-25 14:43:26 -07:00
evawong-oai
148f89e786 Expand ~ in MDM workspace write roots (#15351)
## Summary
- Reuse the existing config path resolver for the macOS MDM managed
preferences layer so `writable_roots = ["~/code"]` expands the same way
as file-backed config
- keep the change scoped to the MDM branch in `config_loader`; the
current net diff is only `config_loader/mod.rs` plus focused regression
tests in `config_loader/tests.rs` and `config/service_tests.rs`
- research note: `resolve_relative_paths_in_config_toml(...)` is already
used in several existing configuration paths, including [CLI
overrides](74fda242d3/codex-rs/core/src/config_loader/mod.rs (L152-L163)),
[file-backed managed
config](74fda242d3/codex-rs/core/src/config_loader/mod.rs (L274-L285)),
[normal config-file
loading](74fda242d3/codex-rs/core/src/config_loader/mod.rs (L311-L331)),
[project `.codex/config.toml`
loading](74fda242d3/codex-rs/core/src/config_loader/mod.rs (L863-L865)),
and [role config
loading](74fda242d3/codex-rs/core/src/agent/role.rs (L105-L109))

## Validation
- `cargo fmt --all --check`
- `cargo test -p codex-core
managed_preferences_expand_home_directory_in_workspace_write_roots --
--nocapture`
- `cargo test -p codex-core
write_value_succeeds_when_managed_preferences_expand_home_directory_paths
-- --nocapture`

---------

Co-authored-by: Michael Bolin <mbolin@openai.com>
Co-authored-by: Michael Bolin <bolinfest@gmail.com>
2026-03-25 14:43:26 -07:00
Michael Bolin
0fd54eb9c2 fix: keep rmcp-client env vars as OsString (#15363)
## Why

This is a follow-up to #15360. That change fixed the `arg0` helper
setup, but `rmcp-client` still coerced stdio transport environment
values into UTF-8 `String`s before program resolution and process spawn.
If `PATH` or another inherited environment value contains non-UTF-8
bytes, that loses fidelity before it reaches `which` and `Command`.

## What changed

- change `create_env_for_mcp_server()` to return `HashMap<OsString,
OsString>` and read inherited values with `std::env::var_os()`
- change `TransportRecipe::Stdio.env`, `RmcpClient::new_stdio_client()`,
and `program_resolver::resolve()` to keep stdio transport env values in
`OsString` form within `rmcp-client`
- keep the `codex-core` config boundary stringly, but convert configured
stdio env values to `OsString` once when constructing the transport
- update the rmcp-client stdio test fixtures and callers to use
`OsString` env maps
- add a Unix regression test that verifies `create_env_for_mcp_server()`
preserves a non-UTF-8 `PATH`

## How to verify

- `cargo test -p codex-rmcp-client`
- `cargo test -p codex-core mcp_connection_manager`
- `just argument-comment-lint`

Targeted coverage in this change includes
`utils::tests::create_env_preserves_path_when_it_is_not_utf8`, while the
updated stdio transport path is exercised by the existing rmcp-client
tests that construct `RmcpClient::new_stdio_client()`.
2026-03-25 14:43:26 -07:00
Ahmed Ibrahim
dcc60acecd Move string truncation helpers into codex-utils-string (#15572)
- move the shared byte-based middle truncation logic from `core` into
`codex-utils-string`
- keep token-specific truncation in `codex-core` so rollout can reuse
the shared helper in the next stacked PR

---------

Co-authored-by: Codex <noreply@openai.com>
2026-03-25 14:43:25 -07:00
pakrym-oai
217fb389f6 Drop sandbox_permissions from sandbox exec requests (#15665)
## Summary
- drop `sandbox_permissions` from the sandboxing `ExecOptions` and
`ExecRequest` adapter types
- remove the now-unused plumbing from shell, unified exec, JS REPL, and
apply-patch runtime call sites
- default reconstructed `ExecParams` to `SandboxPermissions::UseDefault`
where the lower-level API still requires the field

## Testing
- `just fmt`
- `just argument-comment-lint`
- `cargo test -p codex-core` (still running locally; first failures
observed in `suite::cli_stream::responses_mode_stream_cli`,
`suite::cli_stream::responses_mode_stream_cli_supports_openai_base_url_config_override`,
and
`suite::cli_stream::responses_mode_stream_cli_supports_openai_base_url_env_fallback`)
2026-03-25 14:43:25 -07:00
Roy Han
de1d5cc9ba test fix 2026-03-25 14:43:25 -07:00
Roy Han
08a8c84453 event rename and resume support 2026-03-25 14:43:13 -07:00
Roy Han
7eebd0281f rebase 2026-03-25 14:29:02 -07:00
Roy Han
0c4e73618a test bug 2026-03-25 14:28:53 -07:00
Roy Han
505e703c32 restructure history and source 2026-03-25 14:28:48 -07:00
Matthew Zeng
cfc78edb6e [plugins] Additional gating for tool suggest and apps. (#15573)
- [x] Additional gating for tool suggest and apps.
2026-03-25 14:25:20 -07:00
Roy Han
3a2d6eac2f rebase 2026-03-25 14:22:21 -07:00
rhan-oai
f10cf5c9fa Merge branch 'rhan/oob-turn-metadata' into rhan/oob-queue 2026-03-25 13:52:56 -07:00
Roy Han
c36438ca59 is first turn 2026-03-25 12:06:07 -07:00
Roy Han
3766590bee stale test 2026-03-24 18:28:46 -07:00
Roy Han
1d5408dd40 fmt 2026-03-24 17:47:38 -07:00
Roy Han
ade9c6fc5b logic cleanup 2026-03-24 17:35:46 -07:00
Roy Han
7f10658d93 steer cleanup 2026-03-24 17:31:59 -07:00
Roy Han
ae06d729fa remove turn event type 2026-03-24 17:31:17 -07:00
Roy Han
b8a6b03e31 protocol rename 2026-03-24 17:31:17 -07:00
Roy Han
cad23c805a renaming 2026-03-24 17:31:17 -07:00
Roy Han
5fefa5e9dc update schema 2026-03-24 17:30:24 -07:00
Roy Han
694ff84ec1 event definitions 2026-03-24 17:28:06 -07:00
Roy Han
8a6be13ae6 define events and support queueing 2026-03-24 17:26:15 -07:00
Roy Han
07c0d34fa4 user message metadata 2026-03-24 17:24:50 -07:00
Roy Han
7141347e82 variant tightening 2026-03-24 15:58:09 -07:00
Roy Han
039a64053c Revert "rebase"
This reverts commit 9ad5c1386f, reversing
changes made to 4b9e6f4383.
2026-03-24 15:21:52 -07:00
Roy Han
9ad5c1386f rebase 2026-03-24 15:16:50 -07:00
Roy Han
4b9e6f4383 clear churn 2026-03-24 15:12:14 -07:00
Roy Han
086e3dcc50 steer cleanup 2026-03-24 14:56:59 -07:00
Roy Han
903559bd60 remove turn event type 2026-03-24 14:47:27 -07:00
Roy Han
5d7f0e0c83 protocol rename 2026-03-24 14:42:53 -07:00