Commit Graph

15647 Commits

Author SHA1 Message Date
Michael Bolin
2794fbd985 Merge 5212bac2dc into sapling-pr-archive-bolinfest 2026-05-14 17:52:22 -07:00
Michael Bolin
5212bac2dc tui/exec: show effective workspace roots in summaries 2026-05-14 17:52:10 -07:00
Michael Bolin
233a4eda8a app-server: use permission ids and runtime workspace roots 2026-05-14 17:52:10 -07:00
Michael Bolin
cccf53efa4 permissions: resolve profile identity with constraints 2026-05-14 17:52:09 -07:00
Michael Bolin
f986e7462f merge commit for archive created by Sapling 2026-05-14 17:50:38 -07:00
Michael Bolin
b494ab8fee tui/exec: show effective workspace roots in summaries 2026-05-14 17:50:22 -07:00
Michael Bolin
ad66cc48be app-server: use permission ids and runtime workspace roots 2026-05-14 17:50:22 -07:00
Michael Bolin
396a7e84a5 permissions: resolve profile identity with constraints 2026-05-14 17:50:22 -07:00
Michael Bolin
0f91c8f2a1 merge commit for archive created by Sapling 2026-05-14 17:25:17 -07:00
Michael Bolin
0c8d6488f6 tui/exec: show effective workspace roots in summaries 2026-05-14 17:24:46 -07:00
Michael Bolin
ff536f5ab8 app-server: use permission ids and runtime workspace roots 2026-05-14 17:24:46 -07:00
Michael Bolin
46737cedf0 permissions: resolve profile identity with constraints 2026-05-14 17:24:45 -07:00
Michael Bolin
4b39a27508 permissions: support workspace roots in profiles 2026-05-14 17:24:22 -07:00
Michael Bolin
b6df2aa5dc merge commit for archive created by Sapling 2026-05-14 17:18:15 -07:00
Michael Bolin
79d302ac1f tui/exec: show effective workspace roots in summaries 2026-05-14 17:17:40 -07:00
Michael Bolin
31f2bc6511 app-server: use permission ids and runtime workspace roots 2026-05-14 17:17:40 -07:00
Michael Bolin
149b0e978d permissions: resolve profile identity with constraints 2026-05-14 17:17:10 -07:00
Michael Bolin
149cf98553 permissions: support workspace roots in profiles 2026-05-14 17:17:10 -07:00
Eric Traut
3dc278b68e Trim TUI legacy core helper usage (#22695)
## Why

The TUI still had a few low-risk dependencies flowing through the
transitional `legacy_core` namespace after the app-server migration.
These helpers either already have clearer non-core owners or are
presentation logic that does not belong in `codex-core`, so moving them
out reduces the compatibility surface without changing product behavior.

## What changed

This is a low-risk change, almost completely mechanical in nature.

- Route TUI Codex-home lookup through `codex-utils-home-dir`, use
`Config::log_dir` directly, and call
`codex-sandboxing::system_bwrap_warning` without going through
`legacy_core`.
- Move shared `codex resume` hint formatting from `codex-core` into
`codex-utils-cli`.
- Update CLI and TUI call sites to use the shared CLI utility, and keep
the resume-command behavior covered by tests in its new home.

## Verification

- `cargo test -p codex-utils-cli`
- `cargo test -p codex-utils-cli resume_command`
2026-05-14 16:54:59 -07:00
Dylan Hurd
85915a2a21 chore(config) rm windows_wsl_setup_acknowledged (#22717)
## Summary
Remove dead code from a notice that no longer exists.

## Testing
- [x] Unit tests pass.
2026-05-14 23:25:15 +00:00
Dylan Hurd
51b0e94105 chore(features) rm Feature::ApplyPatchFreeform (#22711)
## Summary
Removes the feature since this is effectively on by default in all cases
where we should use it, or can be configured via models.json.

## Testing
- [x] unit tests pass
2026-05-14 16:15:56 -07:00
Michael Bolin
0a0613e0fb Merge bf36d8cac1 into sapling-pr-archive-bolinfest 2026-05-14 16:05:59 -07:00
starr-openai
7c11c14efc Fix Windows sandbox clippy clones (#22687)
## Summary
- remove two redundant `PathBuf` clones in Windows sandbox setup tests
- fix current `rust-ci-full` Windows clippy failures on `main`

## Validation
- `just fmt`
- attempted on `dev`: `cargo clippy --target x86_64-pc-windows-msvc
--tests --profile dev --timings -- -D warnings`
- blocked by missing MSVC cross toolchain on the Linux devbox (`lib.exe`
/ MSVC C toolchain unavailable)
- live failure evidence: main `rust-ci-full` runs 25880209898 and
25879137967 failed on `windows-sandbox-rs/src/bin/setup_main/win.rs`
with `clippy::redundant_clone` at the two edited callsites
2026-05-14 15:54:18 -07:00
Michael Bolin
7a1dcaee2b Merge 797dbb40f7 into sapling-pr-archive-bolinfest 2026-05-14 15:45:28 -07:00
Michael Bolin
bf36d8cac1 tui/exec: show effective workspace roots in summaries 2026-05-14 15:35:46 -07:00
Michael Bolin
aac1dd5661 app-server: use permission ids and runtime workspace roots 2026-05-14 15:35:46 -07:00
Michael Bolin
797dbb40f7 permissions: support workspace roots in profiles 2026-05-14 15:18:44 -07:00
Michael Bolin
552c4bc723 permissions: resolve profile identity with constraints 2026-05-14 15:18:44 -07:00
xli-oai
8c7a176b55 Unqueue plugin list and read requests (#22703)
## Summary
- remove the app-server `plugin-read` serialization queue from
`plugin/list` and `plugin/read`
- allow plugin read/list requests to start immediately instead of
waiting behind other plugin read/list requests

## Test plan
- `just fmt`
- `cargo test -p codex-app-server-protocol`
2026-05-14 15:07:20 -07:00
Michael Bolin
fd8a381d36 merge commit for archive created by Sapling 2026-05-14 15:00:25 -07:00
Michael Bolin
28c51e6899 permissions: support workspace roots in profiles 2026-05-14 15:00:15 -07:00
Michael Bolin
ef1cafd52e merge commit for archive created by Sapling 2026-05-14 14:51:37 -07:00
sayan-oai
d346957288 make rust-release-prepare use env secret (#22702)
made a `rust-release-prepare` environment with the necessary API key as
an environment secret. use this in the workflow rather than the action
secret.

once this merges and i confirm it works as intended, ill rm the action
secret.
2026-05-14 21:45:53 +00:00
Michael Bolin
f92f2c3963 permissions: support workspace roots in profiles 2026-05-14 14:36:49 -07:00
rreichel3-oai
02a7205250 [codex] Support multiple forced ChatGPT workspaces (#18161)
## Summary

This change lets `forced_chatgpt_workspace_id` accept multiple workspace
IDs instead of a single value.

It keeps the existing config key name, adds backward-compatible parsing
for a single string in `config.toml`, and normalizes the setting into an
allowed workspace list across login enforcement, app-server config
surfaces, and local ChatGPT auth helpers.

## Why

Workspace-restricted deployments may need to allow more than one ChatGPT
workspace without dropping the guardrail entirely.

## Server-side impact

Codex's local server and app-server protocol needed changes because they
previously assumed a single workspace ID. The local login flow now
matches the auth backend interface by sending the allowed workspace list
as a single comma-separated `allowed_workspace_id` query parameter.

## Validation

This was tested with:

- A single workspace config
- With multi-workspace configs
- With multiple workspaces in the config
- The user only being a part of a subset of them

All were successful.

Automated coverage:

- `cargo test -p codex-login`
- `cargo test -p codex-app-server-protocol`
- `cargo test -p codex-tui local_chatgpt_auth`
- `cargo test --locked -p codex-app-server
login_account_chatgpt_includes_forced_workspace_allowlist_query_param`
2026-05-14 17:11:36 -04:00
Michael Bolin
56ace7478f merge commit for archive created by Sapling 2026-05-14 13:25:25 -07:00
Michael Bolin
8fc5565912 permissions: support workspace roots in profiles 2026-05-14 13:24:24 -07:00
starr-openai
32b45a43e2 tests: isolate codex home for live cli (#22563)
## Why

Some core integration-test paths were creating Codex state under ambient
`~/.codex`. In environments where `HOME=/tmp`, that showed up as
`/tmp/.codex`, which is host-level shared state and makes these tests
environment/order sensitive.

The affected paths were:

- `core/tests/suite/live_cli.rs`: `run_live()` spawned the real CLI with
a temp cwd, but without an isolated home, so the child resolved Codex
home from ambient `HOME`.
- core / exec-server integration test binaries using
`configure_test_binary_dispatch(...)`: their startup ctor installs arg0
helper aliases like `apply_patch` and `codex-linux-sandbox`. Full
`arg0_dispatch()` also installs aliases from ambient Codex-home
resolution, so test-binary startup could create `CODEX_HOME/tmp/arg0`;
with `HOME=/tmp`, that became `/tmp/.codex/tmp/arg0/...`.

## What changed

- `live_cli` now gives the spawned CLI a temp `HOME` and temp
`CODEX_HOME`.
- arg0 alias setup now has an explicit-home form,
`prepend_path_entry_for_codex_aliases_in(...)`, so test helpers can
place alias state under a temp directory without relying on ambient
`CODEX_HOME`.
- helper re-entry behavior is preserved with
`dispatch_arg0_if_needed()`, so aliases like `apply_patch` and
`codex-linux-sandbox` still dispatch correctly before test alias
installation.
- core test support keeps the temp Codex home alive for the lifetime of
the test binary, matching the alias lifetime.

## Verification

Verified on `dev2` with `HOME=/tmp` that the focused core test-binary
startup path no longer recreates `/tmp/.codex`.

Also checked the exact `live_cli` test path under `HOME=/tmp`; on `dev2`
it still hits the existing remote-only `cargo_bin("codex-rs")`
resolution failure before spawning the child, but `/tmp/.codex` remains
absent after the run.
2026-05-14 12:59:56 -07:00
Michael Bolin
292856b339 merge commit for archive created by Sapling 2026-05-14 12:45:43 -07:00
starr-openai
255748638c Fix remote environment test fixtures (#22572)
## Why
The Docker remote-env coverage was failing before it reached the
behavior those tests are meant to exercise. The remote-aware test
fixture only registered the remote environment, so tests that
intentionally select both `local` and `remote` could not start a turn.
After that was fixed, two tests exposed stale fixtures: the approval
test was auto-approving under workspace-write, and the remote
`view_image` test was writing invalid PNG bytes.

## What Changed
- Added `EnvironmentManager::create_for_tests_with_local(...)` so tests
can keep the provider default while also selecting `local` explicitly.
- Updated `build_remote_aware()` to use that test-only manager when a
remote exec-server URL is present.
- Changed the remote apply-patch approval helper to use
`SandboxPolicy::new_read_only_policy()` so the test actually exercises
approval caching per environment.
- Replaced the hardcoded remote `view_image` PNG blob with the existing
`png_bytes(...)` helper so the test uses a valid image fixture.

## Validation
Ran these isolated Docker remote-env tests on the devbox with
`$remote-tests` setup:
-
`suite::remote_env::apply_patch_freeform_routes_to_selected_remote_environment`
-
`suite::remote_env::apply_patch_approvals_are_remembered_per_environment`
-
`suite::remote_env::apply_patch_intercepted_exec_command_routes_to_selected_remote_environment`
-
`suite::remote_env::exec_command_routes_to_selected_remote_environment`
- `suite::view_image::view_image_routes_to_selected_remote_environment`

All five pass.
2026-05-14 12:40:01 -07:00
Michael Bolin
1230fb5107 tui/exec: show effective workspace roots in summaries 2026-05-14 12:33:16 -07:00
Michael Bolin
fefc579cca app-server: use permission ids and runtime workspace roots 2026-05-14 12:33:16 -07:00
Michael Bolin
d3b8dc8a62 permissions: resolve profile identity with constraints 2026-05-14 12:33:05 -07:00
Michael Bolin
e8969d940d test: isolate exec review policy config test (#22512)
## Why


`thread_start_params_include_review_policy_when_review_policy_is_manual_only`
builds a `Config` with a temporary `CODEX_HOME`, but
`ConfigBuilder::default()` can still load host-managed configuration. On
local macOS machines with enterprise-managed Codex config, that host
state can leak into the test and change the resulting config, even
though CI does not have the same managed config source.

This makes the test environment-dependent: it can pass in CI while
failing locally for developers who have managed configuration installed.

## What Changed

- Updated `codex-rs/exec/src/lib_tests.rs` so the test calls
`LoaderOverrides::without_managed_config_for_tests()` through
`ConfigBuilder::loader_overrides(...)`.
- Left the rest of the test setup intact, including the temporary
`CODEX_HOME`, temporary cwd, and explicit `approvals_reviewer` harness
override.

## Verification

```shell
cargo test -p codex-exec thread_start_params_include_review_policy_when_review_policy_is_manual_only
```
2026-05-14 12:14:20 -07:00
Matthew Zeng
d8ddeb6869 Support explicit MCP OAuth client IDs (#22575)
## Why
Some MCP OAuth providers require a pre-registered public client ID and
cannot rely on dynamic client registration. Codex already supports MCP
OAuth, but it had no way to supply that client ID from config into the
PKCE flow.

## What changed
- add `oauth.client_id` under `[mcp_servers.<server>]` config, including
config editing and schema generation
- thread the configured client ID through CLI, app-server, plugin login,
and MCP skill dependency OAuth entrypoints
- configure RMCP authorization with the explicit client when present,
while preserving the existing dynamic-registration path when it is
absent
- add focused coverage for config parsing/serialization and OAuth URL
generation

## Verification
- `cargo test -p codex-config -p codex-rmcp-client -p codex-mcp -p
codex-core-plugins`
- `cargo test -p codex-core blocking_replace_mcp_servers_round_trips
--lib`
- `cargo test -p codex-core
replace_mcp_servers_streamable_http_serializes_oauth_resource --lib`
- `cargo test -p codex-core config_schema_matches_fixture --lib`

## Notes
Broader local package runs still hit unrelated pre-existing stack
overflows in:
- `codex-app-server::in_process_start_clamps_zero_channel_capacity`
-
`codex-core::resume_agent_from_rollout_uses_edge_data_when_descendant_metadata_source_is_stale`
2026-05-14 11:52:43 -07:00
Casey Chow
4a1f1df8ce [codex] fix plugin CLI active user layer compile (#22666)
## Why

PR #21396 merged after #17141 removed the old
`ConfigLayerStack::get_user_layer()` API. The new plugin CLI call sites
still used that stale API, which caused `main` to fail compilation.

## What Changed

- update `codex plugin marketplace list` to read configured marketplaces
through `get_active_user_layer()`
- update the plugin snapshot validation helper to use
`get_active_user_layer()`

This preserves the intended active writable user-layer behavior from the
profile-aware config API while fixing the stale call sites.

## Validation

- `cargo check -p codex-cli`
- `cargo test -p codex-cli --test plugin_cli`
- `git diff --check`
2026-05-14 18:41:04 +00:00
Michael Bolin
5ee2cb6e5f Merge 2a7104fdb2 into sapling-pr-archive-bolinfest 2026-05-14 11:39:55 -07:00
Michael Bolin
2a7104fdb2 tui/exec: show effective workspace roots in summaries 2026-05-14 11:39:36 -07:00
Michael Bolin
f42586d9aa app-server: use permission ids and runtime workspace roots 2026-05-14 11:39:36 -07:00
Michael Bolin
5e3f04da96 permissions: support workspace roots in profiles 2026-05-14 11:39:03 -07:00