Commit Graph

10998 Commits

Author SHA1 Message Date
Anthony Tafoya
b948cfa88d Rename plugin MCP and app extension APIs (#46564)
## What changed

- Rename the extension providers to `PluginMcpProvider` and `PluginAppProvider`, and use app terminology for plugin app declarations.
- Rename the MCP contributor to `PluginContributor` and its installation entry point to `install_plugins`; update the app-server call site and existing tests.
- Move the corresponding modules and tests to plugin-based names, change the contributor ID to `plugin`, and update tracing spans and log messages to match.

GitOrigin-RevId: 7106d2965675265f39e186e57cc334161bdb90d3
2026-09-19 01:45:51 +00:00
Abhinav
3bb0a530d1 Add system proxy fallback for login and startup requests (#46562)
## Why

Login and enterprise configuration bootstrap can fail when their endpoints are reachable only through the system proxy, before cloud configuration can enable `respect_system_proxy`.

## What changed

- Enable `features.system_proxy_fallback` by default, honor managed feature requirements, and prevent project configuration from changing it.
- Retry account discovery and cloud configuration GETs through the system proxy after connection failures or timeouts, bounding the initial request and body read to five seconds.
- Retry OAuth authorization-code exchange only on connection failures before any redirect, with a ten-second connection timeout. Reuse the successful client for the subsequent API-key exchange to avoid changing routes.
- Increase workspace discovery and cloud configuration timeouts to 15 and 20 seconds, respectively, to accommodate fallback.

## Testing

Add coverage for proxy-only browser login through the first completed turn, including cloud configuration enabling `respect_system_proxy` without a restart. Cover stalled GET bodies, preserved request headers, disabled fallback, managed requirements, and project configuration restrictions. Verify that OAuth HTTP errors, redirects followed by connection failures, and failures after sending the POST do not trigger proxy retries, while successful redirects remain supported.

GitOrigin-RevId: 854eeeac186bb4865218ce645019c1e4bff85425
2026-09-19 01:37:14 +00:00
andrewgu-oai
888be42a20 Support explicit provider model catalog URLs (#46561)
## Why

Providers need to serve Codex model metadata independently of their inference endpoint. A custom inference `base_url` alone should not opt API-key sessions into remote catalog discovery.

## What changed

- Add `model_catalog_url` to provider configuration and thread-config serialization. Fetch the full catalog URL with provider authentication, headers, query parameters, and `client_version`, while preserving inference routing.
- Require an explicit catalog URL for API-key discovery with a custom base URL. Keep default OpenAI discovery on the Codex backend, and apply `api_key_model_discovery` gating to provider API keys and cached catalogs.
- Include the catalog URL in cache identity so different catalogs do not share cached metadata.
- Limit explicitly configured catalog responses to 1 MiB, reject redirects, and suppress URL and response diagnostics that could expose credentials.

## Testing

Add coverage for catalog configuration round-trips, query encoding, authentication and header reuse, cache identity and discovery gating, oversized responses, and redirect rejection without credential forwarding. Add an integration test verifying that catalog model metadata and instructions reach conversation requests.

GitOrigin-RevId: 7f6ac5eec257278685e1867a6bcebae6514a365a
2026-09-19 01:36:53 +00:00
sayan-oai
c2a924fc4a Fix stale environment config in the network approval test (#46560)
Remove the obsolete `windows_sandbox_private_desktop` field from the
`EnvironmentConfig` initializer in the active-turn environment fallback test
so it matches the current struct definition.

GitOrigin-RevId: 4441dc8ed3d4bfcd4c1de093e829c065d323f41a
2026-09-19 01:35:38 +00:00
jif
e416eadf7f Encapsulate rollout budget accounting in LocalAgentControl (#46559)
## What changed

Replace direct access to the shared rollout budget with controller methods for
recording token usage, retrieving pending reminders, and marking reminders as
delivered. Move the `SessionBudgetExceeded` check into the controller and update
session and guardian callers, preserving reminder acknowledgment after insertion
into conversation history.

## Testing

Replace the shared-budget pointer assertion with a behavioral check: recording
25 output tokens in a reviewer session leaves 75 tokens in the parent session's
budget reminder when the initial budget is 100 tokens.

GitOrigin-RevId: 003bc2b56e526787c1864c09729bbad1006e243d
2026-09-19 01:34:59 +00:00
Anthony Tafoya
46d87f3b1c Add shared plugin catalog discovery APIs (#46558)
## What changed

- Add `PluginCatalog` types for discovery snapshots, warnings, plugin metadata, stable identities, and cloud or executor source locations. Keep MCP server declaration values out of debug output.
- Extend `PluginProvider` with a generic list query, asynchronous catalog listing, and shared error and future types. Provide empty defaults for listing and root resolution so providers can implement their supported operation.
- Add `PluginListQuery` in the MCP extension with thread and turn identifiers and an optional MCP resource client.

GitOrigin-RevId: 0bf2a1713c25d912c41daab788b88729d4871fcf
2026-09-19 01:28:19 +00:00
sayan-oai
cd2f9ca692 Fix active-turn environment selection lookup (#46557)
Read `initial_environments` in `active_turn_environment_selections` to
return the environment selections captured at turn start.

GitOrigin-RevId: 445b52508733ef971eb6d2d7eea2b2f019542d5f
2026-09-19 01:27:48 +00:00
sayan-oai
c7828dd010 Keep step settings and approval environments consistent (#46556)
## Why

Background processes can outlive their launching turn. Their approval reviews need the originating environment's filesystem restrictions, even when the active turn uses a different environment. Remote restrictions must also be resolved using executor paths rather than the local filesystem.

## What changed

- Capture settings and environment selections together in `StepInputs`. Preserve the captured selection during active model updates while allowing environment startup to finish.
- Carry environment IDs into Guardian network and `execve` requests, and use the owning process's environment with current review settings. Refresh environment readiness for network requests that fall back to the active turn.
- Resolve remote denied paths and globs using the executor's policy context. Decline automatic approval when the request's environment is unavailable or an explicitly denied temporary directory cannot be resolved.

## Testing

Add regression coverage for active model updates retaining their environment while the next turn adopts a new selection, background approvals using their owning environment, newly ready network environments, and remote denied paths and globs, including Windows paths and missing temporary-directory metadata.

GitOrigin-RevId: b620d4b030c597a4f430fe0500864fa5469db3d4
2026-09-19 01:27:26 +00:00
viyatb-oai
328feb0c29 Track executor registrations across connection refresh and recovery (#46555)
## Why

An executor can renew its registration while retaining its Noise identity. Connection refresh must distinguish registrations even when their keys match, and a stale registry lookup must not retire a session that recovery has already renewed.

## What changed

- Track the installed session's registration and expose it through `Environment::cached_executor_registration_id()` without connecting. Publish registration changes only when the new connection is installed.
- Require both registration and executor key to match before refresh reuses a session. Retry stale lookups and prevent recovery from installing a connection after retirement.
- Pin session recovery to the original Noise key while allowing registration renewal to preserve the session and running processes.
- Expose `CodexThread::active_turn_environment_selections()` so hosts can authorize steering against the active turn's selections, including starting and failed environments, independently of later settings updates.

## Testing

Add regression coverage for registration replacement, renewal with a running process, stale refresh lookups, missing sessions, and rejection of changed Noise keys. Extend active-turn tests to check selection snapshots across settings updates, deferred startup, and turn completion.

GitOrigin-RevId: 4395bc6c57f137691887e6585f52dcc5b958101c
2026-09-19 01:27:02 +00:00
iceweasel-oai
a633ebc124 Always use private desktops for legacy Windows sandboxes (#46554)
## What changed

- Remove the private-desktop opt-out from elevated and unelevated Windows sandbox launches.
- Remove `windows.sandbox_private_desktop` and its managed requirement and API fields. Warn users to remove the obsolete setting.
- Require a private desktop name when launching through the Windows sandbox wrapper and command runner.

## Testing

Add coverage for the obsolete-setting migration warning and update wrapper tests to verify a live private desktop is passed and a missing desktop name is rejected.

GitOrigin-RevId: c7135f8d211aac8d812180691c2c1e433d77cde4
2026-09-19 01:21:32 +00:00
jif
c6f5d9e9b5 Return LiveAgent records from agent listing (#46553)
## What changed

Return thread IDs, metadata, and status from `LocalAgentControl::list_agents` using the shared `LiveAgent` type. Move conversion to `ListedAgent` into the tool handler, preserving the `list_agents` response fields and the thread ID fallback for agents without a path.

GitOrigin-RevId: c935cf96ab2a370645a4b74e3306540fc2d168a5
2026-09-19 01:21:09 +00:00
jif
7a15548c6a Move child completion routing into the agent controller (#46552)
## What changed

Have `Session` capture terminal child state in an `AgentTurnOutcome` and delegate delivery to `LocalAgentControl`. Move parent notification and completion activity routing into `agent/control/completion.rs`, so routing no longer takes the child's live `TurnContext`.

Preserve best-effort, queue-only parent delivery, completion activity for the initiating agent, and result tracing only after successful delivery.

GitOrigin-RevId: e06871d92c9ca8660de29f50356cf7c37f7e5199
2026-09-19 01:19:55 +00:00
Adam Perry @ OpenAI
bfb8daa3c9 Add a composite action to build and smoke-test Codex packages (#46551)
## What changed

Add `build-codex-packages` to build unsigned CLI and app-server packages for a supplied Rust target and package version. Support release optimizations or faster, unoptimized builds using the release profile.

Prepare platform-specific tools and bundled binaries, archive debug symbols, and produce both `.tar.gz` and `.tar.zst` packages.

## Testing

Run the existing package smoke tests against both compression formats and the symbols archive. Reject host `rg`, and host `bwrap` on Linux, on `PATH` so the tests exercise packaged tools.

GitOrigin-RevId: e843db1ec94681a33a37862fa0cbbb8d715f3b5f
2026-09-19 01:15:08 +00:00
konsti-openai
98a8d4ea9c Advertise the control socket's WebSocket message size limit (#46548)
## Why

Clients need to know the incoming size limit for single-frame requests so they can reject oversized requests before the socket closes.

## What changed

Add `x-codex-websocket-max-unfragmented-message-bytes` to successful control socket WebSocket handshake responses. Derive the advertised byte limit from the minimum configured frame and message size limits, using the same `WebSocketConfig` for the connection.

## Testing

Extend the control socket upgrade test to verify that the header contains a numeric value matching the effective default limit.

GitOrigin-RevId: c4f46d12e00e20f56d4c14a3e84f9fe6e2f020fa
2026-09-19 01:04:18 +00:00
jif
c026e7a622 Expose a backend-independent agent control contract (#46547)
## What changed

Add a public, object-safe `AgentControl` trait and request/response types for coordinating an agent tree independently of where its threads run. Define contracts for lifecycle operations, message delivery, status observation, execution admission, usage accounting, shared configuration, and guardian evidence.

Move shared agent types out of the local controller and export them from `codex-core`. Let `AgentExecutionGuard` own a backend-provided reservation while preserving the local limiter's release-on-drop behavior. Include `root_thread_id` in `GuardianRootSnapshot` to identify the source of authorization evidence.

## Testing

Add tests for reservation release when a guard is dropped or a turn is cancelled, and extend the guardian authorization test to assert the root thread identity. Check trait object safety at compile time.

GitOrigin-RevId: 9385c9fbfd189f08429539fd89061ef8c9efe0d9
2026-09-19 01:03:55 +00:00
Henry Levy
7e0463b568 Skip skill discovery when injecting items into initialized threads (#46546)
## Why

Recording response items in an initialized thread builds a turn context without starting a turn. Running host skill discovery for that context is unnecessary.

## What changed

Use a dedicated context build mode that skips host skill discovery for history injection. Preserve full discovery for initial context creation, startup prewarming, and execution. If compaction clears the reference context during preparation, rebuild a full context before initializing history.

## Testing

Add a regression test verifying that initial injection discovers skills, subsequent injection records items without discovery, and a real turn still discovers skills and sends the selected skill body and both injected messages to the model.

GitOrigin-RevId: 4a64e04eb0f21698f9b47160bfcfe5b6d6a68554
2026-09-19 01:03:32 +00:00
victor-openai
05de935205 Expose declared onboarding skills in plugin details (#46544)
## What changed

Add an optional `onboardingSkill` summary to `plugin/read` responses and update the generated schemas, TypeScript types, and Python models.

- Resolve local declarations from `extensions["com.openai"].onboardingSkill`, accepting relative paths with or without `./`. Require the resolved path to stay within the plugin root and match a loaded skill.
- Match remote release metadata's `onboarding_skill_name` against the plugin's skills.
- Return the summary only when the plugin and matching visible skill are enabled; remote plugins must also be available. Otherwise, return `null`.

## Testing

Add parameterized local and remote `plugin/read` tests covering matching, missing, and unmatched declarations, disabled plugins and skills, and unavailable remote plugins.

GitOrigin-RevId: 88cabdfddbecba5efba756617da0cb1ff064bdf7
2026-09-19 00:55:08 +00:00
Eric Traut
b33199b1fb Add bounded filesystem path diagnostics to codex doctor (#46543)
## Why

Configured filesystem paths can be slow or inaccessible. Doctor needs to identify those paths and their configuration sources without letting a blocked filesystem call delay runtime shutdown.

## What changed

- Add `sandbox.filesystem_paths` to report literal filesystem grants, access modes, resolution outcomes, and configuration sources when available. Exclude deny rules and denied paths without expanding globs or special paths.
- Resolve paths in disposable helper processes, with wait budgets of two seconds per path and eight seconds total, checking at most 32 paths. Warn on slow or unsuccessful probes and incomplete checks; missing paths alone do not trigger warnings. Probes do not test read/write access.
- List paths without probing on Windows or when filesystem read restrictions apply.
- Increase the app-server doctor report timeout from 25 to 35 seconds to accommodate the probes.

## Testing

Add unit and integration coverage for path deduplication and deny filtering, configuration provenance, blocked-helper timeouts, helper execution without loading configuration, and report snapshots for resolved, missing, Windows, and read-restricted paths.

GitOrigin-RevId: b0732265fc2c83ea67acc24b442e39139d705f1b
2026-09-19 00:54:45 +00:00
papayo-oai
184ea84526 Add authenticated remote plugin measurement references (#46542)
## What changed

Add `RemotePluginMeasurementCache` to prepare trusted measurement declarations for a single installed `GLOBAL` plugin without loading capabilities or updating the shared plugin catalog.

- Recheck installation authorization on every preparation and scope cached references by authentication identity, endpoint, plugin identity, and version.
- Keep up to four entries, share concurrent downloads, and retain isolated bundle files while commands hold references. Reuse cached historical versions after release updates; download only the current release on a cache miss.
- Respect Windows and POSIX case rules, reject ambiguous matches, and omit authenticated URLs and response bodies from preparation errors.

## Testing

Add bundle preparation tests covering authorization, version reuse, concurrent downloads, cancellation and retry, eviction with live references, case matching, error privacy, and temporary-store cleanup.

GitOrigin-RevId: a68f42b90ff78b7943da676a7b43f1ea76b31582
2026-09-19 00:53:17 +00:00
Henry Levy
49e248d4c3 Add opt-in compaction after final responses (#46541)
## What changed

Add `model_post_turn_compact_threshold_percent` to trigger compaction after a final response when context usage reaches the configured percentage of the usable window or an existing auto-compaction limit. Accept values from `0` to `100`; omitted or zero disables the feature.

Skip post-turn compaction when input is pending, the turn is cancelled, or token-budget mode is enabled. Disable it for approval reviewers to avoid delaying approval completion, and record a distinct `PostTurn` analytics phase.

Buffer local post-turn summaries until compaction succeeds and require a nonempty assistant summary before replacing history. Log compaction failures without failing the completed turn, while still propagating interruptions and turn aborts.

GitOrigin-RevId: b616994175829bd83b5d7974f95dabb042a39a89
2026-09-19 00:52:56 +00:00
Adam Perry @ OpenAI
d5b29951ac Centralize retry decisions and delays in CodexErr (#46540)
## What changed

Replace `is_retryable()` with `retry_delay(retry_count)`, which returns `None` for terminal errors and a delay for retryable errors. Prefer server advice when present; otherwise use exponential backoff with jitter. Keep `server_retry_delay()` for callers that need only the server-provided delay.

Route sampling and remote compaction errors through the shared response stream handler, which now checks retryability and obtains the delay together. Preserve server-only retry timing when the retry budget is exhausted.

## Testing

Add coverage for attempt-dependent backoff, zero-duration server advice, and terminal errors that remain non-retryable despite server advice. Update API mapping and provider tests to use the combined retry API.

GitOrigin-RevId: 903f92935e71dea043afe1fad8ccb9389471aa75
2026-09-19 00:46:30 +00:00
papayo-oai
b244e9bafe Add a command-start callback for tool lifecycle extensions (#46539)
## What changed

Add `ToolLifecycleContributor::on_command_start` with `CommandStartInput` carrying the resolved command, working directory, selected executor's filesystem, and lifecycle context. Await contributors after command hooks and environment resolution so they can prepare the filesystem before `exec_command` runs, including calls from code mode.

Reserve process IDs only after preparation completes so cancelled preparation does not consume an ID. Keep deterministic process IDs from being reused after removal.

## Testing

Add tests for direct and code-mode calls that verify callbacks receive hook-rewritten commands and the executor's working directory, filesystem preparation completes before execution, and interrupted preparation prevents execution without consuming a process ID. Add a regression test for deterministic process ID reuse after removal.

GitOrigin-RevId: d10bcafcc583a6e3e8b5924d004806727e3763bb
2026-09-19 00:46:06 +00:00
pash-openai
22dea11020 Allow unrelated namespace mounts in Linux sandbox socket checks (#46535)
## Why

Namespace mounts can have roots such as `mnt:[inode]` or `net:[inode]` that are not filesystem paths. Treating every mount root as a path rejects these unrelated mounts and prevents sandbox startup.

## What changed

Parse mount roots as paths only for the daemon socket's filesystem. Continue validating every mount destination and checking mount ancestry, nested mounts, and socket aliases.

## Testing

Add regression cases for namespace mounts, invalid destinations, and socket aliases, both with and without a mount ID. Extend the socket-isolation integration fixture with an unrelated network namespace mount to exercise successful startup and rejection of a real socket alias.

GitOrigin-RevId: 9a1d2a69e5bd3f8d09b1de7cf998ee6d9c6bb980
2026-09-19 00:31:23 +00:00
Michael Bolin
ab59b78287 Support env_inherit in workspace_root_test (#46534)
Add an `env_inherit` string-list attribute and pass it to
`RunEnvironmentInfo.inherited_environment`, allowing tests to inherit
selected environment variables from the calling environment.

GitOrigin-RevId: 4ea868bda2d80dd57a8fc139ffa9625cb8311b37
2026-09-19 00:30:30 +00:00
Celia Chen
61b08f1011 Disable reasoning summaries by default for new TUI threads (#46533)
## What changed

Default `model_reasoning_summary` to `none` instead of `detailed` when starting a new TUI thread, while preserving explicit settings. Enabling `features.concurrent_reasoning_summaries` alone no longer enables summaries.

## Testing

Update thread configuration and embedded app-server request tests to cover the disabled default, explicit summary settings, and concurrent summary delivery.

GitOrigin-RevId: 16b0711d92c28944afd6bc85d44a9de0282a6533
2026-09-19 00:30:05 +00:00
Jeremy Rose
01f92c5780 Remove com.apple.runningboard from Seatbelt platform defaults (#46532)
GitOrigin-RevId: 746bc891b26813edfff339637400d519198708d9
2026-09-19 00:20:02 +00:00
felixxia-oai
f5b7ca7249 Preserve request-level reasoning effort for memory and title workers (#46531)
## Why

Memory consolidation and ephemeral title generation need to use their selected request-level reasoning effort even when managed settings enable reasoning-effort overrides.

## What changed

- Exempt current and legacy memory consolidation sessions and ephemeral `thread_title` threads from reasoning-effort overrides.
- Tag temporary title threads with `thread_title` and keep them excluded from agents overview refreshes. Recap threads retain the `system` tag.
- Preserve override behavior for persisted `thread_title` threads and other ephemeral threads.

## Testing

Extend regression coverage to verify request effort, omission of effort updates from exempt workers' requests, preservation of inherited history, title thread tagging, and overview filtering.

GitOrigin-RevId: 8dbc2eb13509f9c80f90d5798a56ea33fad2a0bc
2026-09-19 00:19:20 +00:00
felixxia-oai
78d4d983d3 Gate reasoning effort updates on explicit model support (#46530)
## Why

Using Responses Lite does not establish whether a model accepts reasoning-effort `configuration_update` items. Unsupported models need to use the selected request-level effort, including when resuming history containing saved updates.

## What changed

- Add `supports_reasoning_effort_updates` model metadata, defaulting to `false`.
- Require the override feature, an OpenAI provider, and explicit model support for reasoning effort updates, independently of `use_responses_lite`.
- Filter saved configuration updates from unsupported requests without changing persisted history.
- Clear the pinned effort baseline when sampling with an unsupported model so returning to a supported model establishes a fresh baseline. Compaction uses the selected effort without clearing the pin.

## Testing

Add coverage for supported models with either Responses mode, unsupported-model history filtering over HTTP and WebSocket, switching to an unsupported model and back, and compaction versus sampling pin behavior. Verify missing capability metadata defaults to `false`.

GitOrigin-RevId: 8a0fbc141964bd854dbcdd6f31e1c8e97697cf22
2026-09-19 00:18:56 +00:00
Eric Traut
1537497e52 Allow compatible feature overrides when starting the shared daemon (#46529)
## Why

Feature overrides previously forced embedded mode even when they could work with the shared daemon. A running daemon can also have different feature settings from the current invocation, including when the invocation uses defaults.

## What changed

- Allow selected Boolean feature overrides and `suppress_unstable_features_warning` in daemon mode. Keep explicit overrides that disable shared services in embedded mode.
- Pass shared-service feature overrides to newly launched daemons and persist them for restarts and updates without changing a running daemon's settings.
- Check daemon feature settings with `experimentalFeature/list` before attaching. Warn and fall back to embedded mode on mismatches, failed checks, or an incompatible code-mode host fallback policy. Skip this check for the agents overview.
- Resolve worktree configuration before daemon selection and allow worktree sessions to auto-start the daemon.
- Forward `suppress_unstable_features_warning` in thread configuration overrides.

## Testing

Add coverage for override eligibility and precedence, launch-feature persistence and reuse, and TUI fallback warnings for feature and host-policy mismatches. Extend worktree integration coverage to exercise daemon auto-start and warning suppression.

GitOrigin-RevId: 68c316f74843b1dfd8fa39bdb48bd1f649fee57f
2026-09-19 00:14:40 +00:00
papayo-oai
6cf2ff11b3 Bind executor plugin measurements to the trusted plugin version (#46528)
## Why

Identical script contents across plugin versions do not establish that the same measurement declaration applies. Resolving measurements through generic command attribution could use a different version's declaration, while shared helper paths could make attribution ambiguous.

## What changed

- Match canonical executor paths against trusted plugin identities before comparing script contents. Require an exact version match for measurements while retaining attribution across versions with matching contents.
- Keep measurement declarations bound to the selected trusted root, and allow distinct versions to coexist when extending trusted roots.
- Add `PluginMeasurementTarget` to extract an untrusted plugin/version hint from canonical remote cache paths, respecting Windows and POSIX path conventions.
- Skip executor lookups for unrelated scripts so attribution does not wait for executor provisioning.
- Increase the login unit test timeout in Bazel to `long`.

## Testing

Add regression coverage for multiple plugins and versions, canonical aliases, symlink escapes, path casing, and executor lookup avoidance. Add a remote execution integration test verifying that mismatched versions retain command attribution but receive no metrics sidecar, and matching versions use the trusted measurement declaration.

GitOrigin-RevId: d63430b37bf2de360c8d09af7f7453a5b5024d72
2026-09-19 00:14:07 +00:00
Ian MacLeod
6adaf3cac4 Pin WinGet publishing dependencies in the release workflow (#46527)
## Why

The WinGet Releaser action references `cargo-binstall@main`, violating the requirement for full commit SHA action pins.

## What changed

Replace the action with explicit steps that install SHA-pinned `cargo-binstall` version `1.23.0` and `komac` version `2.16.0`. Discover the published Windows archive URLs and require two matching assets before submitting the `OpenAI.Codex` update.

Use `komac` to sync the publishing fork, submit the WinGet update, and clean up merged branches.

GitOrigin-RevId: da4da51937a372b841f42420b5bf775a9c151e4e
2026-09-19 00:13:44 +00:00
felixxia-oai
5701a576cc Retry busy executable launches in packaged daemon tests (#46524)
## Why

Freshly copied executables can briefly remain busy on Linux CI workers, causing packaged daemon tests to fail at launch.

## What changed

Retry the command launch in `packaged_daemon_launch` up to twice on `std::io::ErrorKind::ExecutableFileBusy`, waiting 10 ms between attempts. Other launch errors still propagate immediately.

GitOrigin-RevId: afb6213173a7ae4bcfe2e1e6fab6ced65ab5bf77
2026-09-19 00:08:18 +00:00
iceweasel-oai
74af2496c9 Default local binding to true for MXC managed networking (#46523)
## Why

MXC's native host-loopback access is bidirectional, so it cannot enforce `allow_local_binding = false`. Treating an omitted setting as `false` prevents managed networking from working with the default configuration.

## What changed

- Preserve an omitted `allow_local_binding` until the executor's sandbox policy is known. Default to `true` for Windows MXC and `false` elsewhere, including remote execution.
- Reject an effective `false` for MXC managed networking after applying policy restrictions, without enabling disabled networking.
- Use the executor's resolved value for remote network approval decisions while preserving explicit controller restrictions.
- Document that local binding permits local servers and direct host-loopback connections and skips additional private-network destination checks; proxy domain rules still apply.

## Testing

Add coverage for per-executor defaults, explicit values, MXC rejection of `false`, and remote network review cleanup with the resolved policy.

GitOrigin-RevId: 0fa7c1eaec68bebada2b8f7af45688315eea70a9
2026-09-19 00:00:01 +00:00
felixxia-oai
3fd9e7e30e Enable Guardian parent-compaction reuse by default (#46522)
## What changed

Promote `guardian_reuse_parent_compaction` to stable and enable it by default, allowing Guardian to reuse encrypted parent compaction when restarting review sessions.

## Testing

Update Guardian tests to rely on the default setting, including evidence retention after compaction and resume. Adjust cache-key assertions to verify that parent-history changes invalidate cached review sessions by default, while explicitly disabling reuse preserves the previous behavior.

GitOrigin-RevId: 196aff1e91d022490b3782f6c7b5f168907efab9
2026-09-18 23:59:40 +00:00
jif
d6fb836f31 Use macOS member fallback in shared process-group termination helpers (#46521)
## Why

On macOS, process-group signals can be denied even when individual members can be signalled. Core execution cleanup used helpers that did not retry those signals against group members.

## What changed

- Make `terminate_process_group` and `kill_process_group` use the existing member fallback on macOS, and simplify MCP and pipe callers to use the shared helpers.
- Use the saved process-group ID when escalating cancellation after the termination grace period, so this path also uses the fallback.
- Update the unsafe process-group ID test to exercise `terminate_process_group`.

GitOrigin-RevId: 1bab28d3d53cd401b51ffe71d41fbece12aed66d
2026-09-18 23:59:18 +00:00
jif
4b9e7f6473 Use paused time in sampler and model catalog timeout tests (#46519)
## Why

Timeout tests can avoid waiting for real deadlines by advancing Tokio's clock, but automatic advancement can expire requests before they reach the mock server.

## What changed

Pause Tokio time in the stalled-header sampling and model catalog deadline tests. Keep polling until the mock server receives each request, then explicitly advance past the relevant timeout. Add bounded wall-clock waits and fail if a request completes before reaching the server.

Preserve assertions for sampling retry exhaustion, connection permit recovery, and the catalog's `RequestTimeout` error.

GitOrigin-RevId: 252be25d75d73c713a4b8ccac1ff20ad820df556
2026-09-18 23:58:56 +00:00
jif
cdfda82386 Handle delayed process startup in the Guardian network approval test (#46518)
## Why

Process startup can outlast the first `exec_command` yield, causing the network approval test's fixed response sequence to route a Guardian response to the parent request.

## What changed

Match mock responses by request role and call ID, and poll running sessions with `write_stdin` until final output is available. Check the allow and deny outcomes against that final output while preserving the action-routing assertions.

GitOrigin-RevId: 2ea31d1bfd5a46adc6561580783e916dfab15996
2026-09-18 23:49:09 +00:00
jif
e811c2832a Stabilize the TUI exit interruption test (#46517)
## Why

The test launches a real shell, but its fixture uses a working directory that does not exist on clean runners. Waiting only for a turn-start notification also does not establish that the shell is running before interruption.

## What changed

- Give `exit_interrupts_before_requesting_shutdown` a temporary working directory.
- Replace the fixed 30-second sleep with a loop that stays alive while a temporary directory exists, with cleanup allowing the command to finish if the test fails early.
- Wait for both the turn ID and `exit-test-ready` output within a single 10-second timeout, and fail immediately if the turn completes before interruption.

GitOrigin-RevId: d8f92b941b3fe8a077f447c6bf705a2ef922db03
2026-09-18 23:48:49 +00:00
jif
d374a93b41 Handle completion timing in the multi-agent resume test (#46516)
## Why

A grandchild's completion can arrive while the worker is completing its response, triggering an extra sampling request to drain the message. The cold root resume test previously allowed only one worker completion request.

## What changed

Match worker completion requests by the nested spawn's `function_call_output` and allow one or two requests. Scope the mock to the initial worker's lifetime and drop it before the follow-up phase.

GitOrigin-RevId: 10e0a429e6e1f51b5f04a86e3351c5fa4df9cb66
2026-09-18 23:47:19 +00:00
jif
8933a816eb Replay guardian checkpoints into a fresh session in tests (#46514)
## Why

Replaying a checkpoint into the original session can let preserved live state
mask missing checkpoint data.

## What changed

Update `guardian_checkpoint_preserves_live_context_without_storage` to restore
forked history into a fresh session with the matching guardian context mode.
Keep the existing context restoration assertions for both `Legacy` and
`ThreadOwned` modes.

GitOrigin-RevId: 211b567f6b33ffca6dc51110a208aec234004b98
2026-09-18 23:39:52 +00:00
jif
7fb599de8c Rename AgentControl to LocalAgentControl (#46513)
GitOrigin-RevId: a8e8a5c818a1751c5d2667f5af87e481482fc7db
2026-09-18 23:39:30 +00:00
jif
0f7c8608bd Capture Guardian review checkpoints from live context (#46512)
## Why

Committing a Guardian review snapshot currently flushes and reloads the transcript from storage, even though the completed model context is already available in memory.

## What changed

- Build forkable checkpoints directly from live session state, preserving model history, retained Guardian context, world state, turn context, and token usage.
- Preserve compaction window metadata and MCP resource origins in the checkpoint.
- Recognize prior user turns inside compacted replacement history.

## Testing

Add round-trip checkpoint tests for legacy and thread-owned Guardian context without storage, including preservation after live history is mutated. Extend the review compaction test to assert that checkpoints do not load history from storage.

GitOrigin-RevId: cb2638ca93bba6ab4472de50c7e2913e1a2f25a8
2026-09-18 23:37:35 +00:00
Charlie Marsh
05a93a8a1d Avoid cloning excluded turn items during thread resume (#46511)
## Why

Resuming a running thread with a summary initial page cloned every active-turn item before discarding those outside the summary, including potentially large reasoning payloads.

## What changed

- Snapshot the active turn using the requested `TurnItemsView`, copying only the first user message and final agent message for summaries and no items for `NotLoaded`.
- Preserve full snapshots when the resume response includes full turns, even if its initial page requests a summary.
- Share item selection between snapshots and page responses, and skip selection when a turn already has the requested view.

## Testing

Add unit coverage for summary selection, completed-turn metadata, and metadata-only snapshots. Extend running-thread resume coverage for default summaries, explicit full pages, and full turns returned alongside a summary page.

GitOrigin-RevId: 6ddcd93c44dbc8083827ac82f442b31730a4edde
2026-09-18 23:37:11 +00:00
Charlie Marsh
dfb265764d Avoid cloning active turn items for metadata-only thread resumes (#46510)
## Why

Resuming a running thread cloned the active turn's items even when the response did not need them.

## What changed

Add a metadata-only turn snapshot and use it for resume status checks and initial pages with `TurnItemsView::NotLoaded`. Only snapshot items when including turns or requesting an initial page with items, preserving item data for `Summary` and `Full` views.

## Testing

Add lifecycle coverage for metadata snapshots and extend running-thread resume tests to check metadata-only responses and populated `Summary` and `Full` pages.

GitOrigin-RevId: 281a2b7e1faf3a3fc07e007a065b16235eda08b6
2026-09-18 23:33:08 +00:00
jif
36430b3688 Flush completed Guardian reviews before delivering decisions (#46509)
## Why

The parent could receive a Guardian decision before the review's terminal event was flushed, allowing the reviewed action to start while completion was still being saved.

## What changed

Flush the review transcript and `TurnComplete` event together before delivering completion to the parent. Clear the reviewer's active turn before delivery so the parent can immediately request another review. Skip redundant completion flushes for Guardian reviewers while retaining the existing pre-completion flush on errors and cancellation.

## Testing

Add a gated thread-store regression test covering two consecutive reviews in the same reviewer thread. Verify that each save includes `TurnComplete` and that the approved command cannot start while the save is blocked.

GitOrigin-RevId: 9274b08ddba1ea93d4fb4709bbfdc2ccaea866ab
2026-09-18 23:28:13 +00:00
jif
2b84296288 Refresh the model catalog before turns after auth changes (#46508)
## Why

Credential changes can leave the in-memory model catalog associated with a different identity, causing subsequent turns to use bundled model metadata instead of the active credentials' catalog.

## What changed

- Refresh mismatched catalogs before user turns and mailbox-triggered wakeups, resolving lazy command credentials before comparing identities.
- Reuse a matching cache or fetch models with a five-second deadline covering auth resolution and cache access. Preserve fallback behavior on failure or timeout; static catalogs need no refresh.
- Recheck the active turn after discovery so an interrupted wakeup does not continue starting a turn.

## Testing

Add coverage for user and mailbox turns after credential rotation, including switching back after another identity replaces the shared catalog. Verify refreshed context windows and request behavior, fallback on discovery failure or auth timeout, and command-auth token rotation.

GitOrigin-RevId: 7e4ad25f1c4476e2023225731924af28c1181767
2026-09-18 23:26:12 +00:00
jif
8003609cc7 Run Windows sandbox tests exclusively when local (#46507)
## Why

Sandbox setup rotates machine-wide account passwords. The process-local test lock cannot prevent concurrent `exec-server` elevated filesystem tests from changing those passwords between setup and logon.

## What changed

- Add the Bazel `exclusive-if-local` test tag to `windows-sandbox-rs` to prevent this overlap during local test execution.
- Include the full error chain and sandbox log when the elevated non-TTY command test fails to spawn a session.

GitOrigin-RevId: bba87fc606ea60a35cf0451ed0ef68ef2eb14d3a
2026-09-18 23:25:49 +00:00
jif
12acac2a66 Share ChatGPT cookies between HTTP and WebSocket transports (#46506)
## Why

WebSocket handshakes did not reuse the HTTP cookie store or retain response cookies, so routing cookies such as `__oailb` were unavailable to subsequent connections.

## What changed

- Reuse the HTTP factory's ChatGPT cookies for secure WebSocket handshakes, preserving explicit `Cookie` headers and marking generated headers sensitive.
- Retain allowlisted infrastructure cookies from both successful and rejected upgrades. Keep configured cookies scoped to their factory and exclude account and session cookies from the shared store.
- Apply HTTPS cookie scope to `wss` requests, preserving host and path restrictions and excluding insecure `ws` requests and non-ChatGPT hosts.

## Testing

Add HTTP/WebSocket cookie-sharing coverage and local TLS handshake tests for routing-cookie reuse across connectors, rejected-upgrade refreshes, explicit header precedence, cookie scope, session-cookie exclusion, and deletion.

GitOrigin-RevId: 6bd6afe16e97cf9758ca7ba207a4e88c969497a4
2026-09-18 23:17:17 +00:00
rhan-oai
cc7591646e Support catalog parameter schemas for Multi-Agent V2 tools (#46505)
## What changed

Add optional JSON-encoded `parameters` to catalog tool messages and apply them to all six Multi-Agent V2 tools, including plain, namespaced, and code-mode exposure. Schema selection follows the active model, including mid-turn model changes.

Require an object schema supported by the existing `JsonSchema` subset and preserve bundled encryption annotations. Fall back to bundled parameters when overrides are missing, invalid, unsupported, or omit encrypted properties. Tool execution and argument handling remain unchanged.

## Testing

Extend integration coverage for schema overrides, fallback behavior, encryption annotations, exposure modes, and mid-turn model changes. Add a snapshot scenario exercising `list_agents` with a catalog parameter schema.

GitOrigin-RevId: 978be6d5f7e6a6865969922be5483bc697b20aca
2026-09-18 23:16:56 +00:00
Eric Traut
907b751eab Add six bundled TUI themes and theme-aware accents (#46504)
## What changed

- Bundle `ada`, `babbage`, `curie`, `cushman`, `dali`, and `davinci` themes for configuration and the theme picker, preserving precedence and invalid-file warnings for custom themes with the same names.
- Use `codex.accent` for active and selected controls on truecolor and 256-color terminals, retaining existing fallbacks at lower color depths.
- Honor terminal-default diff backgrounds and clear matching gutter fills, allowing `dali` and `davinci` to show diffs without background fills.
- Restrict Windows native palette fallback to `ConsoleWindowClass` so a ConPTY palette is not mistaken for the renderer's colors when OSC probing fails.

## Testing

Add tests and snapshots for theme preview, selection, cancellation, custom-theme precedence, invalid-file warnings, accent color depth, and disabling individual diff fills.

GitOrigin-RevId: 72f3ef08f82626436dd2d80d40210cc77e1a5616
2026-09-18 23:16:04 +00:00