Commit Graph
12249 Commits
Author SHA1 Message Date
Michael Bolin 459a880d78 protocol: report session permission profiles 2026-04-20 22:48:44 -07:00
Michael Bolin 4a4d0877c2 rollout: persist turn permission profiles 2026-04-20 22:48:44 -07:00
Michael Bolin 5401f9676e clients: send permission profiles to app-server 2026-04-20 22:48:44 -07:00
Michael Bolin 6a17b80359 app-server: accept permission profile overrides 2026-04-20 22:48:44 -07:00
Michael Bolin 50a4ca2b72 app-server: expose thread permission profiles 2026-04-20 22:48:44 -07:00
Michael Bolin 734550b79e core: derive active permission profiles 2026-04-20 22:48:44 -07:00
Michael Bolin ac9de3d1ec exec-server: carry filesystem sandbox profiles 2026-04-20 22:48:44 -07:00
Michael Bolin 49a44b5226 sandboxing: intersect permission profiles semantically 2026-04-20 22:48:43 -07:00
Michael Bolin c6c10ddd82 Merge 30bc98760f into sapling-pr-archive-bolinfest 2026-04-20 22:42:52 -07:00
Michael Bolin 30bc98760f 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 22:42:37 -07:00
Michael Bolin d62421d322 chore: document intentional await-holding cases (#18423)
## Why

This PR prepares the stack to enable Clippy await-holding lints that
were left disabled in #18178. The mechanical lock-scope cleanup is
handled separately; this PR is the documentation/configuration layer for
the remaining await-across-guard sites.

Without explicit annotations, reviewers and future maintainers cannot
tell whether an await-holding warning is a real concurrency smell or an
intentional serialization boundary.

## What changed

- Configures `clippy.toml` so `await_holding_invalid_type` also covers
`tokio::sync::{MutexGuard,RwLockReadGuard,RwLockWriteGuard}`.
- Adds targeted `#[expect(clippy::await_holding_invalid_type, reason =
...)]` annotations for intentional async guard lifetimes.
- Documents the main categories of intentional cases: active-turn state
transitions that must remain atomic, session-owned MCP manager accesses,
remote-control websocket serialization, JS REPL kernel/process
serialization, OAuth persistence, external bearer token refresh
serialization, and tests that intentionally serialize shared global or
session-owned state.
- For external bearer token refresh, documents the existing
serialization boundary: holding `cached_token` across the provider
command prevents concurrent cache misses from starting duplicate refresh
commands, and the current behavior is small enough that an explicit
expectation is easier to maintain than adding another synchronization
primitive.

## Verification

- `cargo clippy -p codex-login --all-targets`
- `cargo clippy -p codex-connectors --all-targets`
- `cargo clippy -p codex-core --all-targets`
- The follow-up PR #18698 enables `await_holding_invalid_type` and
`await_holding_lock` as workspace `deny` lints, so any undocumented
remaining offender will fail Clippy.

---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/18423).
* #18698
* __->__ #18423
2026-04-20 22:41:54 -07:00
pakrym-oai 4c2e730488 Organize context fragments (#18794)
Organize context fragments under `core/context`. Implement same trait on
all of them.
2026-04-20 22:39:17 -07:00
Michael Bolin 0dfa5f3837 merge commit for archive created by Sapling 2026-04-20 22:31:50 -07:00
Michael Bolin e98daed02e tests: isolate approval fixtures from host rules 2026-04-20 22:31:13 -07:00
Michael Bolin c97200073f shell-escalation: carry resolved permission profiles 2026-04-20 22:31:13 -07:00
Michael Bolin 7ad9903e16 mcp: include permission profiles in sandbox state 2026-04-20 22:31:13 -07:00
Michael Bolin 7a31e19f83 tui: carry permission profiles on user turns 2026-04-20 22:31:13 -07:00
Michael Bolin 566862d0ef tui: sync session permission profiles 2026-04-20 22:31:13 -07:00
Michael Bolin 76a5cf7a83 app-server: accept command permission profiles 2026-04-20 22:31:13 -07:00
Michael Bolin 07798aeb3d protocol: report session permission profiles 2026-04-20 22:31:13 -07:00
Michael Bolin 6de839e33a rollout: persist turn permission profiles 2026-04-20 22:31:13 -07:00
Michael Bolin 05031055c0 clients: send permission profiles to app-server 2026-04-20 22:31:13 -07:00
Michael Bolin e99a496380 app-server: accept permission profile overrides 2026-04-20 22:31:13 -07:00
Michael Bolin 4b6f60054a app-server: expose thread permission profiles 2026-04-20 22:31:13 -07:00
Michael Bolin a2e61d7281 core: derive active permission profiles 2026-04-20 22:31:12 -07:00
Michael Bolin 7561a92856 exec-server: carry filesystem sandbox profiles 2026-04-20 22:31:12 -07:00
Michael Bolin f26a648439 sandboxing: intersect permission profiles semantically 2026-04-20 22:31:12 -07:00
Michael Bolin ae3b4b3aa2 Merge 7b40cacf12 into sapling-pr-archive-bolinfest 2026-04-20 22:15:02 -07:00
Michael Bolin 7b40cacf12 tests: isolate approval fixtures from host rules 2026-04-20 22:14:49 -07:00
Michael Bolin eae2f2165e shell-escalation: carry resolved permission profiles 2026-04-20 22:14:49 -07:00
Michael Bolin 26d1c11a0d mcp: include permission profiles in sandbox state 2026-04-20 22:14:49 -07:00
Michael Bolin 2b7faa4457 tui: carry permission profiles on user turns 2026-04-20 22:14:49 -07:00
Michael Bolin e8c0aaf4a4 tui: sync session permission profiles 2026-04-20 22:14:49 -07:00
Michael Bolin e28c7f4c44 app-server: accept command permission profiles 2026-04-20 22:14:49 -07:00
Michael Bolin 1b138ad5c4 protocol: report session permission profiles 2026-04-20 22:14:49 -07:00
Michael Bolin e73d50e61e rollout: persist turn permission profiles 2026-04-20 22:14:49 -07:00
Michael Bolin 806be7c01c clients: send permission profiles to app-server 2026-04-20 22:14:49 -07:00
Michael Bolin 3c66e19d9a app-server: accept permission profile overrides 2026-04-20 22:14:49 -07:00
Michael Bolin 5da4873690 app-server: expose thread permission profiles 2026-04-20 22:14:49 -07:00
Michael Bolin ef231cfc0b core: derive active permission profiles 2026-04-20 22:14:49 -07:00
Michael Bolin 55f76fbcaf exec-server: carry filesystem sandbox profiles 2026-04-20 22:14:49 -07:00
Michael Bolin 9a0c246f65 sandboxing: intersect permission profiles semantically 2026-04-20 22:14:49 -07:00
Michael Bolin d30536f649 merge commit for archive created by Sapling 2026-04-20 22:14:28 -07:00
Michael Bolin 13aee89df3 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 22:14:12 -07:00
Michael Bolin c649344a34 chore: document intentional await-holding cases 2026-04-20 22:14:12 -07:00
Abhinav ab26554a3a Add remote_sandbox_config to our config requirements (#18763)
## Why

Customers need finer-grained control over allowed sandbox modes based on
the host Codex is running on. For example, they may want stricter
sandbox limits on devboxes while keeping a different default elsewhere.

Our current cloud requirements can target user/account groups, but they
cannot vary sandbox requirements by host. That makes remote development
environments awkward because the same top-level `allowed_sandbox_modes`
has to apply everywhere.

## What

Adds a new `remote_sandbox_config` section to `requirements.toml`:

```toml
allowed_sandbox_modes = ["read-only"]

[[remote_sandbox_config]]
hostname_patterns = ["*.org"]
allowed_sandbox_modes = ["read-only", "workspace-write"]

[[remote_sandbox_config]]
hostname_patterns = ["*.sh", "runner-*.ci"]
allowed_sandbox_modes = ["read-only", "danger-full-access"]
```

During requirements resolution, Codex resolves the local host name once,
preferring the machine FQDN when available and falling back to the
cleaned kernel hostname. This host classification is best effort rather
than authenticated device proof.

Each requirements source applies its first matching
`remote_sandbox_config` entry before it is merged with other sources.
The shared merge helper keeps that `apply_remote_sandbox_config` step
paired with requirements merging so new requirements sources do not have
to remember the extra call.

That preserves source precedence: a lower-precedence requirements file
with a matching `remote_sandbox_config` cannot override a
higher-precedence source that already set `allowed_sandbox_modes`.

This also wires the hostname-aware resolution through app-server,
CLI/TUI config loading, config API reads, and config layer metadata so
they all evaluate remote sandbox requirements consistently.

## Verification

- `cargo test -p codex-config remote_sandbox_config`
- `cargo test -p codex-config host_name`
- `cargo test -p codex-core
load_config_layers_applies_matching_remote_sandbox_config`
- `cargo test -p codex-core
system_remote_sandbox_config_keeps_cloud_sandbox_modes`
- `cargo test -p codex-config`
- `cargo test -p codex-core` unit tests passed; `tests/all.rs`
integration matrix was intentionally stopped after the relevant focused
tests passed
- `just fix -p codex-config`
- `just fix -p codex-core`
- `cargo check -p codex-app-server`
2026-04-21 05:05:02 +00:00
Dylan HurdandCodex 86535c9901 feat(auto-review) Handle request_permissions calls (#18393)
## Summary
When auto-review is enabled, it should handle request_permissions tool.
We'll need to clean up the UX but I'm planning to do that in a separate
pass

## Testing
- [x] Ran locally
<img width="893" height="396" alt="Screenshot 2026-04-17 at 1 16 13 PM"
src="https://github.com/user-attachments/assets/4c045c5f-1138-4c6c-ac6e-2cb6be4514d8"
/>

---------

Co-authored-by: Codex <noreply@openai.com>
2026-04-20 21:48:57 -07:00
Dylan Hurd 543a08dac9 chore(app-server) linguist-generated (#18807)
## Summary
Start marking app-server schema files as
[linguist-generated](https://docs.github.com/en/repositories/working-with-files/managing-files/customizing-how-changed-files-appear-on-github),
so we can more easily parse reviews
2026-04-20 21:42:00 -07:00
canvrno-oai 2cc146f5ea Fallback display names for TUI skill mentions (#18786)
This updates TUI skill mentions to show a fallback label when a skill
does not define a display name, so unnamed skills remain understandable
in the picker without changing behavior for skills that already have
one.

<img width="1028" height="198" alt="Screenshot 2026-04-20 at 6 25 15 PM"
src="https://github.com/user-attachments/assets/84077b85-99d0-4db9-b533-37e1887b4506"
/>
2026-04-20 20:46:55 -07:00
Michael Bolin 7166be1480 merge commit for archive created by Sapling 2026-04-20 20:13:08 -07:00