Commit Graph
12249 Commits
Author SHA1 Message Date
Michael Bolin bb8f4b8bf3 sandboxing: intersect permission profiles semantically 2026-04-20 20:12:47 -07:00
Matthew Zeng 1132ef887c Make MCP resource read threadless (#18292)
## Summary

Making thread id optional so that we can better cache resources for MCPs
for connectors since their resource templates is universal and not
particular to projects.

- Make `mcpServer/resource/read` accept an optional `threadId`
- Read resources from the current MCP config when no thread is supplied
- Keep the existing thread-scoped path when `threadId` is present
- Update the generated schemas, README, and integration coverage

## Testing
- `just write-app-server-schema`
- `just fmt`
- `cargo test -p codex-app-server-protocol`
- `cargo test -p codex-mcp`
- `cargo test -p codex-app-server --test all mcp_resource`
- `just fix -p codex-mcp`
- `just fix -p codex-app-server-protocol`
- `just fix -p codex-app-server`
2026-04-20 19:59:36 -07:00
Dylan Hurd 58e7605efc fix(guardian) Dont hard error on feature disable (#18795)
## Summary 
This shouldn't error for now

## Test plan
- [x] Updated unit test
2026-04-20 19:54:39 -07:00
Michael Bolin 7c4e862d2c Merge d9b343612d into sapling-pr-archive-bolinfest 2026-04-20 19:45:06 -07:00
Michael Bolin d9b343612d tests: isolate approval fixtures from host rules 2026-04-20 19:42:55 -07:00
Michael Bolin 0f8b8aed8e shell-escalation: carry resolved permission profiles 2026-04-20 19:42:55 -07:00
Michael Bolin 71636e4ea7 mcp: include permission profiles in sandbox state 2026-04-20 19:42:55 -07:00
Michael Bolin 2f70f509b5 tui: carry permission profiles on user turns 2026-04-20 19:42:55 -07:00
Michael Bolin 6d8ce0b430 tui: sync session permission profiles 2026-04-20 19:42:55 -07:00
Michael Bolin 4937fa7d26 app-server: accept command permission profiles 2026-04-20 19:42:55 -07:00
Michael Bolin eb2cbf577f protocol: report session permission profiles 2026-04-20 19:42:55 -07:00
Michael Bolin 299778060d rollout: persist turn permission profiles 2026-04-20 19:42:55 -07:00
Michael Bolin fac89b19c7 clients: send permission profiles to app-server 2026-04-20 19:42:55 -07:00
Michael Bolin 68b5f9d41f app-server: accept permission profile overrides 2026-04-20 19:42:55 -07:00
Michael Bolin 47010046fd app-server: expose thread permission profiles 2026-04-20 19:42:55 -07:00
Michael Bolin 31d1b49a15 core: derive active permission profiles 2026-04-20 19:42:55 -07:00
Michael Bolin 26a7cc7ea6 exec-server: carry filesystem sandbox profiles 2026-04-20 19:42:55 -07:00
Michael Bolin 8aa3a11ada sandboxing: intersect permission profiles semantically 2026-04-20 19:42:55 -07:00
Michael Bolin 3d2f123895 protocol: preserve glob scan depth in permission profiles (#18713)
## Why

#18274 made `PermissionProfile` the canonical file-system permissions
shape, but the round-trip from `FileSystemSandboxPolicy` to
`PermissionProfile` still dropped one piece of policy metadata:
`glob_scan_max_depth`.

That field is security-relevant for deny-read globs such as `**/*.env`.
On Linux, bubblewrap sandbox construction uses it to bound unreadable
glob expansion. If a profile copied from active runtime permissions
loses this value and is submitted back as an override, the resulting
`FileSystemSandboxPolicy` can behave differently even though the visible
permission entries look equivalent.

## What changed

- Add `glob_scan_max_depth` to protocol `FileSystemPermissions` and
preserve it when converting to/from `FileSystemSandboxPolicy`.
- Keep legacy `read`/`write` JSON for simple path-only permissions, but
force canonical JSON when glob scan depth is present so the metadata is
not silently dropped.
- Carry `globScanMaxDepth` through app-server
`AdditionalFileSystemPermissions`, generated JSON/TypeScript schemas,
and app-server/TUI conversion call sites.
- Preserve the metadata through sandboxing permission normalization,
merging, and intersection.
- Carry the merged scan depth into the effective
`FileSystemSandboxPolicy` used for command execution, so bounded
deny-read globs reach Linux bubblewrap materialization.

## Verification

- `cargo test -p codex-sandboxing glob_scan -- --nocapture`
- `cargo test -p codex-sandboxing policy_transforms -- --nocapture`
- `just fix -p codex-sandboxing`





---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/18713).
* #18288
* #18287
* #18286
* #18285
* #18284
* #18283
* #18282
* #18281
* #18280
* #18279
* #18278
* #18277
* #18276
* #18275
* __->__ #18713
2026-04-20 19:42:45 -07:00
xl-openai 6e9e2c2eef feat: Support more plugin MCP file shapes. (#18780)
Update core-plugins MCP loading to accept either an mcpServers object or
a top-level server map in .mcp.json
2026-04-20 19:42:01 -07:00
Michael Bolin 97745db729 Merge 86529cae16 into sapling-pr-archive-bolinfest 2026-04-20 19:31:10 -07:00
Michael Bolin 86529cae16 chore: enable await-holding clippy lints
Follow-up to https://github.com/openai/codex/pull/18178, where we said the await-holding clippy rule would be enabled separately.

Enable `await_holding_lock` and `await_holding_invalid_type` after the preceding commits fixed or explicitly documented the current offenders.
2026-04-20 19:30:59 -07:00
Michael Bolin 48830448e9 chore: document intentional await-holding cases 2026-04-20 19:30:59 -07:00
Michael Bolin b8fa5e7789 Merge 2a33df043c into sapling-pr-archive-bolinfest 2026-04-20 19:24:34 -07:00
Michael Bolin 2a33df043c chore: enable await-holding clippy lints
Follow-up to https://github.com/openai/codex/pull/18178, where we said the await-holding clippy rule would be enabled separately.

Enable `await_holding_lock` and `await_holding_invalid_type` after the preceding commits fixed or explicitly documented the current offenders.
2026-04-20 19:24:26 -07:00
Michael Bolin aca6ccc4ee chore: document intentional await-holding cases 2026-04-20 19:24:25 -07:00
Michael Bolin ff05532723 refactor: narrow async lock scopes (#18418)
## Why

This is part of the follow-up work from #18178 to make Codex ready for
Clippy's
[`await_holding_lock`](https://rust-lang.github.io/rust-clippy/master/index.html#await_holding_lock)
/
[`await_holding_invalid_type`](https://rust-lang.github.io/rust-clippy/master/index.html#await_holding_invalid_type)
lints.

This bottom PR keeps the scope intentionally small:
`NetworkProxyState::record_blocked()` only needs the state write lock
while it mutates the blocked-request ring buffer and counters. The debug
log payload and `BlockedRequestObserver` callback can be produced after
that lock is released.

## What changed

- Copies the blocked-request snapshot values needed for logging while
updating the state.
- Releases the `RwLockWriteGuard` before logging or notifying the
observer.

## Verification

- `cargo test -p codex-network-proxy`


---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/18418).
* #18698
* #18423
* __->__ #18418
2026-04-21 02:23:30 +00:00
Ahmed IbrahimandCodex d6af7a6c03 [1/4] Add executor HTTP request protocol (#18581)
### Why
Remote streamable HTTP MCP needs a transport-shaped executor primitive
before the MCP client can move network I/O to the executor. This layer
keeps the executor unaware of MCP and gives later PRs an ordered
streaming surface for response bodies.

### What
- Add typed `http/request` and `http/request/bodyDelta` protocol
payloads.
- Add executor client helpers for buffered and streamed HTTP responses.
- Route body-delta notifications to request-scoped streams with sequence
validation and cleanup when a stream finishes or is dropped.
- Document the new protocol constants, transport structs, public client
methods, body-stream lifecycle, and request-scoped routing helpers.
- Add in-memory JSON-RPC client coverage for streamed HTTP response-body
notifications, with comments spelling out what the test proves and each
setup/exercise/assert phase.

### Stack
1. #18581 protocol
2. #18582 runner
3. #18583 RMCP client
4. #18584 manager wiring and local/remote coverage

### Verification
- `just fmt`
- `cargo check -p codex-exec-server -p codex-rmcp-client --tests`
- `cargo check -p codex-core --test all` compile-only
- `git diff --check`
- Online full CI is running from the `full-ci` branch, including the
remote Rust test job.

Co-authored-by: Codex <noreply@openai.com>

---------

Co-authored-by: Codex <noreply@openai.com>
2026-04-21 02:21:08 +00:00
Michael Bolin 1a8cf4dca5 Merge 80d50c7a32 into sapling-pr-archive-bolinfest 2026-04-20 19:03:18 -07:00
Michael Bolin 80d50c7a32 chore: document intentional await-holding cases 2026-04-20 19:03:11 -07:00
Michael Bolin f1411baed7 merge commit for archive created by Sapling 2026-04-20 18:59:27 -07:00
Michael Bolin 22734d6562 tests: isolate approval fixtures from host rules 2026-04-20 18:57:11 -07:00
Michael Bolin dd4b06d9c4 shell-escalation: carry resolved permission profiles 2026-04-20 18:57:11 -07:00
Michael Bolin 0d93db7f8b mcp: include permission profiles in sandbox state 2026-04-20 18:57:11 -07:00
Michael Bolin 1517281a72 tui: carry permission profiles on user turns 2026-04-20 18:57:10 -07:00
Michael Bolin 4dd62d897d tui: sync session permission profiles 2026-04-20 18:56:47 -07:00
Michael Bolin 3392b2b47f app-server: accept command permission profiles 2026-04-20 18:56:47 -07:00
Michael Bolin 0193553d89 protocol: report session permission profiles 2026-04-20 18:56:46 -07:00
Michael Bolin 37279b67be rollout: persist turn permission profiles 2026-04-20 18:56:15 -07:00
Michael Bolin b852bd9aa2 clients: send permission profiles to app-server 2026-04-20 18:55:54 -07:00
Michael Bolin 1fdd10da00 Merge b2c2770a78 into sapling-pr-archive-bolinfest 2026-04-20 18:54:36 -07:00
Michael Bolin 69ab9ebcc8 app-server: accept permission profile overrides 2026-04-20 18:54:32 -07:00
Michael Bolin 880130c24a app-server: expose thread permission profiles 2026-04-20 18:54:01 -07:00
Michael Bolin 6395d1a830 core: derive active permission profiles 2026-04-20 18:54:01 -07:00
Michael Bolin a53690c31e exec-server: carry filesystem sandbox profiles 2026-04-20 18:54:01 -07:00
Michael Bolin f9163e8780 sandboxing: intersect permission profiles semantically 2026-04-20 18:54:00 -07:00
Michael Bolin 5620995b4e protocol: preserve glob scan depth in permission profiles 2026-04-20 18:54:00 -07:00
Michael Bolin b2c2770a78 chore: enable await-holding clippy lints
Follow-up to https://github.com/openai/codex/pull/18178, where we said the await-holding clippy rule would be enabled separately.

Enable `await_holding_lock` and `await_holding_invalid_type` after the preceding commits fixed or explicitly documented the current offenders.
2026-04-20 18:51:10 -07:00
Michael Bolin 793639ee74 chore: document intentional await-holding cases 2026-04-20 18:51:10 -07:00
Michael Bolin 17162a9db6 refactor: drop data locks before async work 2026-04-20 18:50:43 -07:00