Commit Graph

13977 Commits

Author SHA1 Message Date
Michael Bolin
25658867e2 merge commit for archive created by Sapling 2026-04-28 13:01:22 -07:00
Michael Bolin
2e246ed1ec core tests: migrate hook turns to profiles 2026-04-28 13:00:58 -07:00
Michael Bolin
869a661bdb core tests: migrate apply patch turns to profiles 2026-04-28 13:00:58 -07:00
Michael Bolin
4d28a7f294 core tests: migrate rmcp turns to profiles 2026-04-28 13:00:58 -07:00
Michael Bolin
01c533fdb1 core tests: migrate compact turns to profiles 2026-04-28 13:00:58 -07:00
Michael Bolin
ddff688aa8 core tests: migrate zsh-fork permissions to profiles 2026-04-28 13:00:58 -07:00
Michael Bolin
08262f5266 core tests: migrate request permissions tool turns to profiles 2026-04-28 13:00:58 -07:00
Michael Bolin
1c3cddb0c4 core tests: migrate prompt caching turns to profiles 2026-04-28 13:00:58 -07:00
Michael Bolin
e9202a36e1 core tests: migrate exec policy turns to profiles 2026-04-28 13:00:58 -07:00
Michael Bolin
e39990925a core tests: migrate permissions message tests to profiles 2026-04-28 13:00:58 -07:00
Michael Bolin
9db1f09615 core tests: migrate tools tests to permission profiles 2026-04-28 13:00:58 -07:00
Michael Bolin
67d37d102f core tests: migrate plan item turns to profiles 2026-04-28 13:00:58 -07:00
Michael Bolin
a7c7b8f265 core tests: migrate safety check turns to profiles 2026-04-28 13:00:58 -07:00
Michael Bolin
fa0622556b core tests: migrate view image turns to profiles 2026-04-28 13:00:58 -07:00
Michael Bolin
d4c85968ea core tests: migrate model/personality turns to profiles 2026-04-28 13:00:58 -07:00
Michael Bolin
c95a0eafa0 core tests: send model turns with permission profiles 2026-04-28 13:00:58 -07:00
Michael Bolin
6ad656087f core tests: configure profiles directly 2026-04-28 13:00:58 -07:00
Michael Bolin
3d2dae7e1a core tests: migrate more turns to permission profiles 2026-04-28 13:00:58 -07:00
Michael Bolin
ed75cf3766 core tests: build user turns from permission profiles 2026-04-28 13:00:58 -07:00
Michael Bolin
0b78a490ec core tests: submit turns with permission profiles 2026-04-28 13:00:58 -07:00
Michael Bolin
e8a482a2d9 tui: use permission profiles for sandbox state 2026-04-28 13:00:58 -07:00
Michael Bolin
68711d079f Merge deea4c5d91 into sapling-pr-archive-bolinfest 2026-04-28 11:25:09 -07:00
Michael Bolin
deea4c5d91 core tests: migrate hook turns to profiles 2026-04-28 11:24:40 -07:00
Michael Bolin
8ca63b2584 core tests: migrate apply patch turns to profiles 2026-04-28 11:24:40 -07:00
Michael Bolin
a4e38414fd core tests: migrate rmcp turns to profiles 2026-04-28 11:24:40 -07:00
Michael Bolin
d0d44e1980 core tests: migrate compact turns to profiles 2026-04-28 11:24:40 -07:00
Michael Bolin
2b49557202 core tests: migrate zsh-fork permissions to profiles 2026-04-28 11:24:40 -07:00
Michael Bolin
5a30ba5944 core tests: migrate request permissions tool turns to profiles 2026-04-28 11:24:40 -07:00
Michael Bolin
858792b8a6 core tests: migrate prompt caching turns to profiles 2026-04-28 11:24:40 -07:00
Michael Bolin
894acd7916 core tests: migrate exec policy turns to profiles 2026-04-28 11:24:40 -07:00
Michael Bolin
d08a6fcb3d core tests: migrate permissions message tests to profiles 2026-04-28 11:24:40 -07:00
Michael Bolin
c118ae3774 core tests: migrate tools tests to permission profiles 2026-04-28 11:24:40 -07:00
Michael Bolin
075cc47dbc core tests: migrate plan item turns to profiles 2026-04-28 11:24:40 -07:00
Michael Bolin
7487c90ec0 core tests: migrate safety check turns to profiles 2026-04-28 11:24:40 -07:00
Michael Bolin
0361f3b36d core tests: migrate view image turns to profiles 2026-04-28 11:24:40 -07:00
Michael Bolin
03cfed4866 core tests: migrate model/personality turns to profiles 2026-04-28 11:24:40 -07:00
Michael Bolin
a0fde92b48 core tests: send model turns with permission profiles 2026-04-28 11:24:40 -07:00
Michael Bolin
46ecb96e2d core tests: configure profiles directly 2026-04-28 11:24:40 -07:00
Michael Bolin
841c720fea core tests: migrate more turns to permission profiles 2026-04-28 11:24:40 -07:00
Michael Bolin
868b85bac6 core tests: build user turns from permission profiles 2026-04-28 11:24:40 -07:00
Michael Bolin
74da55d952 core tests: submit turns with permission profiles 2026-04-28 11:24:40 -07:00
Michael Bolin
2c32c5fa60 tui: use permission profiles for sandbox state 2026-04-28 11:24:40 -07:00
canvrno-oai
640a1b23ea Fix plan mode nudge test after task completion signature change (#20045)
Updates the plan mode nudge test to pass the new `duration_ms` argument
to task completion.

Co-authored-by: Codex <noreply@openai.com>
2026-04-28 11:24:22 -07:00
Michael Bolin
9e26613657 permissions: add built-in default profiles (#19900)
## Why

The migration away from `SandboxPolicy` needs new configs to start from
permissions profiles instead of deriving profiles from legacy sandbox
modes. Existing users can have empty `config.toml` files, and we should
not rewrite user-owned config files that may live in shared
repositories.

This PR introduces built-in profile names so an empty config can resolve
to a canonical `PermissionProfile`, while explicit named `[permissions]`
profiles still behave predictably.

## What changed

- Adds built-in `default_permissions` profile names:
  - `:read-only` maps to `PermissionProfile::read_only()`.
- `:workspace` maps to the workspace-write profile, including
project-root metadata carveouts.
- `:danger-no-sandbox` maps to `PermissionProfile::Disabled`, preserving
the distinction between no sandbox and a broad managed sandbox.
- Reserves the `:` prefix for built-in profiles so user-defined
`[permissions]` profiles cannot collide with future built-ins.
- Allows `default_permissions` to reference a built-in profile without
requiring a `[permissions]` table.
- Makes an otherwise empty config choose a built-in profile by
trust/platform context: trusted or untrusted project roots use
`:workspace` when the platform supports that sandbox, while roots
without a trust decision use `:read-only`.
- Keeps legacy `sandbox_mode` configs on the legacy path, and still
rejects user-defined `[permissions]` profiles that omit
`default_permissions` so we do not silently guess among custom profiles.
- Preserves compatibility behavior for implicit defaults: bare
`network.enabled = true` allows runtime network without starting the
managed proxy, explicit profile proxy policy still starts the proxy, and
implicit workspace/add-dir roots keep legacy metadata carveouts.

## Verification

- `cargo test -p codex-core builtin --lib`
- `cargo test -p codex-core profile_network_proxy_config`
- `cargo test -p codex-core
implicit_builtin_workspace_profile_preserves_add_dir_metadata_carveouts`
- `cargo test -p codex-core
permissions_profiles_network_enabled_allows_runtime_network_without_proxy`
- `cargo test -p codex-core
permissions_profiles_proxy_policy_starts_managed_network_proxy`

## Documentation

Public Codex config docs should mention these built-in names when the
`[permissions]` config format is ready to document as stable.









---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/19900).
* #20041
* #20040
* #20037
* #20035
* #20034
* #20033
* #20032
* #20030
* #20028
* #20027
* #20026
* #20024
* #20021
* #20018
* #20016
* #20015
* #20013
* #20011
* #20010
* #20008
* __->__ #19900
2026-04-28 11:21:39 -07:00
viyatb-oai
3afb185a4f fix(network-proxy): tighten network proxy bypass defaults (#20002)
## Why
Managed sessions use `NO_PROXY` to keep a small set of destinations on
the direct path by default. The old default also bypassed all IPv4
link-local addresses in `169.254.0.0/16`, which includes metadata
endpoints such as `169.254.169.254`. Because `NO_PROXY` is evaluated by
the client before the request reaches the managed proxy, requests to
that range could skip proxy-side allowlist and local-binding checks
entirely. On hosts where a link-local metadata service is reachable,
that creates a path to sensitive environment metadata or credentials
outside the intended enforcement point.

## What changed
- remove the default IPv4 link-local `169.254.0.0/16` bypass from the
managed proxy environment
- keep the existing loopback and private-network defaults unchanged
- update the regression assertion to lock in the narrower default

## Security impact
Link-local requests now stay on the managed-proxy path by default, so
the proxy can apply configured policy before they reach metadata-style
endpoints or other link-local services.

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

Co-authored-by: Codex <noreply@openai.com>
2026-04-28 10:51:43 -07:00
stefanstokic-oai
4c68bd728f External agent session support (#19895)
## Summary

This extends external agent detection/import beyond config artifacts so
Codex can detect recent sessions files from the external agent home and
import them into Codex rollout history.

## What changed

- Added a focused `external_agent_sessions` module for:
  - session discovery
  - source-record parsing
  - rollout construction
  - import ledger tracking
- Wired session detection/import into the app-server external agent
config API.
- Added compaction handling so large imported sessions can be resumed
safely before the first follow-up turn.

## Testing

Added coverage for:
- recent-session detection
- custom-title handling
- recency filtering
- dedupe and re-detect-after-source-change behavior
- visible imported turn construction
- backward-compatible import payload deserialization
- end-to-end RPC import flow
- rejection of undetected session paths
- repeat-import behavior
- large-session compaction before first follow-up

Ran:
- `cargo test -p codex-app-server external_agent_config_import_ --test
all`
2026-04-28 17:42:36 +00:00
Felipe Coury
a036584104 fix(tui): let esc exit empty shell mode (#19986)
## Summary

- exit shell mode when `Esc` is pressed while the absorbed `!` is the
only input
- add direct regression coverage plus a composer snapshot for the
restored normal prompt state

## Root cause

Shell mode stores the leading `!` outside the editable textarea. After
typing only `!`, the textarea is empty but the composer is still in bash
mode, so the existing empty-composer `Esc` handling never runs.

## Validation

- `just fmt`
- `cargo test -p codex-tui
bottom_pane::chat_composer::tests::esc_exits_empty_shell_mode`
- `cargo test -p codex-tui
bottom_pane::chat_composer::tests::footer_mode_snapshots`
- `cargo insta pending-snapshots`

`cargo test -p codex-tui` still reports unrelated existing `/status`
snapshot drift in this local environment because the rendered
permissions text is `workspace-write with network access` instead of the
older `read-only` fixture text.
2026-04-28 14:35:24 -03:00
Michael Bolin
fe5bf89abc Merge 56ffe41e00 into sapling-pr-archive-bolinfest 2026-04-28 10:35:21 -07:00
canvrno-oai
bc5a1b961e Move local /resume cwd filtering into thread/list (#19931)
Move local resume and fork cwd filtering to `thread/list` instead of
filtering in the TUI. This makes the `/resume` menu feel slightly faster
to load when working in repos with many historical threads, and
centralizes the cwd filtering in app-server.

**Affected:**
- /resume from inside the TUI.
- codex resume with no session ID and without --last
- codex resume --all
- codex fork with no session ID and without --last
- codex fork --all

**Not affected:**
- codex resume <id>
- codex fork <id>
- codex resume --last
- codex fork --last

Steps to test performance improvement in a real Codex environment:
- Launch `codex resume` using compiled binary in a directory that has
seen many threads.
- Launch `codex resume` using release binary in same directory.
- Observe difference in time-to-full-page as threads load.
2026-04-28 10:35:10 -07:00
Michael Bolin
56ffe41e00 core tests: migrate hook turns to profiles 2026-04-28 10:35:10 -07:00