Commit Graph

7061 Commits

Author SHA1 Message Date
Ahmed Ibrahim
62785c8f4d codex: match guardian selector request by cache key 2026-06-01 14:29:22 -07:00
Ahmed Ibrahim
2a541b8702 codex: inspect first guardian selector requests 2026-06-01 14:09:38 -07:00
Ahmed Ibrahim
6b5783c5c8 codex: isolate initial guardian selector request 2026-06-01 13:58:32 -07:00
Ahmed Ibrahim
5c383a7a28 codex: disambiguate guardian selector integration test 2026-06-01 13:49:08 -07:00
Ahmed Ibrahim
5d81bf9008 codex: initialize model selector in auto review fixture 2026-06-01 13:34:26 -07:00
Ahmed Ibrahim
d6b915691f codex: assert guardian model selector at request boundary 2026-06-01 13:33:02 -07:00
Ahmed Ibrahim
c8010aa301 codex: use established guardian route in model selector test 2026-06-01 13:33:01 -07:00
Ahmed Ibrahim
64eaff8e37 codex: isolate guardian model selector integration test 2026-06-01 13:33:01 -07:00
Ahmed Ibrahim
8ea7280aef codex: keep guardian disabled under model multi-agent selector 2026-06-01 13:33:00 -07:00
Ahmed Ibrahim
e286cdaa81 codex: simplify model multi-agent selection 2026-06-01 13:33:00 -07:00
Ahmed Ibrahim
65651707f3 codex: select multi-agent version from model info 2026-06-01 13:33:00 -07:00
Ahmed Ibrahim
5125a231c6 codex: seed multi-agent lock from latest metadata 2026-06-01 13:32:44 -07:00
Ahmed Ibrahim
384d0951d5 codex: remove fork history source wrapper 2026-06-01 13:15:00 -07:00
Ahmed Ibrahim
e02916c6ed codex: honor disabled usage hints when forking agents 2026-06-01 13:13:19 -07:00
Ahmed Ibrahim
7965513bd2 codex: fix rebased multi-agent CI fixtures 2026-06-01 13:13:19 -07:00
Ahmed Ibrahim
9e3139b2be codex: resolve fork lock from source thread 2026-06-01 13:13:18 -07:00
Ahmed Ibrahim
98f67c8a2c codex: represent disabled multi-agent runtime explicitly 2026-06-01 13:13:18 -07:00
Ahmed Ibrahim
297548de78 codex: extract multi-agent version resolver 2026-06-01 13:13:18 -07:00
Ahmed Ibrahim
2e4bda0332 codex: simplify multi-agent version resolution 2026-06-01 13:13:18 -07:00
Ahmed Ibrahim
0c3f349afa codex: resolve multi-agent version during session spawn 2026-06-01 13:13:18 -07:00
Ahmed Ibrahim
9652059fb2 codex: model locked rollout in resume integration tests 2026-06-01 13:13:18 -07:00
Ahmed Ibrahim
6f3d56f3fe codex: model locked rollout in fork integration test 2026-06-01 13:13:18 -07:00
Ahmed Ibrahim
74222e7fd1 codex: fix multi-agent lock clippy failures 2026-06-01 13:13:18 -07:00
Ahmed Ibrahim
ab6593cf38 codex: move multi-agent regression coverage to integration suite 2026-06-01 13:13:17 -07:00
Ahmed Ibrahim
19d9486974 codex: keep multi-agent regression tests behavioral 2026-06-01 13:13:17 -07:00
Ahmed Ibrahim
1cb632b4b4 codex: clarify resumed agent version resolution 2026-06-01 13:13:17 -07:00
Ahmed Ibrahim
38f6147d47 codex: keep config lock independent of runtime lock 2026-06-01 13:13:17 -07:00
Ahmed Ibrahim
6b8fdbdf70 codex: trim multi-agent version plumbing 2026-06-01 13:13:17 -07:00
Ahmed Ibrahim
3f82d5bd99 codex: lock multi-agent version on session 2026-06-01 13:13:17 -07:00
Ahmed Ibrahim
d3b7aecdeb codex: require locked version for child agents 2026-06-01 13:13:17 -07:00
Ahmed Ibrahim
d039da1a57 codex: simplify multi-agent inheritance 2026-06-01 13:13:17 -07:00
Ahmed Ibrahim
0c08f5fc0f codex: derive agent limits from thread lock 2026-06-01 13:13:16 -07:00
Ahmed Ibrahim
bc4c306546 codex: annotate unresolved multi-agent inheritance 2026-06-01 13:13:16 -07:00
Ahmed Ibrahim
db0becc830 codex: fix optional multi-agent CI failures 2026-06-01 13:13:16 -07:00
Ahmed Ibrahim
514afd0441 codex: simplify multi-agent version lock 2026-06-01 13:13:16 -07:00
Ahmed Ibrahim
745307ad08 codex: fix multi-agent version CI failures 2026-06-01 13:13:16 -07:00
Ahmed Ibrahim
c6dced1800 Lock multi-agent version per thread 2026-06-01 13:13:16 -07:00
Ahmed Ibrahim
19393fbaa5 codex: carry source thread id in forked history 2026-06-01 13:13:15 -07:00
Michael Bolin
d6748f741a feat: gate unified exec zsh fork composition (#24979)
## Why

`shell_zsh_fork` and unified exec need to remain independently
controllable for enterprise rollouts, but we also need a third mode that
composes them. That composed mode is intended to preserve unified exec
command lifecycle support while letting the zsh fork provide more
accurate `execv(2)` interception.

Enabling `unified_exec_zsh_fork` by itself is intentionally not
sufficient. It is a composition gate, not a dependency-enabling
shortcut:

- `unified_exec` selects the PTY-backed unified exec tool.
- `shell_zsh_fork` opts into the zsh fork backend.
- `unified_exec_zsh_fork` only allows those two already-enabled modes to
be composed so local zsh unified exec commands can launch through the
zsh fork.

This separation is deliberate. Enterprises and staged rollouts must be
able to enable or disable unified exec and zsh-fork independently. If
`unified_exec_zsh_fork` implied either dependency, then enabling one
under-development composition flag would silently activate a shell
backend that the configured feature set left disabled.

This PR introduces only the configuration and planning gate for that
composition. Existing `shell_zsh_fork` behavior continues to use the
standalone shell tool unless the new composition feature is explicitly
enabled alongside both dependencies.

## What Changed

- Added the under-development feature flag `unified_exec_zsh_fork`.
- Added `UnifiedExecFeatureMode` so the three input feature flags
collapse into `Disabled`, `Direct`, or `ZshFork` mode before tool
planning.
- Updated tool selection so zsh-fork composition requires
`unified_exec`, `shell_zsh_fork`, and `unified_exec_zsh_fork`.
- Kept the existing standalone zsh-fork shell tool behavior when only
`shell_zsh_fork` is enabled.
- Updated config schema output for the new feature flag.

## Verification

- Added feature and tool-config coverage for the new gate.
- Added planner coverage proving `shell_zsh_fork` remains standalone
until composition is explicitly enabled.
- Ran focused tests for `codex-features`, `codex-tools`, and the
affected `codex-core` planner case.





---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/24979).
* #24982
* #24981
* #24980
* __->__ #24979
2026-06-01 13:01:36 -07:00
jif-oai
009e6c4817 fix: deflake zsh-fork approval test (#25669)
Fixes this flake:
https://github.com/openai/codex/actions/runs/26773809591/job/78919970410?pr=25659

This test is about zsh-fork subcommand approval behavior, not workspace
sandboxing, so it now runs with `DangerFullAccess` to avoid macOS
sandbox setup failures before the second subcommand approval.
2026-06-01 21:55:44 +02:00
starr-openai
53ac02356e exec-server: canonicalize bound filesystem paths (#25149)
## Summary
- add executor filesystem canonicalization as a bound-path operation
- route remote canonicalization through the exec-server filesystem RPC
surface
- keep path normalization attached to the filesystem that owns the path

## Stack
- 2/5 in the skills path authority stack extracted from
https://github.com/openai/codex/pull/25098
- follows merged https://github.com/openai/codex/pull/25121

## Validation
- `cd
/Users/starr/code/codex-worktrees/pr-25098-restack-review-pr1b/codex-rs
&& just fmt`
- Not run: tests/checks (not requested)
- GitHub CI pending on rewritten head
2026-06-01 11:53:31 -07:00
Won Park
f1609d9fb6 [codex-rs] auto-review model override (#23767)
## Why

Guardian auto-review normally uses the provider-preferred review model
when one is available. Some parent models need model-catalog metadata to
select a different review model while keeping older `/models` payloads
compatible when that metadata is absent.

## What changed

- Added optional `ModelInfo::auto_review_model_override` metadata to the
public model payload as a review-model slug.
- Updated Guardian review model selection to prefer the catalog override
when present, while preserving the existing provider preferred-model
path and parent-model fallback when it is omitted.
- Added focused Guardian coverage for override and no-override model
selection.
- Added an `auto_review` core integration suite test that loads override
metadata from a remote model catalog path and asserts the strict
auto-review `/responses` request uses the catalog-selected review model.
- Updated existing `ModelInfo` fixtures and local catalog constructors
for the new optional field.

## Validation

- `cargo test -p codex-protocol
model_info_defaults_availability_nux_to_none_when_omitted`
- `cargo test -p codex-core guardian_review_uses_`
- `cargo test -p codex-core
remote_model_override_uses_catalog_model_for_strict_auto_review --test
all`
- `just fix -p codex-protocol`
- `just fix -p codex-core`
- `just fmt`
- `git diff --check`
2026-06-01 11:51:15 -07:00
Adam Perry @ OpenAI
281b416c44 Check root Python script formatting in CI (#25165)
## Why

Python files under `scripts/` were not covered by the repository
formatting recipe or the CI formatting job, so formatting drift could
merge unnoticed.

## What

- Add a dedicated `scripts/pyproject.toml` and `scripts/uv.lock` so
root-script formatting uses a locked Ruff version.
- Extend `just fmt` to format root Python scripts and add
`fmt-scripts-check` for CI.
- Run `just fmt-scripts-check` from `.github/workflows/ci.yml`,
installing `uv` through SHA-pinned `astral-sh/setup-uv` while retaining
the `uv` `0.11.3` pin.
- Apply Ruff formatting to the root Python scripts, including
`scripts/just-shell.py`, and extend
`sdk/python/tests/test_artifact_workflow_and_binaries.py` to cover the
root formatting recipe.
- Update `AGENTS.md` so agents run `just fmt` after code changes
anywhere in the repository.

## Validation

- Extended the existing Python SDK workflow test to assert that `just
fmt` includes root Python scripts.
2026-06-01 18:50:23 +00:00
jif-oai
c3cdf3c007 Throttle repeated rollout compression runs (#25659)
## Why

[#25089](https://github.com/openai/codex/pull/25089) introduced the
background worker that compresses cold archived rollouts, and
[#25654](https://github.com/openai/codex/pull/25654) made that pass
faster once it starts. But the worker still deleted
`rollout-compression.lock` on successful exit, so the existing six-hour
staleness window only helped with overlapping or crashed workers. Each
new local thread-store initialization could immediately rescan archived
rollouts even if a full pass had just finished.

This change keeps the existing marker around long enough to throttle
redundant reruns. The worker is still best-effort, but it no longer does
repeated startup scans when nothing new is eligible for compression.

## What Changed

- Replace the drop-scoped `CompressionLock` with a
`CompressionRunMarker` that claims the existing
`.tmp/rollout-compression.lock` path and leaves it in place after
success.
- Reuse the existing six-hour staleness window to block both overlapping
starts and immediate reruns, while still letting a stale marker be
reclaimed.
- Update the worker docs and debug logging to describe the new "already
running or recently ran" behavior.
- Extend the rollout compression tests to assert that a successful run
leaves the marker behind and that a fresh marker suppresses a new run.

## Validation

- `just test -p codex-rollout`
2026-06-01 20:46:54 +02:00
Adam Perry @ OpenAI
ba2b67f9cd [codex] Consolidate shared prompts in codex-prompts (#25151)
## Why

`codex_core` is consistently a bottleneck for incremental builds during
iteration. The simplest fix is to make the crate smaller.

## Summary

`codex-core` owns several reusable prompt renderers and static prompt
assets, which makes the crate harder to split apart.

Rename `codex-review-prompts` to `codex-prompts` and move shared review,
goal, permissions, compaction, realtime, hierarchical AGENTS.md, and
`apply_patch` prompts into it. Move prompt-only tests and update
consumers and `CODEOWNERS`.

## Validation

- `just test -p codex-prompts -p codex-apply-patch`
- `just test -p codex-core prompt_caching`
- Bazel builds for the affected crates
2026-06-01 18:45:07 +00:00
iceweasel-oai
88c7a4ff07 [codex] Make justfile recipes Windows-aware (#24983)
## Summary

Make the root `justfile` usable from Windows without maintaining a
separate Windows copy of most recipes.

The repo recipes previously assumed POSIX shell behavior for things like
variadic argument forwarding (`"$@"`) and stderr redirection
(`2>/dev/null`). That made common workflows such as `just fmt`, `just
test`, and `just log` unreliable from Windows. This PR introduces a
small cross-platform shell adapter so recipes can stay mostly unified
while still expanding the few shell-specific constructs correctly on
macOS/Linux and Windows.

## What Changed

- Add `scripts/just-shell.py` as the configured `just` shell adapter.
  - On Unix it invokes `sh -cu`.
- On Windows it invokes `pwsh -CommandWithArgs` so arguments containing
spaces are preserved.
- Add portable recipe placeholders:
- `{args}` expands to `"$@"` on Unix and the equivalent PowerShell
forwarded-args expression on Windows.
- `{stderr-null}` expands to the platform-specific stderr suppression
used by `fmt`.
- Convert most variadic one-line recipes to the unified `{args}` form,
including `codex`, `exec`, `file-search`, `app-server-test-client`,
`fix`, `clippy`, `bench`, `mcp-server-run`, `write-app-server-schema`,
and `argument-comment-lint-from-source`.
- Keep genuinely shell-specific recipes split or Unix-only for now,
including recipes backed by `.sh` scripts or recipes whose bodies are
more than simple command forwarding.
- Add a Windows `just install` path that installs PowerShell via
`winget` when `pwsh` is not available, then runs the same basic Rust
setup steps.
- Update the SDK test that validates the root `fmt` recipe so it
recognizes the new portable stderr placeholder.

## Validation

- `just --summary`
- `just --dry-run fmt`
- `just --dry-run bench-smoke`
- `just --dry-run codex foo "bar binky" baz`
- `just --dry-run write-hooks-schema`
- `just --dry-run bazel-lock-update`
- `just --dry-run argument-comment-lint-from-source -- "foo bar"`
- `git diff --check -- justfile scripts/just-shell.py
sdk/python/tests/test_artifact_workflow_and_binaries.py`
- Verified Windows argv preservation through `scripts/just-shell.py`
with arguments containing spaces.
- `uv run --frozen --project sdk/python --extra dev pytest
sdk/python/tests/test_artifact_workflow_and_binaries.py::test_root_fmt_recipe_formats_rust_and_python_sdk`
2026-06-01 11:26:36 -07:00
charlesgong-openai
9756316d89 Preserve plugin app manifest order (#25491)
## Summary
- Preserve app declaration order when loading plugin .app.json files.
- Keep plugin connector summaries in plugin app order after connector
metadata is merged and filtered.
- Add regression coverage for .app.json order and connector summary
order.

## Validation
- just fmt
- just test -p codex-chatgpt
connectors_for_plugin_apps_returns_only_requested_plugin_apps
- just test -p codex-core-plugins
effective_apps_preserves_app_config_order
- just fix -p codex-core-plugins (passes with existing clippy
large_enum_variant warning in core-plugins/src/manifest.rs)
- just fix -p codex-chatgpt
- just bazel-lock-update
- just bazel-lock-check
2026-06-01 11:04:21 -07:00
jif-oai
6ddb747e76 [codex] Rename multi-agent v2 assign_task to followup_task (#25636)
## Summary

Renames the MultiAgentV2 turn-triggering tool from `assign_task` to
`followup_task` so the exposed tool name better describes sending an
additional task to an existing agent.

This updates the tool spec, handler/module names, registry wiring,
default multi-agent v2 usage hints, and tests. Rollout trace
classification keeps accepting legacy `assign_task` events so older
traces still reduce correctly, while docs show the new tool name.

## Test plan

- `just test -p codex-core followup_task`
- `just test -p codex-core -E
'test(multi_agent_feature_selects_one_agent_tool_family) |
test(multi_agent_v2_can_use_configured_tool_namespace) |
test(code_mode_only_can_expose_namespaced_multi_agent_v2_as_normal_tools)'`
- `just test -p codex-rollout-trace`
- `just fix -p codex-core`
- `just fix -p codex-rollout-trace`

Notes: `just fmt` ran `cargo fmt` but failed in the Python ruff phase
because the local environment could not resolve `hatchling>=1.27.0` from
the configured internal registry. A full `just test -p codex-core` also
hit unrelated environment-sensitive integration failures involving
missing spawned test binaries/sandbox behavior; the changed multi-agent
spec/handler tests passed in the filtered runs above.
2026-06-01 19:57:11 +02:00
starr-openai
fb94703b21 exec-server: add environment path refs (#25121)
## Summary
- add public `codex_exec_server::EnvironmentPathRef`
- bind an absolute path to its owning executor filesystem
- keep path operations in the next review slice

## Stack
- 1/5 in the skills path authority stack extracted from
https://github.com/openai/codex/pull/25098

## Validation
- `cd /Users/starr/code/codex-worktrees/pr-25098-restack4/codex-rs &&
just fmt`
- GitHub CI pending on rewritten head
2026-06-01 10:55:52 -07:00
jif-oai
917a9a41a3 Parallelize cold rollout compression (#25654)
## Why

[#25089](https://github.com/openai/codex/pull/25089) added the
background worker for compressing cold archived rollouts, but the worker
still processed files effectively one at a time: each compression job
was sent to `spawn_blocking` and then awaited before the next file
started. On machines with a backlog of archived rollouts, that makes
catch-up slower than it needs to be even though the actual compression
work already runs off the async runtime.

## What Changed

- Queue rollout compression work in a `JoinSet` while directory
traversal continues.
- Cap the worker at two in-flight compression jobs so it can overlap
compression without turning the background task into unbounded blocking
work.
- Drain pending jobs before returning, including the
`read_dir.next_entry()` error path, so every launched job still
contributes to the final `compressed`, `skipped`, and `failed` stats.
- Treat task join failures the same way as compression failures in the
worker's warning and failure accounting.
2026-06-01 19:54:52 +02:00