Commit Graph
5068 Commits
Author SHA1 Message Date
Michael Bolin 70190528e7 Merge 87c5d83494 into sapling-pr-archive-bolinfest 2026-04-26 03:55:38 -07:00
Michael Bolin 87c5d83494 permissions: finish profile-backed app surfaces 2026-04-26 03:55:26 -07:00
Michael Bolin e10e264508 permissions: remove core legacy policy round trips 2026-04-26 03:55:26 -07:00
Michael Bolin 91f67e203d permissions: migrate approval and sandbox consumers to profiles 2026-04-26 03:55:26 -07:00
Michael Bolin cb6f12ee23 permissions: derive compatibility policies from profiles 2026-04-26 03:55:26 -07:00
Michael Bolin d317ae2c54 permissions: make runtime config profile-backed 2026-04-26 03:55:26 -07:00
Michael Bolin 546382d508 Merge d8043f0dc6 into sapling-pr-archive-bolinfest 2026-04-26 03:43:50 -07:00
Michael Bolin d8043f0dc6 permissions: finish profile-backed app surfaces 2026-04-26 03:43:37 -07:00
Michael Bolin 22696ce06c permissions: remove core legacy policy round trips 2026-04-26 03:43:37 -07:00
Michael Bolin 513fbc6393 permissions: migrate approval and sandbox consumers to profiles 2026-04-26 03:43:37 -07:00
Michael Bolin b6325a5f40 permissions: derive compatibility policies from profiles 2026-04-26 03:43:37 -07:00
Michael Bolin 7b18a6a711 permissions: make runtime config profile-backed 2026-04-26 03:43:37 -07:00
Michael Bolin 3ba7984e8c Merge 5dc530e663 into sapling-pr-archive-bolinfest 2026-04-26 03:04:14 -07:00
Michael Bolin 5dc530e663 permissions: finish profile-backed app surfaces 2026-04-26 03:04:00 -07:00
Michael Bolin add77ad4c8 permissions: remove core legacy policy round trips 2026-04-26 03:04:00 -07:00
Michael Bolin 1f18e9ce78 permissions: migrate approval and sandbox consumers to profiles 2026-04-26 03:04:00 -07:00
Michael Bolin 46e884dd7f permissions: derive compatibility policies from profiles 2026-04-26 03:04:00 -07:00
Michael Bolin 0d7e33845b permissions: make runtime config profile-backed 2026-04-26 03:04:00 -07:00
Michael Bolin 0849e5b704 Merge a36b32376e into sapling-pr-archive-bolinfest 2026-04-26 02:31:20 -07:00
Michael Bolin a36b32376e permissions: finish profile-backed app surfaces 2026-04-26 02:31:12 -07:00
Michael Bolin d7e6c1ad97 permissions: remove core legacy policy round trips 2026-04-26 02:31:12 -07:00
Michael Bolin 6b484999d7 permissions: migrate approval and sandbox consumers to profiles 2026-04-26 02:31:12 -07:00
Michael Bolin 5472b309e4 permissions: derive compatibility policies from profiles 2026-04-26 02:31:12 -07:00
Michael Bolin 170e467e33 permissions: make runtime config profile-backed 2026-04-26 02:31:11 -07:00
Michael Bolin 330861e893 Merge 3be42b06fb into sapling-pr-archive-bolinfest 2026-04-26 01:59:47 -07:00
Michael Bolin 3be42b06fb permissions: finish profile-backed app surfaces 2026-04-26 01:59:40 -07:00
Michael Bolin f5a4f81165 permissions: remove core legacy policy round trips 2026-04-26 01:59:40 -07:00
Michael Bolin d56ba48606 permissions: migrate approval and sandbox consumers to profiles 2026-04-26 01:59:40 -07:00
Michael Bolin c87d4fe501 permissions: derive compatibility policies from profiles 2026-04-26 01:59:40 -07:00
Michael Bolin 233f8315ae permissions: make runtime config profile-backed 2026-04-26 01:59:40 -07:00
Michael Bolin 902e7a5a37 Merge 48ba8c1190 into sapling-pr-archive-bolinfest 2026-04-26 01:27:49 -07:00
Michael Bolin 48ba8c1190 permissions: finish profile-backed app surfaces 2026-04-26 01:27:42 -07:00
Michael Bolin 353942ebde permissions: remove core legacy policy round trips 2026-04-26 01:27:42 -07:00
Michael Bolin f2a6946aa7 permissions: migrate approval and sandbox consumers to profiles 2026-04-26 01:27:42 -07:00
Michael Bolin 3b05121247 permissions: derive compatibility policies from profiles 2026-04-26 01:27:42 -07:00
Michael Bolin cbbe3b3691 permissions: make runtime config profile-backed 2026-04-26 01:27:42 -07:00
Michael Bolin b0eff2a76b permissions: finish profile-backed app surfaces 2026-04-26 00:47:59 -07:00
Michael Bolin 6e1a967db1 permissions: remove core legacy policy round trips 2026-04-26 00:47:59 -07:00
Michael Bolin 6bc6270c81 permissions: migrate approval and sandbox consumers to profiles 2026-04-26 00:47:59 -07:00
Michael Bolin b9ea14c726 permissions: derive compatibility policies from profiles 2026-04-26 00:47:59 -07:00
Michael Bolin 2b2be6ead1 permissions: make runtime config profile-backed 2026-04-26 00:47:59 -07:00
Michael Bolin 9881dc7306 fix: restore 30-minute timeout for Bazel builds (#19609)
I think raising it to 45 minutes in
https://github.com/openai/codex/pull/19578 was a mistake for the reasons
explained in the comments in the code. Instead, we attempt to defend
against timeouts by increasing the number of shards in
`app-server-all-test` so that a "true failure" that gets run 3x should
not take as much wall clock time.
2026-04-25 16:34:06 -07:00
Michael Bolin d54493ba1c test: stabilize app-server path assertions on Windows (#19604)
## Why

Windows can represent the same canonical local path with either a normal
drive path or a verbatim device path prefix. The failure pattern that
motivated this PR was an assertion diff like `C:\...` versus
`\\?\C:\...`: different spellings, same file.

That became visible while validating the permissions stack above this
PR. The stack increasingly routes paths through `AbsolutePathBuf`, which
normalizes supported Windows device prefixes, while several existing
tests still built expected values directly with
`std::fs::canonicalize()` or compared `AbsolutePathBuf::as_path()` to a
raw `PathBuf`. On Windows, that can make tests fail because the two
sides choose different textual forms for an otherwise equivalent
canonical path.

This PR is intentionally split out as the bottom PR below #19606. The
runtime permissions migration should not carry unrelated Windows test
stabilization, and reviewers should be able to verify this as a
test-only change before looking at the larger permissions changes.

## Failure Modes Covered

- `conversation_summary` expected rollout paths were built from raw
canonicalized `PathBuf`s, while app-server responses could carry
`AbsolutePathBuf`-normalized paths.
- `thread_resume` compared returned thread paths directly to previously
stored or fixture paths, so a verbatim-prefix spelling could fail an
otherwise correct resume.
- `marketplace_add` compared plugin install roots through `as_path()`
against raw canonicalized paths, reproducing the same `C:\...` versus
`\\?\C:\...` mismatch in both app-server and core-plugin coverage.

## What Changed

- In `app-server/tests/suite/conversation_summary.rs`, normalize both
expected rollout paths and received `ConversationSummary.path` values
through `AbsolutePathBuf` before comparing the full summary object.
- In `app-server/tests/suite/v2/thread_resume.rs`, normalize both sides
of thread path comparisons before asserting equality. This keeps the
tests focused on whether resume returned the same existing path, not
whether Windows used the same string spelling.
- In `app-server/tests/suite/v2/marketplace_add.rs` and
`core-plugins/src/marketplace_add.rs`, compare install roots as
`AbsolutePathBuf` values instead of comparing an absolute-path wrapper
to a raw canonicalized `PathBuf`.

## Behavior

This PR does not change production app-server or marketplace behavior.
It only changes tests to assert semantic path identity across Windows
path spelling variants. It also leaves API response values untouched;
the normalization happens inside assertions only.

## Verification

Targeted local checks run while extracting this fix:

- `cargo test -p codex-app-server
get_conversation_summary_by_thread_id_reads_rollout`
- `cargo test -p codex-app-server
get_conversation_summary_by_relative_rollout_path_resolves_from_codex_home`
- `cargo test -p codex-app-server
thread_resume_prefers_path_over_thread_id`

Windows-specific confidence comes from the Bazel Windows CI job for this
PR, since the failure is platform-specific.

## Docs

No docs update is needed because this is test-only infrastructure
stabilization.

---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/19604).
* #19395
* #19394
* #19393
* #19392
* #19606
* __->__ #19604
2026-04-25 16:25:28 -07:00
viyatb-oai 9aaa5d9358 [codex] Bypass managed network for escalated exec (#19595)
## Why

`sandbox_permissions = "require_escalated"` is treated as an explicit
request to approve the command and run it outside the
filesystem/platform sandbox. Before this change, shell and unified exec
still registered managed network approval context and could inject
Codex-managed proxy state into the child process, which meant an
approved escalated command could still hit a second network approval
path.

This PR makes that escalation boundary consistent: once a command is
explicitly approved to run outside the sandbox, Codex does not also
route that process through the managed network proxy.

## Security impact

Command/filesystem sandbox approval now implies network approval for
that command. If an untrusted command or script is allowed to run with
`require_escalated`, its network calls are unsandboxed: Codex-managed
network allowlists and denylists are not respected for that process, so
the command can exfiltrate any data it can read.

## What changed

- Skip managed network approval specs for
`SandboxPermissions::RequireEscalated`.
- Pass `network: None` into shell, zsh-fork shell, and unified exec
sandbox preparation for explicitly escalated requests.
- Strip Codex-managed proxy environment variables when
`CODEX_NETWORK_PROXY_ACTIVE` is present, while preserving user proxy env
when the Codex marker is absent.
- Add regression coverage for the prepared exec request so the old
behavior cannot silently reappear.

## Verification

- `cargo test -p codex-core explicit_escalation`
- `cargo clippy -p codex-core --all-targets -- -D warnings`
2026-04-25 23:23:58 +00:00
Eric Traut 0c785598b3 Keep slash command popup columns stable while scrolling (#19511)
## Why

Fixes #19499.

The slash-command popup recalculated the command-name column from only
the rows visible in the current viewport. That made the description
column shift horizontally while scrolling through `/` commands whenever
longer command names entered or left the visible window.

## What Changed

`codex-rs/tui/src/bottom_pane/command_popup.rs` now uses the shared
selection-popup `AutoAllRows` column-width mode for both height
measurement and rendering. This keeps the command description column
based on the full filtered slash-command list instead of the current
viewport.

## Verification

- `cargo test -p codex-tui bottom_pane::command_popup`
2026-04-25 14:25:58 -07:00
Michael Bolin f41306b4f3 test: isolate remote thread store regression from plugin warmups (#19593)
Follow-up to #19266.

## Why


`thread_start_with_non_local_thread_store_does_not_create_local_persistence`
is meant to catch accidental local thread persistence when a non-local
thread store is configured. The Windows flake reported in [this
BuildBuddy
invocation](https://app.buildbuddy.io/invocation/0b75dde4-6828-4e7b-a35b-e45b73fb005d)
showed that the assertion was tripping on an unexpected top-level `.tmp`
entry:

```diff
 {
+    ".tmp",
     "config.toml",
     "installation_id",
     "memories",
     "skills",
 }
```

That `.tmp` does not appear to come from `tempfile::TempDir`; it comes
from unrelated plugin startup work that can legitimately materialize
`codex_home/.tmp`, including the startup remote plugin sync marker in
[`core/src/plugins/startup_sync.rs`](https://github.com/openai/codex/blob/bce74c70ce058982534507330ff33f7b196708ef/codex-rs/core/src/plugins/startup_sync.rs#L13-L15)
and the curated plugin snapshot under
[`.tmp/plugins`](https://github.com/openai/codex/blob/bce74c70ce058982534507330ff33f7b196708ef/codex-rs/core-plugins/src/startup_sync.rs#L25-L26).

That makes the regression race unrelated background startup tasks
instead of validating the thread-store invariant it was added to cover.
Rather than weakening the assertion to allow arbitrary `.tmp` entries,
this change isolates the test from plugin warmups so it can stay strict
about unexpected local thread persistence artifacts.

## What changed

- disable plugins in the generated config used by
`app-server/tests/suite/v2/remote_thread_store.rs`
- keep the existing `codex_home` assertions unchanged so the test still
fails if local session or sqlite persistence is introduced

## Verification

- `cargo test -p codex-app-server
suite::v2::remote_thread_store::thread_start_with_non_local_thread_store_does_not_create_local_persistence
-- --exact`
2026-04-25 20:45:31 +00:00
Eric Traut bce74c70ce Restore persisted model provider on thread resume (#19287)
Fixes #15219.

## Why

`thread/resume` should continue a persisted thread with the same model
provider that created the thread. The app server already restores the
persisted model and reasoning effort before resuming, but it was leaving
`model_provider` unset. If a user created a thread with one provider and
later switched their active profile to another provider, resumed
encrypted history could be sent to the wrong endpoint and fail with
`invalid_encrypted_content`.

The thread metadata already records the original provider, so resume
should apply it when the caller has not explicitly requested a different
model/provider/reasoning configuration.

## What changed

This updates `merge_persisted_resume_metadata` in
`app-server/src/codex_message_processor.rs` to copy
`ThreadMetadata::model_provider` into `ConfigOverrides::model_provider`
alongside the persisted model.

The existing resume metadata tests now also assert that:

- the persisted provider is restored for normal resume
- explicit model, provider, or reasoning-effort overrides still prevent
persisted resume metadata from being applied
- a thread with no persisted model or reasoning effort still resumes
with its persisted provider

## Verification

- `cargo test -p codex-app-server` passed the app-server unit tests,
including the updated resume metadata coverage. The broader integration
portion of that command failed in an unrelated environment-sensitive
skills-budget warning assertion, where this run saw 8 omitted skills
instead of the expected 7.
- `just fix -p codex-app-server` completed successfully.
2026-04-25 12:40:00 -07:00
Ahmed Ibrahim 022f81df1f [codex] Order codex-mcp items by visibility (#19526)
## Why

The visibility cleanup in the base PR reduced what `codex-mcp` exposes,
but several files still made reviewers read private support machinery
before the public or crate-facing entry points. This ordering pass makes
each file easier to scan: exported API first, crate-visible MCP
internals next, then private helpers in breadth-first order from the
higher-level MCP flows to leaf utilities.

## What Changed

- Reordered `codex-mcp` exports so the runtime, configuration, snapshot,
auth, and helper surfaces are grouped by visibility and reader
importance.
- Moved public and crate-visible MCP items ahead of private helpers in
the auth, MCP planning/snapshot, connection manager, and tool-name
modules.
- Kept the change mechanical, with no behavior changes intended.

## Verification

- `cargo check -p codex-mcp`
2026-04-25 07:17:30 -07:00
Ahmed Ibrahim 706490ab1b [codex] Prune unused codex-mcp API and duplicate helpers (#19524)
## Why

`codex-mcp` currently exposes more API than the rest of the workspace
uses. Some of that surface is simply visibility that can be tightened,
and some of it is public helper code that remains compiler-valid because
it is exported even though no workspace caller uses it.

That distinction matters: Rust does not warn on exported API just
because the current workspace does not call it. This PR intentionally
treats those exported-but-workspace-unreferenced paths as stale
`codex-mcp` surface. The main example is MCP skill dependency
collection, where the active implementation now lives in
`codex-rs/core/src/mcp_skill_dependencies.rs`; keeping the older
`codex-mcp` copy makes it unclear which implementation owns skill MCP
installation.

## What Changed

- Pruned unused `codex-mcp` re-exports from `codex-mcp/src/lib.rs`.
- Removed non-runtime helper methods from `McpConnectionManager` so it
stays focused on live MCP clients.
- Made `ToolPluginProvenance` lookup methods crate-private.
- Removed workspace-unreferenced snapshot wrapper APIs and
qualified-tool grouping helpers.
- Deleted the duplicate `codex-mcp` skill dependency module and tests
now that skill MCP dependency handling is owned by `core`.

## Verification

- `cargo check -p codex-mcp`
2026-04-25 06:36:07 -07:00
Matthew Zeng 6e838a19fa Enable unavailable dummy tools by default (#19459)
## Summary
- Mark `unavailable_dummy_tools` as a stable feature and enable it by
default
- Update the feature registry test to match the new default state

## Testing
- `just fmt`
- `cargo test -p codex-features`
2026-04-25 08:46:57 +00:00