Commit Graph

8680 Commits

Author SHA1 Message Date
celia-oai
a6db224007 Preserve URL coverage in protocol error test 2026-07-28 17:22:59 -07:00
celia-oai
9371cd7209 Migrate codex-protocol to shared HTTP types 2026-07-28 17:14:25 -07:00
iceweasel-oai
101d6b8cb2 Preserve foreign paths in background terminal listings (#35850)
## Why

Background terminal working directories can use a path convention from a
different platform than the app-server host. Converting them to host-native
absolute paths can reject otherwise valid terminal entries and fail the list
request.

## What changed

- Represent `ThreadBackgroundTerminal.cwd` with `LegacyAppPathString` at the
  protocol boundary.
- Convert terminal `PathUri` values directly to their inferred native path
  strings instead of validating them against the host platform.

## Testing

Add protocol round-trip coverage for POSIX, Windows drive, and Windows UNC
working directories.

GitOrigin-RevId: d766d54bdc191e75955fb419bec6e60c65f52298
2026-07-29 00:09:15 +00:00
jif
03edf16f0b Support plaintext collaboration tool messages (#35845)
## What changed

- Preserve `encrypted_function_args` on function calls so an empty list can mark plaintext collaboration arguments across request replay.
- Deliver `spawn_agent`, `send_message`, and `followup_task` payloads as structured plaintext agent messages when that marker is present; retain encrypted delivery otherwise.
- Redact plaintext collaboration arguments from tool and communication logs, and omit the metadata when sending requests to non-OpenAI providers.

## Testing

- Cover serialization of empty encrypted-argument metadata and plaintext versus encrypted subagent message delivery.
- Verify plaintext tool arguments are redacted and provider-specific metadata is removed from non-OpenAI requests.

GitOrigin-RevId: 64db98ff0b61a3af2f04ed609292363f2e2362a8
2026-07-28 23:49:37 +00:00
Alexi Christakis
166658a34a Tie remote exec servers to their parent stdin (#35843)
## What changed

- Add `--exit-on-stdin-close` and the `CODEX_EXEC_SERVER_EXIT_ON_STDIN_CLOSE` environment variable as opt-in controls for remote exec servers.
- Gracefully drain active sessions and processes when the parent closes stdin, then flush telemetry before exiting.
- Remove the parent-lifetime environment variable from child process environments.

## Testing

- Cover parent disconnects after signal-listener failures.
- Exercise remote shutdown end to end, including child termination and final telemetry metrics.
- Verify that explicitly disabling the environment variable preserves local exec-server behavior.

GitOrigin-RevId: 63063bc097b54684c370bd545cd32d17c4e55d90
2026-07-28 23:27:46 +00:00
thomas
9f4c20aadc Handle legacy MCP discovery prevalidation errors (#35840)
## Why

Some legacy MCP servers reject `server/discover` before creating a session and
return a null-ID JSON-RPC error with a non-JSON content type or without echoing
the rejected protocol version. These responses prevented the client from
falling back to legacy initialization.

## What changed

- Parse HTTP 400 discovery errors without a session ID regardless of their
  declared content type.
- Fall back to `initialize` when error code `-32000` reports a missing session
  or advertises only known legacy protocol versions, including supported
  versions other than `2025-06-18`.
- Continue rejecting unrelated error codes, correlated responses, non-400
  statuses, malformed version lists, and lists containing modern or unknown
  versions.

## Testing

Added MCP discovery coverage for legacy error variants, server-selected legacy
protocol versions, non-JSON content types, and non-legacy rejection cases.

GitOrigin-RevId: 4d3ee2d7d852ce0d0ab3f486da23cb653a7ff5ca
2026-07-28 22:57:09 +00:00
Alex Daley
3a797496f1 Decouple recommended plugins from tool suggestions (#35839)
## What changed

- Add the stable, disabled-by-default `recommended_plugins` feature flag.
- Load recommended plugin candidates when apps and plugins are enabled and
  either `tool_suggest` or `recommended_plugins` is active.
- Keep the `request_plugin_install` tool gated by `tool_suggest`.

## Testing

- Cover the first turn after external login with `tool_suggest` both enabled
  and disabled, including the expected install-tool availability.

GitOrigin-RevId: 06d9a1c2e8dd2498a47796d833eb6d25ba528351
2026-07-28 22:53:33 +00:00
Eric Ning
12b961d4c5 Expose plugin eligibility metadata in app-server summaries (#35837)
## What changed

- Add nullable `disabledReason` and `eligiblePlanTypes` fields to v2
  `PluginSummary` responses and generated schemas.
- Preserve the remote catalog values across discovered, installed, and cached
  plugin summary paths while returning `null` for local plugins and older
  remote responses.
- Treat unrecognized disabled reasons as `unknown` for forward compatibility.

## Testing

- Cover protocol round trips, remote summary propagation, unknown disabled
  reasons, and app-server responses for admin-disabled and plan-ineligible
  plugins.

GitOrigin-RevId: 657a7ea6f838a6ff8bd1769ebcca0f3432684437
2026-07-28 22:28:08 +00:00
jif
c550cb3e01 Clean up cancelled MCP elicitation requests (#35836)
## Why

Cancelling an in-flight MCP elicitation could leave its response handler registered in the shared router.

## What changed

- Remove an elicitation from the router when its pending request future is dropped.
- Keep cleanup scoped to the cancelled request so other pending elicitations remain routable.

## Testing

Added a test that cancels one of two pending elicitations, verifies the cancelled request can no longer be resolved, and confirms the other request still completes.

GitOrigin-RevId: 9a10360459f0b39552d9d29a6e1b867c1f09e97d
2026-07-28 22:16:42 +00:00
Eddie Chen
1def0a8925 Track parent turns for nested Codex requests (#35835)
## What changed

- Propagate the initiating turn ID through agent spawns, follow-up tasks, reviews, and delegated Codex sessions.
- Add `parent_turn_id` to Responses client and turn metadata while keeping it out of external MCP metadata.
- Preserve parent-turn provenance across queued agent messages when their triggering parent is unambiguous.

## Testing

- Cover spawned, resumed, nested, reviewed, delegated, and WebSocket request metadata.
- Verify queued messages do not claim ambiguous or queue-only parent turns.

GitOrigin-RevId: 481fdebbe7df2031880fe259509273cce50b20a8
2026-07-28 21:58:33 +00:00
seanh-oai
12b3e88028 Update rusty_v8 to 150.4.0 (#35831)
## What changed

- Upgrade the Rust `v8` crate to `150.4.0` and the Bazel V8 source to
  `15.0.245.2`.
- Refresh the prebuilt archives, checksums, LLVM source revisions, Bazel targets,
  and downstream V8 patches for the new release.
- Expose the pinned llvm-libc headers under V8's expected include path for
  source builds.

GitOrigin-RevId: 91c953b2fb707b221fdd772f9ca88fb71606f70f
rusty-v8-v150.4.0
2026-07-28 21:21:45 +00:00
Peter Bakkum
438c9e98db Route WebRTC sideband joins to the Realtime API (#35830)
## What changed

- Use `https://api.openai.com/v1` for WebRTC sideband websocket joins instead of deriving the URL from the model provider.
- Keep `experimental_realtime_ws_base_url` as an explicit sideband override for local development and tests.
- Exclude provider query parameters when building sideband URLs.

## Testing

- Add coverage that a frameless sideband join uses `wss://api.openai.com/v1/live/rtc_test` even when the provider points at the ChatGPT backend.
- Update the sideband retry end-to-end test to inject its mock server URL through the new override.

GitOrigin-RevId: 5d3d2cd69905ba04143010ced36a22712825b563
2026-07-28 21:16:06 +00:00
Adam Perry @ OpenAI
50a7328f50 Enforce centralized SQLite connection creation (#35828)
## Why

Direct SQLx constructors can bypass the shared SQLite configuration in
`codex-state`.

## What changed

- Deny SQLx pool, connection, and database creation methods through the
  workspace Clippy configuration for both Cargo and Bazel builds.
- Exempt `codex-rs/state/src/sqlite.rs`, the centralized connection shim, from
  the lint.
- Document that the deny list must be audited when upgrading SQLx.

GitOrigin-RevId: e20d7e83095727ac446347157782175062a100fc
2026-07-28 20:49:22 +00:00
Celia Chen
155c3e299c Use the shared HTTP client for announcement tips (#35825)
## Why

Announcement prewarming disabled proxy discovery to avoid the macOS sandbox
panic fixed by https://github.com/openai/codex/pull/16670.

## What changed

- Fetch announcement tips asynchronously with `RouteAwareClientPool` instead
  of a blocking `reqwest` client.
- Pass the configured `HttpClientFactory` into prewarming so announcement
  requests honor the configured outbound proxy policy.

GitOrigin-RevId: 535158d95a99c6f515bd30ea6e3bcb2ac6bb6d7e
2026-07-28 20:12:13 +00:00
Celia Chen
8bbdf6c8f9 Use the shared HTTP client for TUI network checks (#35821)
## Why

TUI update checks and local OSS provider detection constructed their own HTTP
clients instead of using Codex's shared client behavior.

## What changed

- Route update requests through the configured route-aware client pool while
  retaining the existing default headers and custom CA fallback.
- Probe the hardcoded LM Studio and Ollama loopback endpoints with a shared
  direct client and a per-request timeout.
- Limit the legacy invalid-custom-CA fallback to the default routing policy so
  system-proxy routing still reports certificate configuration errors.

## Testing

Add coverage for local provider probes with invalid `CODEX_CA_CERTIFICATE` and
`SSL_CERT_FILE` values, and for custom CA fallback under both routing policies.

GitOrigin-RevId: b5c230b61e8964b3f1af3395052361ff716d6ce1
2026-07-28 19:58:25 +00:00
Adam Perry @ OpenAI
dd6b880353 Advance latest-alpha-cli after release publishing completes (#35818)
## What changed

Make the `update-branch` job wait for successful R2 publication before moving
`latest-alpha-cli`. For releases that publish npm packages, also require the npm
job to succeed; releases that intentionally skip npm publication can still
advance the branch.

GitOrigin-RevId: 38381b82c95c5c9650b2d72258ea7b835bdfa555
2026-07-28 19:27:00 +00:00
Celia Chen
709283b432 Use configured HTTP clients for all MCP OAuth requests (#35814)
## What changed

- Require callers to provide an HTTP client for MCP OAuth discovery and login, removing the separate direct `reqwest` path.
- Use the shared `http` and `url` types throughout the MCP client and drop its direct `reqwest` dependency.
- Preserve configured MCP headers when routing OAuth discovery through the provided client.

## Testing

- Add coverage that routed OAuth discovery forwards configured headers.

GitOrigin-RevId: 1345f56bd794626533133447597a5908e57b9b48
2026-07-28 19:11:36 +00:00
Celia Chen
9ea975a2dc Route MCP OAuth through configured HTTP clients (#35806)
## What changed

- Pass resolved, route-aware HTTP clients through MCP OAuth discovery and login so CLI commands, plugin installation, and skill dependency setup honor configured proxies and execution environments.
- Apply per-plugin MCP server configuration and requirements before starting OAuth during installation, and skip disabled servers or servers assigned to unowned environments.
- Preserve configured MCP server policies when merging remotely installed plugin metadata.

## Testing

- Cover proxy-routed OAuth for `codex mcp add`, `codex mcp login`, plugin installation, and skill MCP dependencies.
- Cover plugin-install OAuth filtering for disabled servers, plugin requirements, and unowned environments.

GitOrigin-RevId: f84c88820e24a627faa78d6bed1b371682ecdc2f
2026-07-28 18:25:29 +00:00
Felicia Chen
8f00b9a04c Tag reports with the selected turn's model and effort (#35802)
## What changed

- Read the selected turn's `model` and reasoning `effort` from its rollout and add them to the report's upload tags.
- Use the latest turn context when the request has no `turn_id`, without substituting another turn when a requested ID is missing.
- Prefer the request-derived model and effort over values captured in the report snapshot.

## Testing

- Added coverage for selecting a reported turn, falling back to the latest turn, handling a missing turn, preserving an unspecified effort, and upload-tag precedence.

GitOrigin-RevId: 133bab7730e18b28c4b26ae55fbce55d8e5705fb
2026-07-28 17:51:37 +00:00
Adam Perry @ OpenAI
4f6eaf7af9 Wait for MCP readiness in the curated sync test (#35794)
## What changed

Update the existing-thread curated MCP sync test to wait for each server's
`ready` startup notification before proceeding through refresh boundaries or
calling the synced server's tool.

GitOrigin-RevId: 56fd7ff72ff277a043c4a2d8168079da053b4829
2026-07-28 16:57:17 +00:00
Owen Lin
fa1d4c40d0 Gate paginated thread history on the state database (#35787)
## Why

Local thread stores without an initialized state database should not implicitly
create SQLite files or partially delete threads that have materialized history.

## What changed

- Report paginated history listing as unsupported when no state database is
  available, and skip history projection and materialization in that mode.
- Reject paginated forks without a state database.
- Validate access to materialized history before deleting rollout files, so a
  failed deletion preserves both the rollout and its history rows.

## Testing

Added coverage that a store without a state database creates no SQLite files
and preserves materialized history when deletion is unsupported. Existing
projection tests now initialize the state runtime explicitly.

GitOrigin-RevId: 2eaa0f5f0de8d5e4d84375ec50b310746a0ee68e
2026-07-28 16:00:39 +00:00
Arun Eswara
cf7e9cfe6a Support self-serve Business ProLite accounts (#35785)
## What changed

- Recognize `self_serve_business_prolite` across authentication, account and rate-limit APIs, generated schemas, workspace classification, status display, cloud configuration gating, and usage-limit messaging.
- Keep the Python SDK's `PlanType` enum compatible with non-empty string values introduced by newer Codex runtimes while preserving its known constants.

## Testing

- Cover token parsing, account reads and notifications, backend rate-limit mapping, workspace behavior, error formatting, and Python SDK response coercion for the new plan value.

GitOrigin-RevId: 70bc17a7c4ba4028cb10e4333cc1f2ac64da361f
2026-07-28 15:50:45 +00:00
Charlie Marsh
bb1af235ea Load thread titles concurrently during session startup (#35779)
## What changed

Run the thread-title lookup alongside instruction refresh and plugin and skill
warmup, avoiding an additional sequential wait during session initialization.

GitOrigin-RevId: 021f48abeac249c5d3fe526d026bf031acf1bed9
2026-07-28 14:34:04 +00:00
Charlie Marsh
84ccb2938b Resolve MCP tool catalogs concurrently (#35777)
## What changed

- Resolve per-server tool catalogs concurrently in `list_all_tools` and binding capture.
- After the shared startup wait, recheck servers that previously exposed cached tools so a newly ready client contributes its current catalog and callable client.

## Testing

- Add gated-client tests that verify multiple server catalogs start before any one server is released.
- Verify binding capture replaces cached Codex Apps tools with the ready client's tools when startup completes during capture.

GitOrigin-RevId: a30d1a535ed1588f2bba21f2741e8bbd9342e339
2026-07-28 14:13:03 +00:00
felixxia-oai
03748ad5e1 Scale skill metadata budgets with context windows (#35773)
## What changed

- Allocate 2% of the resolved model context window to skill metadata without
  imposing the previous 4,000-token ceiling.
- Keep the 8,000-character fallback when no context window is available.
- Extend catalog rendering coverage to verify that a 400,000-token context
  window receives an 8,000-token metadata budget and includes more skills.

GitOrigin-RevId: 5120d462de22fbfe5f9c4ab0d1bb97e51950d4b2
2026-07-28 13:39:35 +00:00
jif
7cde2323f3 Throttle models cache TTL renewals (#35772)
## Why

Matching model ETags can arrive on every response, but a recent models cache does
not need to be rewritten each time.

## What changed

Renew the models cache timestamp only after more than half of its configured TTL
has elapsed. Matching ETags continue to avoid refetching `/models`.

## Testing

Added integration coverage that verifies a recent cache remains unchanged and an
older cache is renewed without another `/models` request.

GitOrigin-RevId: b45da3824674c6b41d982ba4a405b419b09b7715
2026-07-28 13:31:41 +00:00
felixxia-oai
f6160ca5b3 Share the skills budget across host and executor catalogs (#35769)
## Why

Rendering host and executor skill catalogs independently allows their combined
metadata to exceed the skills context budget.

## What changed

- Allocate one budget across both catalogs when both contain model-visible
  skills.
- Prefer retaining executor skills when budget pressure requires omissions,
  while preserving an executor omission marker and reporting when all host
  skills were omitted.
- Evaluate absolute and aliased host paths under the shared budget and select
  the rendering that best preserves executor entries, total entries, and
  descriptions, in that order.

## Testing

Added renderer and production-turn coverage for shared-budget description
shortening, host-first omission, executor omission markers, and alias selection.

GitOrigin-RevId: 30041736a76aa173cb641aa98a876a306cb437d2
2026-07-28 13:16:04 +00:00
felixxia-oai
a68d0a74bd Emit host skill budget warnings from world state (#35766)
## Why

Host skill catalogs supplied through extension world state should report budget warnings only when their catalog update is actually rendered.

## What changed

- Stop rebuilding an extension-owned host catalog in core.
- Emit host catalog budget warnings when the corresponding world-state fragment is rendered, and deduplicate them with executor catalog warnings.
- Cover full, shortened, and omitted host and executor catalogs, including repeated turns and resumed persisted snapshots.

GitOrigin-RevId: ba28b6e337281b49ed4da2175c193fd4a6898ab7
2026-07-28 12:43:20 +00:00
Tamir Duberstein
e597169e9a Keep agent registry identities consistent (#35744)
## Why

An agent can be registered again with restored path metadata after a root thread
resumes. Leaving its previous registry entry behind can make later lookup and
release operations act on stale metadata.

## What changed

- Add a thread-to-path index alongside the agent tree.
- Keep both indexes synchronized when root and spawned agents are registered,
  replaced, moved between paths, or released.
- Preserve other restored siblings when one agent is closed, while still
  allowing a surviving sibling to be reloaded for follow-up work.

## Testing

Add registry coverage for replacement, release, and path migration, plus resume
tests with multiple sibling agents.

GitOrigin-RevId: 1c1acf422884a6842d9bbdf89ba993d98187770d
2026-07-28 09:41:52 +00:00
jif
d9e1c9cd55 Avoid blocking turns on optional MCP startup (#35742)
## Why

A pending optional MCP server can delay the first model request even when the
turn does not need that server.

## What changed

- Give optional MCP servers a shared one-second startup grace, then omit servers
  that are still pending from the captured tool catalog.
- Continue waiting when the turn explicitly requires a server through a plugin,
  skill dependency, or `mcp://` mention, and preserve this behavior for input
  received between sampling steps.
- Route direct resource requests to the live connection set when a pending
  server was omitted from the binding, while keeping all-server resource
  discovery non-blocking.

## Testing

- Cover the shared grace period and resource behavior for pending optional
  servers.
- Verify plugin, plugin-skill, and direct MCP mentions wait for startup.
- Verify an Apps-enabled turn proceeds without tools from an unrelated pending
  optional server.

GitOrigin-RevId: b5f895c5a5362fe73f7d33250367662d4a217e4d
2026-07-28 09:32:48 +00:00
ningyi-oai
8e271dc02b Add bounded metadata for executed tool calls (#35738)
## What changed

- Add protocol types and `ResponseItem` helpers for attaching and clearing
  locally recorded tool-call names and arguments.
- Bound serialized metadata across a prompt, replacing oversized arguments and
  omitted calls with trusted truncation details.
- Prevent deserialized response items or model-provided arguments from forging
  locally generated tool-call and truncation metadata.

## Testing

- Cover prompt-wide size limits, omission accounting, idempotent bounding, and
  forged truncation markers.

GitOrigin-RevId: 960a223437ce81fe6b4cbb5fc7a9774408b2755b
2026-07-28 07:58:10 +00:00
thomas
f2bee854a7 Complete MCP 2026 client support (#35725)
## What changed

- Drive multi-round `tools/call` and `resources/read` requests through
  `input_required` responses, preserving opaque request state and elicitation
  metadata across JSON, SSE, and stdio transports.
- Decode modern discovery and elicitation result shapes while retaining legacy
  initialization, elicitation defaults, and discovery fallback behavior.
- Apply the 8 MiB modern-protocol response limit to JSON, SSE events, and stdio
  messages, and reject executor stream recovery when output sequence gaps would
  corrupt the protocol stream.

## Testing

Added integration coverage for discovery, multi-round requests, legacy
fallbacks, message limits, stdio launchers, SSE responses, session recovery,
and executor output recovery.

GitOrigin-RevId: d26a08883a2825e8ce2408ac498114b33859225e
2026-07-28 06:06:58 +00:00
thomas
be2e4afcd7 Add MCP 2026-07-28 discovery support (#35724)
## What changed

- Add an opt-in `mcp_2026_07_28` protocol mode while preserving the legacy
  lifecycle by default.
- Negotiate the new protocol over streamable HTTP with `server/discover`,
  including bounded responses, redirect protection, and fallback only when a
  response establishes that the endpoint is legacy-only.
- Require stdio servers to opt in with
  `CODEX_MCP_PROTOCOL_VERSION=2026-07-28`, and add a bounded local stdio
  transport for the modern lifecycle.
- Consume paginated tool, resource, and resource-template catalogs in modern
  mode, reject repeated cursors, and retain discovered server identity.
- Reconnect reusable MCP clients when their selected protocol mode changes.

## Testing

- Cover HTTP JSON and SSE discovery, legacy fallback and rejection cases,
  redirects, retries, response limits, and pagination.
- Cover local and executor stdio discovery, protocol markers, message limits,
  and legacy compatibility.

GitOrigin-RevId: f6a78816e127d2a482292d63b91c8384f1595903
2026-07-28 05:52:12 +00:00
joeytrasatti-openai
85c6da1c79 Add persisted sections for organizing threads (#35722)
## What changed

- Replace the `isPinned` thread metadata and filters with an optional persisted
  `section` and `sectionId`.
- Add the paginated `threadSection/list` app-server method so clients can
  discover sections even when they contain no threads.
- Seed a stable `Pinned` section, validate section assignments, and support
  filtering for a specific section or for unsectioned threads.

## Testing

- Cover section protocol serialization, listing and pagination, metadata
  updates, filtering, persistence, migration compatibility, and operation
  without SQLite state.

GitOrigin-RevId: 7972b5471d29317b9387bfd90aa9f573f691ad4c
2026-07-28 05:26:16 +00:00
Channing Conger
9291a123fb Honor disabled code mode fallback without a process host (#35721)
## Why

When the code mode host feature was disabled, thread startup always selected the in-process provider, even when `disable_in_process_fallback` was set.

## What changed

- Select a disabled provider when both the process host and in-process fallback are disabled.
- Return a clear tool error instead of running code mode in process for that configuration.

## Testing

Added an integration test covering code mode with the process host feature and in-process fallback both disabled.

GitOrigin-RevId: 3ed80afc23e0a5518c0133fe337a37b1fa545ead
2026-07-28 05:22:02 +00:00
thomas
61de0d8fe8 Upgrade rmcp to 3.0.0-beta.3 (#35720)
## What changed

- Update the `rmcp` model and transport integrations for `3.0.0-beta.3`.
- Preserve legacy `elicitation/create` form requests, schema defaults, metadata, and wire-format compatibility while adopting the new elicitation types.
- Harden OAuth discovery by using GET-first discovery without starting an MCP session, preventing cross-origin header redirects, validating authorization-server and callback issuers, and retaining compatibility with metadata that omits an issuer.
- Keep stored OAuth credentials readable and avoid requiring reauthorization after transient refresh failures.

## Testing

- Add coverage for legacy elicitation round trips, OAuth discovery variants, callback issuer validation, credential migration, and refresh failures.

GitOrigin-RevId: 756197d26f3fd347c28c400228f6b3d06ed493b7
2026-07-28 05:17:25 +00:00
Celia Chen
899539c03a Reuse route-aware clients for OpenAI file uploads (#35717)
## What changed

- Store a request-logging-disabled `RouteAwareClientPool` in session services and use it for file creation, blob upload, and finalization requests.
- Preserve the existing system-root fallback for transport-default proxy routes, and emit a warning event when that fallback is used.
- Remove the direct `reqwest` dependency from `codex-api` now that uploads use the shared HTTP abstraction.

## Testing

- Add coverage for completing multiple uploads through a shared client pool.

GitOrigin-RevId: 01842415cad2d349a6bd3869abb3332e8110ebce
2026-07-28 04:54:32 +00:00
Celia Chen
2494d939cf Support streaming bodies in route-aware HTTP requests (#35715)
## What changed

- Add `RouteAwareRequestBuilder::body_stream` for sending fallible byte streams without exposing the underlying HTTP client body type.
- Expose request- and body-error classification on `RouteAwareRequestError`.
- Add `RouteAwareRequestError::without_url` so callers can remove credential-bearing URLs, such as signed upload URLs, from transport errors.

## Testing

- Verify streamed request bytes reach the server.
- Verify URL secrets are absent after stripping a transport error's URL.

GitOrigin-RevId: 6a100f56a9aa7d79d9b6dd0f103135f5f2060617
2026-07-28 04:21:28 +00:00
Adam Perry @ OpenAI
49025589b0 Add configurable developer instructions for v2 subagents (#35708)
## What changed

- Add `features.multi_agent_v2.subagent_developer_instructions` to override inherited developer instructions for subagents that do not define role-specific instructions.
- Preserve role-specific instructions as the higher-precedence setting, and carry the effective instructions through full and bounded forks, compacted histories, and cold resume without duplication.
- Treat an unset override as inheritance and a blank override as clearing inherited instructions.

## Testing

- Cover configuration parsing and materialization, instruction precedence, fork modes, compaction, role application, and resumed subagents.

GitOrigin-RevId: 32321e61abc59b14a1be5f31e6bd6570bb1cd89d
2026-07-28 03:33:31 +00:00
Adam Perry @ OpenAI
3418498f01 Honor the configured SQLite home in the logs client (#35695)
## Why

`just log` derived the logs database path from `CODEX_HOME`, so it could read
the wrong database when `sqlite_home` or `CODEX_SQLITE_HOME` selected a
different location.

## What changed

- Move `logs_client` into `codex-cli` so it can resolve the shared
  `SqliteConfig` through the standard configuration loader.
- Keep `--db` as a direct override that skips config loading and preserves
  native path bytes.
- Update the `just log` recipes to run the client from its new crate.

## Testing

- Add coverage for bypassing invalid Codex config with `--db`.
- Add Unix coverage for non-UTF-8 database paths.

GitOrigin-RevId: fabd64a66543be26a6f5d3b5e509016c3270350e
2026-07-28 01:17:52 +00:00
Eric Traut
f029bb795c Refresh the subagent picker in the background (#35693)
## Why

Opening the subagent picker could wait on thread metadata and live event-store locks, delaying terminal input. Its cached entries could also omit descendants that were not observed in the current TUI session.

## What changed

- Render the picker immediately from cached navigation state and refresh root descendants asynchronously with `thread/list`.
- Merge discovered descendants into an open picker while preserving its selection and live status, and coalesce concurrent refresh requests.
- Ignore refresh responses from a previous session and avoid blocking on busy event stores.

## Testing

- Extend session lifecycle coverage for nonblocking picker opens, refresh coalescing, descendant discovery, selection preservation, and status updates.
- Add coverage for rejecting a refresh response after navigation state is cleared.

GitOrigin-RevId: 7eae7f696f8d2d323a47b3fd2800ea1c1cdbf2a0
2026-07-28 00:38:45 +00:00
Tamir Duberstein
63682c4e1a Include empty-preview threads in relationship listings (#35691)
## What changed

- Include threads without preview text when listing direct children or descendants from the persisted spawn graph.
- Continue filtering those threads out of the global thread list.

## Testing

- Extend the relationship pagination test to cover an empty-preview child in direct-child and descendant results.

GitOrigin-RevId: c2e7bb04c5f64558a48b1d7877bd24edaa364bb4
2026-07-28 00:24:52 +00:00
Owen Lin
8d6a91b1ff Preserve item timestamps in thread history projections (#35689)
## What changed

- Add optional start and completion timestamps to `ThreadHistoryItemChange`.
- Populate them from canonical `ItemCompleted` records during stateless thread history projection.
- Treat a zero completion timestamp as absent, and leave timestamps unset for legacy builder events that do not provide them.

## Testing

- Cover projected item timestamps, including missing start times and zero completion times.

GitOrigin-RevId: 2187530f489ad3d86b6ab65faaaab1eab5357f1b
2026-07-28 00:14:22 +00:00
Charlie Marsh
8c72d61727 Point crossterm patch to the OpenAI OSS fork (#35688)
## What changed

- Update the `crossterm` Cargo patch to use the OpenAI OSS fork while retaining the existing revision.
- Refresh the Cargo and Bazel lockfiles and the `cargo-deny` Git-source allowlist for the new repository URL.

GitOrigin-RevId: 96c70abca95b9c5c8f19d1bc2d30976c5797ba8c
2026-07-27 23:56:47 +00:00
viyatb-oai
fb6aad9ae3 Load cloud-managed profiles for codex sandbox (#35685)
## What changed

- Bootstrap the cloud configuration bundle when `codex sandbox` receives an
  explicit permission profile together with `--include-managed-config`.
- Pass the resulting managed requirements through sandbox configuration loading
  so the requested cloud-managed permission profile is enforced.
- Keep the default path from loading cloud-managed profiles when managed
  configuration is not requested.

## Testing

- Add unit and subprocess coverage for fetching, caching, and enforcing a
  cloud-managed permission profile.

GitOrigin-RevId: dfe637af5895496ae88b8128ca2f5ec29341ad06
2026-07-27 23:16:37 +00:00
Owen Lin
4d1f66bf81 Preserve paginated thread metadata across resumes (#35678)
## Why

Paginated rollout history may contain only a bounded suffix. Deriving display
metadata from that suffix can replace the thread's original preview, title, and
first user message when the thread is read or resumed.

## What changed

- Use SQLite as the canonical source of display metadata for paginated thread
  reads, including reads by an explicit rollout path.
- Seed resume metadata tracking from the persisted values so appended history
  fills only missing fields instead of overwriting existing ones.
- Prefer an explicitly requested rollout path over a stale path stored in
  SQLite while retaining the canonical metadata.

## Testing

Added coverage for reads by ID and path, bounded-history resumes across app
server restarts, preservation of existing metadata, initialization of missing
fields, and stale persisted rollout paths.

GitOrigin-RevId: b393d0727afcba70fda7f50a6f2dcca0632745b4
2026-07-27 22:12:15 +00:00
Charlie Marsh
bbeee9a406 Prepare MCP and plugin recommendations concurrently (#35675)
## Why

Turn preparation waited for MCP discovery before requesting endpoint plugin
recommendations, adding their latencies together.

## What changed

- Prepare the MCP runtime and endpoint plugin recommendations concurrently.
- Wait for both results before building tools and starting model sampling.
- Cancel the combined preparation when the turn is interrupted.

## Testing

- Add coverage that gates MCP initialization and verifies recommendation fetching
  overlaps it while the final request includes both results.
- Verify interrupting concurrent preparation prevents model sampling.

GitOrigin-RevId: 295ec268331bf05304e6b313925fd2b6c2ae4190
2026-07-27 21:43:27 +00:00
felixxia-oai
294d813263 Route curated plugins by authentication mode (#35671)
## Why

Curated plugin capabilities need to follow the active authentication mode, including after an account switch and when the configured model provider differs from the authentication source.

## What changed

- Select the ChatGPT, remote, or API curated marketplace from the current authentication mode, with an API marketplace fallback for ambient Amazon Bedrock credentials.
- Apply that selection consistently to plugin loading, hooks, skills, installed-plugin conflict filtering, marketplace listing, and `codex mcp` discovery.
- Start the local curated repository sync when an account change makes the remote catalog unavailable, and refresh existing thread MCP runtimes when the effective plugin cache changes.

## Testing

Added coverage for account switches, ChatGPT-authenticated Bedrock sessions, API-key MCP discovery, curated marketplace filtering, hook and skill routing, and existing-thread MCP refreshes.

GitOrigin-RevId: dbefdba3a3ea7281e7b6013e057a418770ccfc95
2026-07-27 21:17:42 +00:00
iceweasel-oai
fd41e813cb Raise the Windows exec yield floor to 10 seconds (#35670)
## What changed

- Clamp the initial `exec_command` yield time to at least 10 seconds on Windows.
- Update the tool description and unit coverage for the new effective range.
- Allow the Windows Ctrl-C integration test up to 20 seconds to complete.

GitOrigin-RevId: 65d4d1c9a89dc9979e10d3e565af61c9f632c058
2026-07-27 21:12:00 +00:00
viyatb-oai
bbb92457b0 Expose the network proxy spec constructor (#35668)
GitOrigin-RevId: 84c4f11cd6c5fea867228a9f821d4901bf4204c6
2026-07-27 20:43:04 +00:00