Commit Graph

7665 Commits

Author SHA1 Message Date
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
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
Adam Perry @ OpenAI
c21c8a5e21 Fix the async watcher test harness on Windows (#35665)
Initialize the Windows-only `ProcessDriver::tty` field to `false` when
constructing the streaming output test harness.

GitOrigin-RevId: 95683779072cba31664d059750b81ee0d9c17664
2026-07-27 20:00:11 +00:00
jif
b672b3c409 Evaluate character matching over skill routing metadata (#35663)
## What changed

- Add a character n-gram shadow selector that combines skill descriptions with host interface metadata and tool dependency names and descriptions.
- Bound routing fields, dependency records, and candidate counts before ranking.
- Exclude explicitly selected skills from shadow candidates and only record invocations for skills eligible for the experiment.

## Testing

- Add unit coverage for host interface metadata, connector dependencies, baseline description matches, and long routing metadata.

GitOrigin-RevId: 36ef0cb4a68601f2d9d41c3344c88f7927c32bf4
2026-07-27 19:37:02 +00:00
jif
8495963ac6 Place host skills before permission instructions (#35661)
## What changed

- Insert the `host_skills` world-state section before the permissions section
  when permissions are present.
- Verify that skill metadata appears before `<permissions instructions>` in the
  rendered developer message.

GitOrigin-RevId: e9fc62f498c384e841fc34ef679850557645f989
2026-07-27 19:01:53 +00:00
Adam Perry @ OpenAI
2f19a57704 Preserve multi-agent settings across config representations (#35656)
## Why

`features.multi_agent_v2` can be represented as either a legacy boolean toggle
or a table with an `enabled` field and nested settings. Layering or editing
configs that mix these forms could replace one form with the other and discard
the enabled state or nested settings.

## What changed

- Normalize boolean toggles to the table's `enabled` field when merging config
  layers, applying CLI overrides, and editing user or profile config.
- Preserve nested multi-agent settings when toggling the feature, while keeping
  ordinary replacement semantics for unrelated paths.
- Attribute normalized `enabled` values to the layer that supplied the boolean
  toggle so config write results report overrides correctly.

## Testing

Added coverage for layered config, CLI overrides, config edits, app-server
writes, and origin metadata using both root and profile feature paths.

GitOrigin-RevId: 38b248c949b9ea5d6340a73d754f91c1834ac486
2026-07-27 18:41:09 +00:00
iceweasel-oai
6b23635a7e Terminate Windows non-TTY processes on interrupt (#35655)
## Why

Windows non-TTY exec sessions reported interrupts as unsupported, so sending
Ctrl-C through `write_stdin` did not stop the running process.

## What changed

- Route interrupt requests for Windows non-TTY processes through their existing
  termination callback, including pipe-backed processes.
- Track whether driver-backed Windows sessions use a TTY so PTY interrupts keep
  their existing behavior.
- Consume the terminator after a successful interrupt to avoid invoking it again
  when the process handle is dropped.

## Testing

Added coverage for local and remote exec-server sessions, unified exec, pipe
fallbacks, and legacy Windows sandbox processes.

GitOrigin-RevId: 34504d01f091ef57bb961e98ad5a8d9f1acee4ee
2026-07-27 18:37:11 +00:00
Adam Perry @ OpenAI
9f82ffed1b Test developer instruction inheritance for multi-agent workers (#35653)
## Testing

- Verify full, compacted, and bounded history forks preserve developer messages while removing stale parent usage hints.
- Add an app-server regression test that cold-resumes a root thread and confirms a roleless worker retains inherited developer instructions when lazily reloaded for follow-up work.

GitOrigin-RevId: 40e454a2a2b721ea645cbc607b17a3ae6b617bd9
2026-07-27 18:12:42 +00:00
viyatb-oai
462ed19a05 Enable network policy callbacks for remote exec (#35652)
## What changed

- Forward remote managed-network policy requests to the controller-side decider when Guardian review is enabled.
- Bound callbacks using the configured permission-hook and Guardian review timeouts, restore trusted execution attribution, and recheck live baseline policy before requesting a decision.
- Cancel pending decisions when the process or execution scope ends, and propagate EOF across the sandbox proxy bridge with half-closes.

## Testing

- Cover callback enablement, strict allowlist behavior, live policy updates, trusted attribution, and execution-scope cancellation.

GitOrigin-RevId: 83b47657c8c4546dfe98eec8b272833e96a46b7e
2026-07-27 18:07:31 +00:00
Felipe Coury
976129f097 Preserve TUI input when terminal focus returns (#35649)
## Why

Refreshing the terminal palette on a focus event can block the input loop and
discard keystrokes entered while focus is returning.

## What changed

- Keep the palette cached by the startup probe when handling `FocusGained`.
- Continue updating focus state and requesting a redraw without issuing new
  foreground or background color queries.

## Testing

- Verify a queued key is delivered after `FocusGained`.
- Exercise focus regain in a pseudo-terminal with immediate and delayed input,
  and verify it emits no additional palette queries.

GitOrigin-RevId: 16e26f81c1343d01f6d0baeff3f204bcc91dd6f3
2026-07-27 17:59:06 +00:00
malsamiri-oai
e8f0f64f20 Preserve thread metadata when rollout files are missing (#35644)
## What changed

- Skip threads whose rollout files cannot be found while continuing through
  database pages until the requested number of valid threads is collected.
- Retain the skipped threads and their rollout paths in the state database
  instead of deleting their metadata during listing.

## Testing

- Update the state-backed listing test to verify that a missing rollout path
  does not consume a page slot or remove the stored thread metadata.

GitOrigin-RevId: 51c03a78434b0aeeb5a2dc685b97243b6ad958bf
2026-07-27 16:54:52 +00:00
Felipe Coury
0affaf2acb Make OpenTelemetry provider shutdown idempotent (#35642)
## What changed

- Guard `OtelProvider::shutdown` so exporters shut down at most once, including when an explicit shutdown is followed by `Drop`.
- Let tracer provider shutdown handle flushing without a separate `force_flush` call.
- Add regression tests for explicit shutdown and drop-only shutdown.

GitOrigin-RevId: f3c8769146ee57102477eb9ee7fd948f688efb79
2026-07-27 16:33:59 +00:00
charlesgong-openai
bd2de422aa Parse Claude and Cursor session records separately (#35623)
## Why

Cursor session messages can place `<cursor_commands>` and `<timestamp>` context
before the actual `<user_query>`. Treating both external session formats with one
parser left that context in the imported message and generated title.

## What changed

- Route detected sessions through format-specific Claude and Cursor parsers.
- Strip recognized Cursor context wrappers when extracting a trailing
  `<user_query>`, while preserving messages with unknown leading context.
- Keep shared content-block, tool-call, and timestamp parsing in a common module.

## Testing

Add parser coverage for wrapped Cursor queries, unknown context, working-directory
precedence, Claude metadata, content hashing, and shared tool annotations.

GitOrigin-RevId: b49328d46ab4937e3c599588a3d3081e8ab798cd
2026-07-27 14:31:50 +00:00
Charlie Marsh
fea2d8b18f Skip restored token usage replay for exec resumes (#35621)
## What changed

Set `excludeTurns` on `codex exec` thread resume requests so the app server
does not return reconstructed turns or replay their restored token usage.

## Testing

Extend the `resume --last` integration test to verify that resuming a session
emits only the live turn's `thread/tokenUsage/updated` event.

GitOrigin-RevId: 3347071142e7453ea9e3ac9ac292aa5384d98430
2026-07-27 14:12:50 +00:00
rka-oai
fbe65995bb Support model-owned token budget defaults (#35608)
## What changed

- Add token-budget settings to model catalog messages and apply them when the
  feature is enabled without explicit token-budget configuration.
- Keep explicit user settings authoritative, reject invalid catalog defaults,
  and preserve resolved defaults in exported config locks.
- Manage context-window guidance through world state so it updates once when
  the active model changes while retaining prior conversation history.

## Testing

- Cover catalog defaults, explicit overrides, disabled features, invalid
  values, config-lock replay, and model switching.

GitOrigin-RevId: 54544fefaa14b09f5ef5bad9967a13c52b87b0fe
2026-07-27 12:52:37 +00:00