Commit Graph
18273 Commits
Author SHA1 Message Date
Michael Bolin 6325916d67 merge commit for archive created by Sapling 2026-07-07 10:35:36 -07:00
Michael Bolin f772483244 build: ratchet direct reqwest dependencies 2026-07-07 10:34:40 -07:00
Michael Bolin 820f875bbc codex-api: route file uploads through HTTP client factory 2026-07-07 10:34:40 -07:00
Michael Bolin 0797b7d6e5 core: route realtime and memories through HTTP client factory 2026-07-07 10:34:40 -07:00
Michael Bolin 1c63ae4684 model-provider: route model discovery through HTTP client factory 2026-07-07 10:34:40 -07:00
Michael Bolin bfcf2b350f core: test Responses WebSockets with system proxy 2026-07-07 10:34:36 -07:00
Michael Bolin 44bcd653c6 core: preserve Responses WebSockets with system proxy 2026-07-07 10:34:31 -07:00
Michael Bolin 5b34af0ab6 http-client: expose WebSocket proxy prerequisites 2026-07-07 10:34:11 -07:00
Michael Bolin 9f27231b1b Merge 6de585215e into sapling-pr-archive-bolinfest 2026-07-07 10:17:08 -07:00
Michael Bolin 6de585215e build: ratchet direct reqwest dependencies 2026-07-07 10:16:25 -07:00
Michael Bolin a1bf1cc725 codex-api: route file uploads through HTTP client factory 2026-07-07 10:16:25 -07:00
Michael Bolin e1f37947a7 core: route realtime and memories through HTTP client factory 2026-07-07 10:16:25 -07:00
Michael Bolin 11a2bdaf0a model-provider: route model discovery through HTTP client factory 2026-07-07 10:16:25 -07:00
Michael Bolin 7409481cf2 core: preserve Responses WebSockets with system proxy 2026-07-07 10:16:25 -07:00
Michael Bolin 4b418ecfe0 Merge 2292119fcc into sapling-pr-archive-bolinfest 2026-07-07 09:30:50 -07:00
Michael Bolin 2292119fcc build: ratchet direct reqwest dependencies 2026-07-07 09:30:38 -07:00
Michael Bolin 1fdb1bd0c0 Merge 3a24f83d83 into sapling-pr-archive-bolinfest 2026-07-06 21:55:51 -07:00
Michael Bolin 3a24f83d83 codex-api: route file uploads through HTTP client factory 2026-07-06 21:55:41 -07:00
Michael Bolin f8d1d62a87 Merge 5cb48b910e into sapling-pr-archive-bolinfest 2026-07-06 21:51:57 -07:00
Michael Bolin 5cb48b910e core: route realtime and memories through HTTP client factory 2026-07-06 21:51:48 -07:00
Michael Bolin 91d32cdb3c Merge ba9ccf89d0 into sapling-pr-archive-bolinfest 2026-07-06 21:48:16 -07:00
Michael Bolin ba9ccf89d0 model-provider: route model discovery through HTTP client factory 2026-07-06 21:48:04 -07:00
Michael Bolin cf5ca70a7d Merge e061022857 into sapling-pr-archive-bolinfest 2026-07-06 20:51:42 -07:00
Michael Bolin e061022857 core: use HTTP Responses with system proxy 2026-07-06 20:50:51 -07:00
Michael Bolin 6afcf26d5d core: route Responses API through system proxy (#31335)
## Why

`features.respect_system_proxy` already routes authentication traffic
through the OS proxy APIs, but it does not affect the primary inference
path. That leaves users behind OS-managed proxies unable to send normal
Responses API requests even after login succeeds.

This PR is the first product-path migration onto the route-aware
transport introduced in #31323 and refined in #31331. It also
establishes the construction pattern for later migrations: the effective
feature state is resolved once into a required HTTP client factory
rather than represented by an optional per-call setting.

The scope remains limited to the two HTTP Responses endpoints;
WebSockets, model discovery, memories, realtime, and file uploads remain
follow-up migrations.

## What changed

- Replace the optional proxy marker with an explicit
`OutboundProxyPolicy::{ReqwestDefault, RespectSystemProxy}` and a
required `HttpClientFactory`. The policy has no default, and the
lower-level route-aware reqwest builder is now private.
- Have `Config` construct the factory from the effective feature state
and require every `ModelClient` constructor to receive it. There is no
optional setter or implicit `None` fallback.
- Build HTTP clients for `/responses` and `/responses/compact` with
`ClientRouteClass::Api`, using the complete destination URL so PAC rules
can make URL-specific decisions.
- Layer route-aware selection onto Codex's existing default headers,
Cloudflare cookie store, custom CA handling, and sandbox no-proxy
behavior.
- Add an integration test that loads `features.respect_system_proxy`
through `config.toml`, creates a real Codex session, and verifies that
both a normal Responses turn and remote compaction reach an isolated
local proxy.

## Review guide

1. `http-client/src/outbound_proxy.rs` defines the mandatory
policy/factory boundary and keeps route resolution private.
2. `core/src/config/mod.rs`, `core/src/session/session.rs`, and
`core/src/client.rs` show the compile-time invariant: effective config
creates the factory, and `ModelClient` cannot be constructed without
one.
3. `login/src/auth/default_client.rs` preserves existing default-client
behavior while accepting the required factory for migrated routes.
4. `core/src/client.rs` switches only streaming Responses and remote
compaction HTTP transports to the API route class.
5. `core/tests/suite/responses_api_system_proxy.rs` is the behavioral
regression boundary. Its Linux subprocess deliberately sets the CGI
marker that disables reqwest's implicit environment-proxy handling, so
the test fails if session wiring or either Responses call site falls
back to the default client.

## Test plan

- `cargo check --tests -p codex-http-client -p codex-login -p
codex-core`
- `just test -p codex-login`
- `just test -p codex-core
respect_system_proxy_feature_resolves_enabled`
- Existing `compact_uses_bearer_after_agent_identity_session_fallback`
coverage passes with the new transport construction.
- New Linux integration coverage:
`responses_and_compact_use_enabled_system_proxy`
- `just bazel-lock-check`

---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/31335).
* #31342
* __->__ #31335
2026-07-07 03:49:53 +00:00
Owen Lin b9b934e99b refactor(protocol): map canonical tool items to legacy events (#31296)
## Description

This PR adds legacy `EventMsg` mappings for the `TurnItem` types
introduced in [#30282](https://github.com/openai/codex/pull/30282):

- `CommandExecution`
- `DynamicToolCall`
- `CollabAgentToolCall`
- `SubAgentActivity`

When their producers move to canonical `ItemStarted` / `ItemCompleted`,
raw core event consumers can still receive the existing begin/end-style
events. The canonical item lifecycle remains the live source of truth.

We also record the mapped legacy events in rollout trace so the producer
migration preserves the existing tool-runtime trace entries.

## Why

This is the compatibility layer for the follow-up producer migrations.
Splitting it out first keeps each producer PR small and keeps the legacy
mapping in one place.

## What changed

- Added `TurnItem` → legacy `EventMsg` mappings in
`protocol/src/legacy_events.rs`.
- Added the command execution status conversion used by the exec
mapping.
- Added focused coverage for command execution and dynamic tool
mappings.
2026-07-06 20:41:57 -07:00
Michael Bolin 5b9fbf1d88 Merge 94cecddf8a into sapling-pr-archive-bolinfest 2026-07-06 20:33:40 -07:00
Michael Bolin 94cecddf8a core: use HTTP Responses with system proxy 2026-07-06 20:33:22 -07:00
Michael Bolin c6c9f051a2 core: route Responses API through system proxy 2026-07-06 20:33:22 -07:00
Michael Bolin 9365b08467 exec-server: use virtual time in Noise relay test (#31344)
## Why

`fragmented_writes_yield_to_keepalive_and_queued_pong` deliberately
blocks WebSocket writes while exercising keepalive and queued-Pong
scheduling. It previously advanced those states with wall-clock sleeps.
Under a sufficiently delayed CI worker, those sleeps and scheduling gaps
could consume the test-only 100 ms Pong-watchdog budget, causing the
relay to exit and the next write-permit send to fail with
`TrySendError::Disconnected`.

The failure was therefore a timing flake in the harness test, not
evidence that the production relay mishandled a Pong.

## What changed

- Run this test with Tokio time paused.
- Advance the virtual clock through its two keepalive transitions
instead of sleeping in wall-clock time.
- Enable Tokio's `test-util` feature only for `codex-exec-server` dev
dependencies.

No production code or timeout values change.

## Review guide

The behavioral change is confined to `noise_relay/harness_tests.rs`; the
`Cargo.toml` change only exposes Tokio's paused-clock test APIs.

## Validation

- `just test -p codex-exec-server
fragmented_writes_yield_to_keepalive_and_queued_pong`
- `just fix -p codex-exec-server`
- `just bazel-lock-update` (no lockfile changes)
2026-07-06 20:25:33 -07:00
ashwinnathan-openai 775ef7dcc7 [codex] Support sequential cutoff reasoning summaries (#31306)
## Summary

When enabled for the OpenAI provider, Codex sends
`stream_options.reasoning_summary_delivery = "sequential_cutoff"` on
HTTP and
WebSocket requests, including prewarm, and renders completed summary
sections
from `reasoning_summary_text.done`. Flag-off and non-OpenAI behavior is
unchanged.

## Expected rollout

```text
reasoning 0 added
summary 0 done
summary 1 done
summary 2 starts
summary 2 cancelled / incomplete
reasoning 0 done  <-- cancel summary 2 work and mark it incomplete
message 1 added
message 1 text streams
message 1 completed
```

Depends on
[openai/openai#1096660](https://github.com/openai/openai/pull/1096660).
2026-07-06 23:23:56 -04:00
Michael Bolin fb9665a066 merge commit for archive created by Sapling 2026-07-06 20:22:44 -07:00
Michael Bolin 4ef7e9a38d core: use HTTP Responses with system proxy 2026-07-06 20:21:53 -07:00
Michael Bolin 084de8fc17 core: route Responses API through system proxy 2026-07-06 20:21:53 -07:00
Michael Bolin 798f22a5d1 Merge 8a65be5e83 into sapling-pr-archive-bolinfest 2026-07-06 20:10:22 -07:00
Michael Bolin 8a65be5e83 exec-server: use virtual time in Noise relay test 2026-07-06 20:10:13 -07:00
Michael Bolin f944f3814c Merge 4cf1dfeb68 into sapling-pr-archive-bolinfest 2026-07-06 19:45:37 -07:00
Michael Bolin 4cf1dfeb68 core: use HTTP Responses with system proxy 2026-07-06 19:45:18 -07:00
Michael Bolin 80f073e0a3 Merge a1bbf86ab7 into sapling-pr-archive-bolinfest 2026-07-06 19:37:12 -07:00
Michael Bolin a1bbf86ab7 core: route Responses API through system proxy 2026-07-06 19:37:02 -07:00
Michael Bolin 45cb24bbb4 merge commit for archive created by Sapling 2026-07-06 19:34:16 -07:00
Michael Bolin c36a8e3082 core: route Responses API through system proxy 2026-07-06 19:34:07 -07:00
Eric Traut 831c14fc39 Preserve managed exec policy after rules parse errors (#31188)
## Why

Cleanup for #31179 exposed a core fallback bug that the TUI had been
handling locally. When a custom `.rules` file fails to parse, nonfatal
clients warn and continue, but `load_exec_policy_with_warning` replaced
the entire policy with `Policy::empty()` before managed requirements
were merged. App-server and desktop clients could therefore silently
lose required prompt and forbidden rules.

This fix is intentionally separate from #31179 so the TUI cleanup does
not depend on it.

## What changed

- Preserve the managed requirements exec policy when custom file rules
fail to parse, while returning the existing warning and discarding the
file-based policy.
- Use the same nonfatal fallback when loading network proxy policy.
- Keep parse errors fatal for strict clients such as `codex exec`.
2026-07-06 19:28:44 -07:00
Michael Bolin 0e52b5acbe merge commit for archive created by Sapling 2026-07-06 19:17:49 -07:00
Michael Bolin f4dcd4ca5b core: route Responses API through system proxy 2026-07-06 19:17:33 -07:00
Michael Bolin e7a7420f96 merge commit for archive created by Sapling 2026-07-06 19:11:13 -07:00
Michael Bolin ad2d1e01e5 core: route Responses API through system proxy 2026-07-06 19:10:46 -07:00
Adam Perry @ OpenAI 8f3431054f fix: restore Codex environment setup table (#31337)
## Why

Creating a Codex worktree skips local environment setup because
`.codex/environments/environment.toml` omits the required `setup`
object.

## What

Restore an empty `[setup]` table with `script = ""`, preserving the
intended no-op setup while satisfying the environment parser schema.

## Validation

- Parsed the final TOML and verified `setup.script` is present as a
string.
2026-07-07 02:08:50 +00:00
Michael Bolin 57f3d9c58c Merge d16339257e into sapling-pr-archive-bolinfest 2026-07-06 18:49:55 -07:00
Michael Bolin d16339257e core: route Responses API through system proxy 2026-07-06 18:49:49 -07:00