Commit Graph
12684 Commits
Author SHA1 Message Date
Michael Bolin 88520afe2c Merge f2e091cc3e into sapling-pr-archive-bolinfest 2026-04-22 22:45:51 -07:00
Michael Bolin 3f51be045d merge commit for archive created by Sapling 2026-04-22 22:44:53 -07:00
Michael Bolin f2e091cc3e tests: isolate approval fixtures from host rules 2026-04-22 22:44:21 -07:00
Michael Bolin c69c677311 tui: sync session permission profiles 2026-04-22 22:44:21 -07:00
Michael Bolin e8205156ee shell-escalation: carry resolved permission profiles 2026-04-22 22:44:21 -07:00
Michael Bolin cb931f3cf8 mcp: include permission profiles in sandbox state 2026-04-22 22:44:21 -07:00
Michael Bolin 98e4cb1cad tui: carry permission profiles on user turns 2026-04-22 22:44:21 -07:00
Michael Bolin 1de4254d2d Merge a21b9e5173 into sapling-pr-archive-bolinfest 2026-04-22 22:36:12 -07:00
Michael Bolin a21b9e5173 tests: isolate approval fixtures from host rules 2026-04-22 22:36:00 -07:00
Michael Bolin b68382f42c shell-escalation: carry resolved permission profiles 2026-04-22 22:36:00 -07:00
Michael Bolin 17d296a6de mcp: include permission profiles in sandbox state 2026-04-22 22:36:00 -07:00
Michael Bolin acdb526d4d tui: carry permission profiles on user turns 2026-04-22 22:36:00 -07:00
Michael Bolin 1d0f013cdf tui: sync session permission profiles 2026-04-22 22:36:00 -07:00
Abhinav 23afa173f4 Mark codex_hooks stable (#19012)
# Why

Hooks are ready to graduate to GA in the next release!

# What

- Moves `Feature::CodexHooks` into the stable feature group.
- Marks the `codex_hooks` feature spec as `Stage::Stable` and
default-enabled.
2026-04-23 05:34:05 +00:00
Michael Bolin 9d824cf4b4 app-server: accept command permission profiles (#18283)
## Why

`command/exec` is another app-server entry point that can run under
caller-provided permissions. It needs to accept `PermissionProfile`
directly so command execution is not left behind on `SandboxPolicy`
while thread APIs move forward.

Command-level profiles also need to preserve the semantics clients
expect from profile-relative paths. `:cwd` and cwd-relative deny globs
should be anchored to the resolved command cwd for a command-specific
profile, while configured deny-read restrictions such as `**/*.env =
none` still need to be enforced because they can come from config or
requirements rather than the command override itself.

## What Changed

This adds `permissionProfile` to `CommandExecParams`, rejects requests
that combine it with `sandboxPolicy`, and converts accepted profiles
into the runtime filesystem/network permissions used for command
execution.

When a command supplies a profile, the app-server resolves that profile
against the command cwd instead of the thread/server cwd. It also
preserves configured deny-read entries and `globScanMaxDepth` on the
effective filesystem policy so one-off command overrides cannot drop
those read protections. The PR also updates app-server docs/schema
fixtures and adds command-exec coverage for accepted, rejected,
cwd-scoped, and deny-read-preserving profile paths.

## Verification

- `cargo test -p codex-app-server
command_exec_permission_profile_cwd_uses_command_cwd`
- `cargo test -p codex-app-server
command_profile_preserves_configured_deny_read_restrictions`
- `cargo test -p codex-app-server
command_exec_accepts_permission_profile`
- `cargo test -p codex-app-server
command_exec_rejects_sandbox_policy_with_permission_profile`
- `just fix -p codex-app-server`

---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/18283).
* #18288
* #18287
* #18286
* #18285
* #18284
* __->__ #18283
2026-04-22 22:33:16 -07:00
Eric Traut bbff4ee61a Add safety check notification and error handling (#19055)
Adds a new app-server notification that fires when a user account has
been flagged for potential safety reasons.
2026-04-22 22:24:12 -07:00
Michael Bolin a8257e6387 merge commit for archive created by Sapling 2026-04-22 22:00:05 -07:00
Michael Bolin 431e0ee3c4 app-server: accept command permission profiles 2026-04-22 21:59:08 -07:00
Shijie Rao 02170996e6 Default Fast service tier for eligible ChatGPT plans (#19053)
## Why

Enterprise and business-like ChatGPT plans should get Codex's Fast
service tier by default when the user or caller has not made an explicit
service-tier choice. At the same time, callers need a durable way to
choose standard routing without adding a new persisted `standard`
service tier value. This keeps existing config compatibility while
letting core own the managed default policy.

## What changed

- Resolve the effective service tier in core at session creation:
explicit `fast` or `flex` wins, explicit null/clear or
`[notice].fast_default_opt_out = true` resolves to standard routing, and
otherwise eligible ChatGPT plans resolve to Fast when FastMode is
enabled.
- Add `[notice].fast_default_opt_out` as the persisted opt-out marker
for managed Fast defaults.
- Treat app-server/TUI `service_tier: null` as an explicit
standard/clear choice by preserving that intent through config loading.
- Update TUI rendering to use core's effective service tier for startup
and status surfaces while still keeping `config.service_tier` as the
explicit configured choice.
- Update `/fast off` to clear `service_tier`, persist the opt-out
marker, and send explicit standard for subsequent turns.

## Verification

- Added unit coverage for config override/notice handling, service-tier
resolution, runtime null clearing, and `/fast off` turn propagation.
- `cargo build -p codex-cli`

Full test suite was not run locally per author request.
2026-04-22 21:54:44 -07:00
Michael Bolin 69b4b3ed36 Merge c5c355b19d into sapling-pr-archive-bolinfest 2026-04-22 21:45:17 -07:00
Michael Bolin 1f3e227f70 Merge ea0e559397 into sapling-pr-archive-bolinfest 2026-04-22 21:40:05 -07:00
Michael Bolin ea0e559397 tests: isolate approval fixtures from host rules 2026-04-22 21:39:46 -07:00
Michael Bolin 1809c700ca shell-escalation: carry resolved permission profiles 2026-04-22 21:39:46 -07:00
Michael Bolin 247dd38205 mcp: include permission profiles in sandbox state 2026-04-22 21:39:46 -07:00
Michael Bolin c2ad4f12bc tui: carry permission profiles on user turns 2026-04-22 21:39:46 -07:00
Michael Bolin a167893dc6 tui: sync session permission profiles 2026-04-22 21:39:46 -07:00
Michael Bolin 18591d6518 app-server: accept command permission profiles 2026-04-22 21:39:46 -07:00
Michael Bolin 082fc4f632 protocol: report session permission profiles (#18282)
## Why

Clients that observe `SessionConfigured` need the same canonical
permission view that app-server thread responses provide. Reporting the
profile in protocol events lets clients keep their local state
synchronized without reinterpreting legacy sandbox fields.

## What changed

This adds `permission_profile` to `SessionConfigured` and propagates it
through core, exec JSON output, MCP server messages, and TUI
history/widget handling.

## Verification

- `cargo test -p codex-tui permissions -- --nocapture`
- `cargo test -p codex-core --test all permissions_messages --
--nocapture`















































---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/18282).
* #18288
* #18287
* #18286
* #18285
* #18284
* #18283
* __->__ #18282
2026-04-22 21:29:32 -07:00
Michael Bolin c5c355b19d bazel: shard slower Rust test targets 2026-04-22 21:25:07 -07:00
Andrei EternalandMichael Bolin 2b2de3f38b codex: support hooks in config.toml and requirements.toml (#18893)
## Summary

Support the existing hooks schema in inline TOML so hooks can be
configured from both `config.toml` and enterprise-managed
`requirements.toml` without requiring a separate `hooks.json` payload.

This gives enterprise admins a way to ship managed hook policy through
the existing requirements channel while still leaving script delivery to
MDM or other device-management tooling, and it keeps `hooks.json`
working unchanged for existing users.

This also lays the groundwork for follow-on managed filtering work such
as #15937, while continuing to respect project trust gating from #14718.
It does **not** implement `allow_managed_hooks_only` itself.

NOTE: yes, it's a bit unfortunate that the toml isn't formatted as
closely as normal to our default styling. This is because we're trying
to stay compatible with the spec for plugins/hooks that we'll need to
support & the main usecase here is embedding into requirements.toml

## What changed

- moved the shared hook serde model out of `codex-rs/hooks` into
`codex-rs/config` so the same schema can power `hooks.json`, inline
`config.toml` hooks, and managed `requirements.toml` hooks
- added `hooks` support to both `ConfigToml` and
`ConfigRequirementsToml`, including requirements-side `managed_dir` /
`windows_managed_dir`
- treated requirements-managed hooks as one constrained value via
`Constrained`, so managed hook policy is merged atomically and cannot
drift across requirement sources
- updated hook discovery to load requirements-managed hooks first, then
per-layer `hooks.json`, then per-layer inline TOML hooks, with a warning
when a single layer defines both representations
- threaded managed hook metadata through discovered handlers and exposed
requirements hooks in app-server responses, generated schemas, and
`/debug-config`
- added hook/config coverage in `codex-rs/config`, `codex-rs/hooks`,
`codex-rs/core/src/config_loader/tests.rs`, and
`codex-rs/core/tests/suite/hooks.rs`

## Testing

- `cargo test -p codex-config`
- `cargo test -p codex-hooks`
- `cargo test -p codex-app-server config_api`

## Documentation

Companion updates are needed in the developers website repo for:

- the hooks guide
- the config reference, sample, basic, and advanced pages
- the enterprise managed configuration guide

---------

Co-authored-by: Michael Bolin <mbolin@openai.com>
2026-04-22 21:20:09 -07:00
Michael Bolin f35273a3c3 merge commit for archive created by Sapling 2026-04-22 21:04:03 -07:00
Michael Bolin 9047f9a16c tests: isolate approval fixtures from host rules 2026-04-22 21:02:31 -07:00
Michael Bolin 6be0482c00 shell-escalation: carry resolved permission profiles 2026-04-22 21:02:31 -07:00
Michael Bolin b00800a536 mcp: include permission profiles in sandbox state 2026-04-22 21:02:31 -07:00
Michael Bolin e4bc8d21b2 tui: carry permission profiles on user turns 2026-04-22 21:02:31 -07:00
Michael Bolin 9fdabab8ae tui: sync session permission profiles 2026-04-22 21:02:31 -07:00
Michael Bolin f8036779b9 app-server: accept command permission profiles 2026-04-22 21:02:31 -07:00
Michael Bolin 4a43379515 protocol: report session permission profiles 2026-04-22 21:02:31 -07:00
Michael Bolin 9955eacd22 tui: fix approvals popup disabled shortcut test (#19072)
## Why

This regressed in #19063, which made `GuardianApproval` stable and
enabled by default. That adds an enabled `Auto-review` row to the
permissions popup, but `approvals_popup_navigation_skips_disabled` still
assumed the disabled `Full Access` row lived behind a hard-coded numeric
shortcut, so the test started selecting a different row and closing the
popup instead of verifying disabled-row behavior.

## What

- disable `GuardianApproval` in
`approvals_popup_navigation_skips_disabled` so the popup layout matches
the scenario the test is exercising
- choose the hidden numeric shortcut for the disabled `Full Access` row
by platform (`2` on non-Windows, `3` on Windows where `Read Only` is
shown) before asserting that selecting the disabled row leaves the popup
open

## Testing

- `cargo test -p codex-tui --lib
chatwidget::tests::permissions::approvals_popup_navigation_skips_disabled
-- --exact --nocapture`
- `cargo test -p codex-tui --lib chatwidget::tests::permissions --
--nocapture`
- `cargo test -p codex-tui`
2026-04-22 21:01:26 -07:00
Michael Bolin 8b78b46adb Merge b8b7ff5d9f into sapling-pr-archive-bolinfest 2026-04-22 20:21:01 -07:00
Michael Bolin b8b7ff5d9f protocol: report session permission profiles 2026-04-22 20:20:45 -07:00
Michael Bolin e8ba912fcc test: set Rust test thread stack size (#19067)
## Summary

Set `RUST_MIN_STACK=8388608` for Rust test entry points so
libtest-spawned test threads get an 8 MiB stack.

The Windows BuildBuddy failure on #18893 showed
`//codex-rs/tui:tui-unit-tests` exiting with a stack overflow in a
`#[tokio::test]` even though later test binaries in the shard printed
successful summaries. Default `#[tokio::test]` uses a current-thread
Tokio runtime, which means the async test body is driven on libtest's
std-spawned test thread. Increasing the test thread stack addresses that
failure mode directly.

To date, we have been fixing these stack-pressure problems with
localized future-size reductions, such as #13429, and by adding
`Box::pin()` in specific async wrapper chains. This gives us a baseline
test-runner stack size instead of continuing to patch individual tests
only after CI finds another large async future.

## What changed

- Added `common --test_env=RUST_MIN_STACK=8388608` in `.bazelrc` so
Bazel test actions receive the env var through Bazel's cache-keyed test
environment path.
- Set the same `RUST_MIN_STACK` value for Cargo/nextest CI entry points
and `just test`.
- Annotated the existing Windows Bazel linker stack reserve as 8 MiB so
it stays aligned with the libtest thread stack size.

## Testing

- `just --list`
- parsed `.github/workflows/rust-ci.yml` and
`.github/workflows/rust-ci-full.yml` with Ruby's YAML loader
- compared `bazel aquery` `TestRunner` action keys before/after explicit
`--test_env=RUST_MIN_STACK=...` and after moving the Bazel env to
`.bazelrc`
- `bazel test //codex-rs/tui:tui-unit-tests --test_output=errors`
- failed locally on the existing sandbox-specific status snapshot
permission mismatch, but loaded the Starlark changes and ran the TUI
test shards
2026-04-22 19:51:49 -07:00
Michael Bolin d698279f4c merge commit for archive created by Sapling 2026-04-22 19:32:44 -07:00
Michael Bolin 0c112c279e increase stack size 2026-04-22 19:32:09 -07:00
Michael Bolin 214c27d86e Merge 536bb065f4 into sapling-pr-archive-bolinfest 2026-04-22 19:30:30 -07:00
Michael Bolin 536bb065f4 increase stack size 2026-04-22 19:30:23 -07:00
Michael Bolin 60d6ba6782 Merge c52b5b5ce2 into sapling-pr-archive-bolinfest 2026-04-22 19:21:07 -07:00
Michael Bolin c52b5b5ce2 increase stack size 2026-04-22 19:20:06 -07:00
Dylan Hurd 5e71da1424 feat(request-permissions) approve with strict review (#19050)
## Summary
Allow the user to approve a request_permissions_tool request with the
condition that all commands in the rest of the turn are reviewed by
guardian, regardless of sandbox status.

## Testing
- [x] Added unit tests
- [x] Ran locally
2026-04-23 01:56:32 +00:00
Dylan Hurd c6ab601824 chore(auto-review) feature => stable (#19063)
## Summary
Turn on Auto Review

## Testing
- [x] Update unit tests
2026-04-22 18:51:39 -07:00