Commit Graph
6202 Commits
Author SHA1 Message Date
Cooper Gamble 9157458552 [codex] attribute app-server plugin HTTP state [ci changed_files] 2026-06-03 09:54:57 +00:00
Cooper Gamble b766a57ff1 [codex] add remote plugin HTTP state adapter [ci changed_files] 2026-06-03 09:54:55 +00:00
Cooper Gamble fb9d91415a [codex] attribute app-server ChatGPT HTTP state [ci changed_files] 2026-06-03 09:54:52 +00:00
Cooper Gamble 0fc80189bf [codex] add ChatGPT HTTP state adapter [ci changed_files] 2026-06-03 09:54:50 +00:00
Cooper Gamble 2fbbd204b4 [codex] cover session extension HTTP state [ci changed_files] 2026-06-03 09:54:48 +00:00
Cooper Gamble 5e52e5215f [codex] cover attributable backend HTTP state [ci changed_files] 2026-06-03 09:54:45 +00:00
Cooper Gamble 0301b5865b [codex] attribute model catalog HTTP state [ci changed_files] 2026-06-03 09:54:43 +00:00
Cooper Gamble 37a29a6195 [codex-login] persist attributable refresh HTTP state [ci changed_files] 2026-06-03 09:54:41 +00:00
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 Zamoshchinandjif-oai 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
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