Commit Graph

7097 Commits

Author SHA1 Message Date
Cooper Gamble
1c5ddd9234 [codex-app-server-transport] cover pairing HTTP state [ci changed_files] 2026-06-03 09:54:39 +00:00
Cooper Gamble
7236cfefa6 [codex-app-server-transport] cover remote control HTTP state routes [ci changed_files] 2026-06-03 09:54:39 +00:00
Cooper Gamble
4dd16dc182 [codex-login] isolate HTTP state tests [ci changed_files] 2026-06-03 09:54:36 +00:00
Cooper Gamble
cf81d6f8ff [codex-login] clear all native HTTP state on auth changes [ci changed_files] 2026-06-03 09:54:36 +00:00
Cooper Gamble
236fc646dc [codex-login] reset per-surface HTTP state on auth lifecycle [ci changed_files] 2026-06-03 09:54:36 +00:00
Cooper Gamble
b6fc0b7788 [codex] propagate realtime sideband HTTP state [ci changed_files] 2026-06-03 09:54:34 +00:00
Cooper Gamble
7a8d85f0cc [codex] guard native websocket state caches [ci changed_files] 2026-06-03 09:54:34 +00:00
Cooper Gamble
c1963a7f2e [codex] seed empty native HTTP state from responses [ci changed_files] 2026-06-03 09:54:34 +00:00
Cooper Gamble
0f121bccd5 [codex] wire per-surface integrity state transport [ci changed_files] 2026-06-03 09:54:34 +00:00
Cooper Gamble
e3f20c2b1e [codex] preserve native integrity state for Apps uploads [ci changed_files] 2026-06-03 09:54:34 +00:00
Cooper Gamble
5b6b61613b [codex] wire native integrity state surfaces [ci changed_files] 2026-06-03 09:54:34 +00:00
Cooper Gamble
b2df930c51 [codex-api] cover websocket auth propagation [ci changed_files] 2026-06-03 09:54:31 +00:00
Cooper Gamble
f9968c36f4 [codex-api] isolate websocket auth tests [ci changed_files] 2026-06-03 09:54:31 +00:00
Cooper Gamble
28a8d44f19 [codex-api] isolate websocket auth state handling [ci changed_files] 2026-06-03 09:54:31 +00:00
Cooper Gamble
f19437e5cc [codex-api] keep websocket auth hook fixtures generic [ci changed_files] 2026-06-03 09:54:31 +00:00
Cooper Gamble
e29ffd253d [codex-api] preserve chained websocket auth updates [ci changed_files] 2026-06-03 09:54:31 +00:00
Cooper Gamble
3cc856b560 [codex-api] observe auth state on responses websockets [ci changed_files] 2026-06-03 09:54:31 +00:00
Cooper Gamble
2bd99fac8d [codex-api] keep URL-scoped auth hooks protocol agnostic [ci changed_files] 2026-06-03 09:54:29 +00:00
Cooper Gamble
6f6286c89e [codex-api] split websocket auth hooks into follow-up [ci changed_files] 2026-06-03 09:54:29 +00:00
Cooper Gamble
5751746eb2 [codex-api] label auth hook test arguments [ci changed_files] 2026-06-03 09:54:29 +00:00
Cooper Gamble
6b2c4e8475 [codex-api] cover native state transport bypasses [ci changed_files] 2026-06-03 09:54:29 +00:00
Cooper Gamble
f98c7c473b [codex-api] cover auth hooks through endpoint sessions [ci changed_files] 2026-06-03 09:54:29 +00:00
Cooper Gamble
11c6f792f1 [codex-api] use pretty assertions in session test [ci changed_files] 2026-06-03 09:54:29 +00:00
Cooper Gamble
b8da8fae13 [codex-api] add URL-scoped auth state hooks [ci changed_files] 2026-06-03 09:54:29 +00:00
Cooper Gamble
4019ae532e [codex-app-server] declare HTTP state dependency at first use [ci changed_files] 2026-06-03 09:54:26 +00:00
Cooper Gamble
e28a011148 [codex-app-server] expose generic per-surface HTTP state bridge [ci changed_files] 2026-06-03 09:54:26 +00:00
Cooper Gamble
9d4ba776cd [codex-app-server] test stable native integrity state bridge [ci changed_files] 2026-06-03 09:54:26 +00:00
Cooper Gamble
ed56159a0c [codex-app-server] stabilize native integrity state bridge [ci changed_files] 2026-06-03 09:54:26 +00:00
Cooper Gamble
546dcbf0a4 [codex-app-server] add native integrity state bridge [ci changed_files] 2026-06-03 09:54:26 +00:00
Cooper Gamble
5a4e9d0293 [codex-http-state] add Bazel crate target [ci changed_files] 2026-06-03 09:54:11 +00:00
Cooper Gamble
475734ea2e [codex-http-state] keep per-surface store protocol agnostic [ci changed_files] 2026-06-03 02:25:30 +00:00
Cooper Gamble
e943a052a8 [codex-http-state] extract generic per-surface HTTP state store [ci changed_files] 2026-06-03 02:11:07 +00:00
Cooper Gamble
d0b19e41e5 [codex-client] add native integrity state store [ci changed_files] 2026-06-02 19:55:08 +00:00
Adam Perry @ OpenAI
ebb7980369 Route Bazel CI through shared BuildBuddy remote config wrapper (#25156)
## Why

Bazel remote configuration was selected in several CI scripts and
workflow steps. That made the BuildBuddy tenant policy easy to duplicate
and harder to audit, especially for fork pull requests that must not use
the OpenAI tenant.

This builds on
[sluongng/buildbuddy-ci-host-routing](https://github.com/openai/codex/compare/main...sluongng:codex:sluongng/buildbuddy-ci-host-routing)
and consolidates the policy in one place.

## What to do if this breaks you

See `codex-rs/docs/bazel.md` for details. TLDR:

1. make a BuildBuddy API key and put it in `~/.bazelrc`
2. if you're an OpenAI employee, add `common
--config=buildbuddy-openai-rbe` to `user.bazelrc` in the repo root

Run `just bazel-test` to ensure it works.

Note that `just bazel-remote-test` no longer exists, you need to select
a remote configuration as documented to use RBE.

## What changed

- Add `.github/scripts/run_bazel_with_buildbuddy.py` as the shared Bazel
wrapper and Python library. It selects the OpenAI host only for trusted
upstream GitHub Actions runs, routes keyed fork runs to the generic
host, and falls back to local Bazel execution when no key is available.
- Move endpoint selection into explicit `.bazelrc` configurations and
update Bazel CI, query helpers, and `rusty_v8` staging to use the shared
policy. Loading-phase target-discovery queries remain local.
- Add wrapper and `rusty_v8` unit coverage, plus `just test-scripts` for
the `.github/scripts` Python tests.
- Document local Bazel usage, `user.bazelrc` setup, BuildBuddy
configurations, and CI behavior in `codex-rs/docs/bazel.md`.

## Validation

- `just test-scripts`
- `bash -n .github/scripts/run-bazel-ci.sh
.github/scripts/run-bazel-query-ci.sh
.github/scripts/run-argument-comment-lint-bazel.sh
scripts/list-bazel-clippy-targets.sh`
- `python3 -m py_compile .github/scripts/run_bazel_with_buildbuddy.py
.github/scripts/test_run_bazel_with_buildbuddy.py
.github/scripts/test_rusty_v8_bazel.py
.github/scripts/rusty_v8_bazel.py`
- `ruff check .github/scripts/run_bazel_with_buildbuddy.py
.github/scripts/test_run_bazel_with_buildbuddy.py
.github/scripts/test_rusty_v8_bazel.py
.github/scripts/rusty_v8_bazel.py`
2026-06-02 09:56:20 -07:00
jif
859dbe2761 Skip startup prewarm when websockets are disabled (#25868)
## Summary
- skip startup websocket prewarm setup when the model client has
Responses-over-WebSocket disabled
- avoid making HTTP-only sessions build prewarm prompt/tool state that
cannot produce a reusable websocket session

## Why
Recent macOS timing flakes were timing out while waiting for first-turn
events in HTTP-only core tests. Startup prewarm is only useful for
websocket-capable providers, but it was scheduled for every session. For
HTTP-only test providers this added unnecessary async startup work
before the regular turn could reach the mocked response flow.

## Testing
- bazel test //codex-rs/core:core-all-test
--test_filter=suite::auto_review::remote_model_override_uses_catalog_model_for_strict_auto_review
--test_output=errors
- bazel test //codex-rs/core:core-all-test
--test_filter=suite::request_permissions_tool::approved_folder_write_request_permissions_unblocks_later_apply_patch
--test_output=errors
2026-06-02 17:27:30 +02:00
Alex Zamoshchin
4d80d808b4 [app-server][core] Add connector-level Guardian reviewer overrides (#25167)
Context: https://openai.slack.com/archives/C0B4JAF0Q2C/p1779912328647229

```
approvals_reviewer = "auto_review"

[apps.connector_5f3c8c41a1e54ad7a76272c89e2554fa]
enabled = true
approvals_reviewer = "user"
default_tools_approval_mode = "prompt"
```

<img width="230" height="84" alt="Screenshot 2026-05-31 at 11 56 34 AM"
src="https://github.com/user-attachments/assets/e319f8f7-0983-42a7-98cd-3302732fa406"
/>

<img width="841" height="233" alt="Screenshot 2026-05-31 at 11 52 42 AM"
src="https://github.com/user-attachments/assets/7ac76645-4e90-4d00-8242-f031146a22a5"
/>

-------

```
approvals_reviewer = "user"

[apps.connector_5f3c8c41a1e54ad7a76272c89e2554fa]
enabled = true
approvals_reviewer = "auto_review"
default_tools_approval_mode = "prompt"
```
<img width="195" height="83" alt="Screenshot 2026-05-31 at 12 02 27 PM"
src="https://github.com/user-attachments/assets/3d374dc8-8aa2-466f-a13f-e4ed8567aa2e"
/>
<img width="771" height="207" alt="Screenshot 2026-05-31 at 12 05 42 PM"
src="https://github.com/user-attachments/assets/105c2575-68d6-4ca6-8e69-dc8c82da36a2"
/>



## Summary
- add `apps.<connector_id>.approvals_reviewer` to override Guardian or
user review routing per connected app
- apply overrides across direct app MCP calls, delegated MCP prompts,
and app-server MCP elicitation review while preserving global behavior
for non-app MCP servers
- expose and document the config through app-server v2 and generated
schemas, while honoring global managed reviewer requirements

---------

Co-authored-by: jif-oai <jif@openai.com>
2026-06-02 17:04:11 +02:00
Adam Perry @ OpenAI
c097ad3e9e [codex] Use git CLI for Cargo fetches across Rust workflows (#25775)
## Why
Cargo's libgit2 transport has intermittently failed while fetching git
dependencies with nested submodules.
[#25644](https://github.com/openai/codex/pull/25644) applied
`CARGO_NET_GIT_FETCH_WITH_CLI=true` to the main Rust release build after
macOS SecureTransport/libgit2 failures while cloning `libwebrtc`'s
nested `libyuv` submodule. Similar flakes can affect other Cargo-bearing
Rust jobs.

## What changed
Configure `CARGO_NET_GIT_FETCH_WITH_CLI=true` at workflow scope for the
remaining Cargo-bearing Rust workflows:

- fast Rust CI and `cargo-deny`
- reusable Windows and argument-comment-lint release workflows
- `rusty-v8-release` and `v8-canary` Cargo builds and smoke tests

The full Rust CI, reusable nextest workflow, and primary Rust release
build already had the override. Bazel-only workflows are unchanged
because they use a different dependency fetch path.

## Validation
- Parsed all `.github/workflows/*.yml` files as YAML.
- Scanned Cargo-bearing workflows to confirm they configure
`CARGO_NET_GIT_FETCH_WITH_CLI`.
2026-06-02 07:39:41 -07:00
jif
3766941161 Run Codex async main on a sized stack (#25847)
## Why

`Runtime::block_on` executes the top-level future on the caller's OS
thread, not on one of Tokio's worker threads. That matters for the
interactive CLI because the Tokio runtime already configures larger
worker stacks, while the process main thread can still have a smaller
platform default stack.

This showed up as a `/clear` crash on macOS: starting a fresh TUI thread
reloads config, and the stack-heavy TOML deserialization path can
overflow before the new session is actually started.

## What Changed

- Run the regular `arg0_dispatch_or_else` async entrypoint on a named
`codex-main` thread.
- Give that thread the same `TOKIO_WORKER_STACK_SIZE_BYTES` stack budget
already used for Tokio worker threads.
- Keep `Arg0DispatchPaths` and the arg0 alias guard lifetime behavior
the same.
- Resume panics from the spawned main thread so panic behavior is
preserved.

## Verification

- `cargo check -p codex-cli` currently fails because the top-level
CLI/TUI future is not `Send` under the new thread boundary.
2026-06-02 16:34:48 +02:00
jif
b9af5d1234 flake: Keep plugin test homes alive (#25857)
## Summary

Keep the full `TestCodex` harness alive in plugin integration tests
instead of returning only the `CodexThread`.

## Why

The helper was moving a temporary `codex_home` into `TestCodex`, then
immediately dropping the harness and returning only the thread. For
plugin MCP tests, the MCP server cwd is inside that temporary home. If
the temp directory is removed while MCP startup is still racing, the
server launch can fail with `No such file or directory`.

Keeping the harness in scope keeps the temp home alive for the test
duration and removes the lifetime race behind the recent
`explicit_plugin_mentions_inject_plugin_guidance` flake.

## Validation

- `just fmt`
- `just test -p codex-core
explicit_plugin_mentions_inject_plugin_guidance`
2026-06-02 16:21:22 +02:00
jif-oai
1dd731305a Reduce stack pressure in session startup and config rebuilds (#25844)
## Why

`/clear` starts a fresh thread with `InitialHistory::Cleared`, which
re-enters the thread/session startup path. That path now builds large
async futures through `ThreadManagerState::spawn_thread_with_source`,
`Codex::spawn`, and `Session::new`. Separately, TUI config rebuilds for
cwd and permission-profile changes build a similarly heavy
`ConfigBuilder::build()` future inside the app task. In debug and Bazel
runs, those call chains can put enough state on the caller stack to
abort before startup or config refresh completes.

This change keeps the behavior the same while moving the heaviest future
frames off the caller stack.

## What changed

- Box `Codex::spawn(...)` in `codex-rs/core/src/thread_manager.rs`
before awaiting it from `spawn_thread_with_source`.
- Box `Session::new(...)` in `codex-rs/core/src/session/mod.rs` before
awaiting it from `Codex::spawn_internal`.
- Route `ConfigBuilder::build()` through a small `tokio::spawn` helper
in `codex-rs/tui/src/app/config_persistence.rs` so cwd and
permission-profile config rebuilds run on a runtime worker stack while
preserving error context.

## Verification

CI is running on the PR.

No new targeted tests were added. This is a mechanical stack-pressure
reduction that keeps the existing behavior and error propagation intact.
2026-06-02 15:42:47 +02:00
jif-oai
33273e4258 Test runtime selector before first turn (#25724)
Stack split from #25708. Original PR intentionally left open. This fifth
PR adds coverage that a remotely selected multi-agent runtime is applied
when the model is selected before the first turn.
2026-06-02 15:01:10 +02:00
jif-oai
66991c949f Test remote multi-agent runtime selector override (#25723)
Stack split from #25708. Original PR intentionally left open. This
fourth PR adds coverage that remote model multi-agent runtime selectors
override local feature flag defaults.
2026-06-02 14:48:13 +02:00
jif-oai
06e9a33d09 fix: main oops (#25840)
Fix main, comment is self-explainatory
2026-06-02 14:48:04 +02:00
jif-oai
3cf6f08da5 session: keep startup prewarm aligned with resolved multi-agent runtime (#25841)
## Why

Follow-up to #25722. Startup prewarm builds a preview `TurnContext`
before the first real turn so it can precompute the initial prompt and
tool surface. After the per-thread runtime work landed, that preview
path still recomputed multi-agent mode from `model_info` and feature
defaults instead of reusing the runtime the session had already resolved
from persisted metadata or inheritance.

That could leave the prewarmed session primed for a different
multi-agent mode than the first real turn, which is especially risky
because collaboration tool exposure depends on
`turn_context.multi_agent_version`.

## What changed

- In the `TurnMultiAgentRuntime::Preview` path, prefer
`Session::multi_agent_version()` when it is already known.
- Only fall back to `model_info.multi_agent_version` and feature
defaults when the session has not resolved a runtime yet.
- Keep preview mode read-only: this still avoids storing a runtime
during startup prewarm.

## Testing

- Not run (small runtime-selection follow-up)
2026-06-02 14:35:26 +02:00
jif-oai
bf9fd885b2 Resolve per-thread multi-agent runtime (#25722)
Stack split from #25708. Original PR intentionally left open. This third
PR resolves the effective per-thread multi-agent runtime from persisted
metadata, inherited runtime, and current model selection.
2026-06-02 14:31:00 +02:00
jif-oai
0c5ccd18ab Persist multi-agent runtime metadata (#25721)
Stack split from #25708. Original PR intentionally left open. This
second PR persists multi-agent runtime metadata through thread creation,
rollout recording, and thread storage.
2026-06-02 13:05:20 +02:00
jif-oai
3f1fb7ed8b Add multi-agent runtime metadata types (#25720)
Stack split from #25708. Original PR intentionally left open. This first
PR adds the multi-agent runtime metadata types and catalog plumbing used
by the rest of the stack.
2026-06-02 12:10:14 +02:00
jif-oai
45912a6dc6 feat: reuse compressed rollout search snippets (#25814)
## Summary
- teach rollout search to return precomputed snippets for compressed
rollouts
- reuse those snippets in local thread search instead of reopening
matching compressed files
- keep the no-`rg` fallback single-pass and add regression coverage for
the compressed path

## Why
`thread/search` currently decodes matching compressed rollouts twice:
once to discover the matching path and again to extract the snippet
shown in results. That defeats a meaningful part of the compressed-read
optimization work.

## Impact
Compressed rollout hits now pay one decode pass on the search path while
plain `.jsonl` hits keep the existing ripgrep-driven flow.

## Validation
- `just test -p codex-rollout`
- `just test -p codex-thread-store`
- `just fix -p codex-rollout`
- `just fix -p codex-thread-store`
- `just fmt`
2026-06-02 11:32:36 +02:00
xl-openai
67b805fc11 [codex] Validate plugin skill base names (#25782)
## Summary

- Validate skill base name length before plugin namespacing.
- Bound the composed `plugin:skill` qualified name to 128 characters.
- Keep plugin skill runtime names in the existing `plugin:skill` form.
- Add regression tests for the max qualified-name boundary and rejection
path.

## Root Cause

Plugin skills are represented as `plugin_name:skill_name`, but the
loader previously applied the 64-character skill name limit after adding
the plugin namespace. Moving that check to the base name fixes valid
plugin skills with longer namespaces, and the separate 128-character
qualified-name limit keeps model-visible skill names bounded.

## Validation

- `just fmt`
- `just test -p codex-core-skills plugin_skill_name_length_limit`
- `git diff --check`
2026-06-02 06:33:02 +00:00
xl-openai
07f04cc3c7 [codex] Move plugin discoverable logic into core-plugins (#25783)
## Summary
- Move plugin discoverable recommendation filtering from `codex-core`
into `codex-core-plugins` behind `ToolSuggestPluginDiscoveryInput`.
- Keep `codex-core` as a thin adapter from `Config` to the core-plugins
API and back to `DiscoverablePluginInfo`.
- Keep the existing discoverable allowlist private to the core-plugins
implementation.

## Validation
- `just fmt`
- `just test -p codex-core list_tool_suggest_discoverable_plugins`
- `git diff --check`
- Read-only subagent review: no findings
2026-06-01 23:25:37 -07:00