Commit Graph
11665 Commits
Author SHA1 Message Date
jif f542ba68e5 Clarify V2 spawn model override guidance for context catalogs (#49786)
## What changed

When the model catalog is provided in context and model overrides are exposed, tell V2 `spawn_agent` callers to inherit the current model unless the user explicitly asks for a different model. Include this guidance even when spawn metadata is hidden.

## Testing

Extend tool-description tests to cover hidden metadata with both inline and context catalogs, and update request-level assertions for V1 and V2 model override guidance.

GitOrigin-RevId: b70b0f09b0b5987a0eccba578196b8ef7cee4baf
2026-10-01 00:57:53 +00:00
Raunak Daga 1f77c0cfa6 Persist empty paginated threads when naming them (#49785)
## Why

Naming a paginated thread before its first turn must make it durable so it can be resumed immediately and after an app-server restart.

## What changed

Persist the live rollout before updating name metadata in SQLite. Propagate persistence failures before saving the name.

## Testing

Add thread-store tests for empty-thread persistence and failure handling, plus an app-server regression test that resumes a named empty thread before and after a restart and completes its first turn.

GitOrigin-RevId: 2f7556c7de65f6a86177130c39e1a17951496931
2026-10-01 00:57:29 +00:00
Oliver Tepman 3bbf8ec3a1 Add a requirements feature gate for the browser annotation API (#49784)
## What changed

Register `browser_annotation_api` as a stable, default-enabled feature intended for requirements rather than user configuration. It controls websites opening and customizing annotation tools in desktop apps, independently of ordinary user-driven annotation.

Add the key to the configuration schema, extending the browser requirements support introduced in https://github.com/openai/codex/pull/18956.

## Testing

Extend `browser_feature_requirements_are_valid` to verify that enterprise requirements setting `browser_annotation_api = false` disable the feature.

GitOrigin-RevId: 8c7bb65932e08560040958b4472fe45f6d1c916f
2026-10-01 00:56:25 +00:00
Eric Traut 106772e3c6 Preserve background thread requests when forking in the TUI (#49783)
## Why

Switching to a fork can interrupt approval routing for source and child threads that remain on a local daemon or remote app server. Their pending requests and event listeners need to survive the switch.

## What changed

- Retain background request routing and event listeners for tracked threads when switching to a daemon-backed fork, preserving pending approvals without duplicating them.
- Register the source thread before the `fork_thread` tool creates a fork so its requests remain routable during the operation.
- Route requests for the currently viewed thread to the active UI, even when that thread is also tracked in the agents overview.

## Testing

Add regression coverage for local daemon and remote forks retaining source and child threads, replaying pending requests when returning to the source, and displaying active-thread file-change approvals. Verify that embedded forks still discard the source thread state and that `fork_thread` registers its source before issuing the fork request.

GitOrigin-RevId: 63139e2b9a6eff373ab05a31e0140a432ce47389
2026-10-01 00:48:32 +00:00
jif 1a913493dc Clean up process groups for failed shell snapshot captures (#49782)
## Why

Failed shell snapshot captures could leave processes launched by shell startup files running after the capture ended.

## What changed

Run each Unix shell snapshot capture in its own process group and kill that group on failure, timeout, or cancellation. Keep the capture leader unreaped until output and exit status are validated so its process group ID cannot be reused during cleanup. Preserve startup helpers after a successful capture.

## Testing

Add regression coverage for startup child cleanup after nonzero exits, invalid output, cancellation, and timeout, alongside fallback and retry behavior. Verify that successful captures preserve delayed startup output and background services and reuse the cached snapshot.

GitOrigin-RevId: a56ef5d8615325952bdc8bb78727de1559e7e9c7
2026-10-01 00:48:08 +00:00
zm-oai 8953de1f1a Include the environment's MXC backend in MCP sandbox metadata (#49781)
## What changed

Capture each environment's effective Windows sandbox backend in the MCP runtime and include it as `useMxc` in sandbox state metadata for supporting servers. Use the server's captured environment selection, including local fallback, so the local MXC preference does not leak into attached environments. Default missing backend information to `false`.

## Testing

Extend tests to cover MXC metadata handoff, attachment isolation, local fallback without a selected local environment, and preservation of captured backend settings across runtime refreshes.

GitOrigin-RevId: f559bffeff383838334e5a475b1eab608d571fa1
2026-10-01 00:47:44 +00:00
Adam Perry @ OpenAI 875bf9209b Define exec-server protocol types for streamed file writes (#49778)
## What changed

- Add `read` and `replace` modes to `fs/open`, defaulting omitted modes to `read` for existing callers.
- Define `fs/writeBlock` request and response types for offset-based writes, with a maximum decoded chunk size of 1 MiB.
- Add the `fileWriteStreaming` capability, defaulting to `false`. Keep writable streams unsupported in the server and explicitly reject replacement opens.

## Testing

Add a protocol test verifying that legacy `fs/open` requests without a mode deserialize as read-only opens.

GitOrigin-RevId: 4d3997717e821cd1f62df12a03c8eec36332a66d
2026-10-01 00:43:55 +00:00
dennyku 60947e2341 Add account security setup reminders to the TUI (#49715)
## What changed

Fetch optional security setup notices asynchronously for local ChatGPT sessions using the OpenAI provider. Verify that saved credentials match the connected app server, ignore stale account responses, and validate notice text and HTTPS actions on `chatgpt.com`.

Show notices as dismissible inline banners with a browser action, while giving applicable usage banners priority. Preserve notice state and dismissal across thread changes, reconnects, and banner replacement for the same account and user.

## Testing

Add authenticated HTTP fixture tests, notice validation tests, and TUI tests covering stale responses, dismissal persistence, usage banner priority, browser actions, and wrapping in narrow terminals.

GitOrigin-RevId: b8635fcf6a26b42b6a06640601c8517d8d5e47e8
2026-09-30 19:22:34 +00:00
Brian Lee f151a0f5c2 Decouple API-key cyber access programs from model discovery (#49714)
## What changed

Allow API-key sessions using the OpenAI provider to forward explicit cyber access programs when `features.api_key_cyber_access_programs` is enabled, regardless of `features.api_key_model_discovery`.

## Testing

Expand the app-server test to cover all four combinations of the two feature flags, checking forwarded programs and failures when forwarding is disabled. Default the API-key test helper to model discovery disabled.

GitOrigin-RevId: f9cf1d2bd7c231645d50178cc6721b55a8d63268
2026-09-30 19:21:02 +00:00
Adam Perry @ OpenAI 18131270fe Remove repository-local Codex guidance, skills, and environment config (#49713)
## What changed

Delete the root `AGENTS.md`, the skills under `.codex/skills/` and their supporting scripts, tests, and references, and `.codex/environments/environment.toml`.

GitOrigin-RevId: 555482804c79d17f9aa5587c4d26ea03337db8d9
2026-09-30 19:16:41 +00:00
jif 5e96aabd68 Avoid full-string scans in token-budget truncation (#49712)
## Why

Token-budget truncation uses byte counts to estimate tokens, but previously scanned the entire string to count characters, including the discarded middle.

## What changed

Use UTF-8 boundary lookups to select the retained prefix and suffix for token-budget truncation. Skip character counting for a zero-token budget and defer it to paths that need character counts.

## Testing

Add regression coverage for multibyte characters crossing both retained boundaries, checking the truncated output and original token estimate.

GitOrigin-RevId: 37fee0c8d4ede8e74b491d3d641b0ea0e9003dd4
2026-09-30 19:14:56 +00:00
Dmitriy Kovalenko 596ae94fb0 Classify SQLite corruption using typed error codes (#49710)
## What changed

Preserve the underlying error in `LocalStateDbStartupError` and use its error chain to decide whether CLI startup failures qualify for automatic database backup and recovery.

Replace corruption checks against error-message text with SQLite result-code classification, including SQLx extended result codes and directly wrapped `SqliteError` values.

## Testing

Update the embedded startup corruption test to verify that the startup error retains a detectable SQLite corruption cause and the failed database path.

GitOrigin-RevId: 6e8ecd0ee67f3c239183ddea3fc75c4e4cd5744a
2026-09-30 19:00:00 +00:00
Charlie Marsh 4f699cd642 Move session index I/O off async runtime threads (#49708)
## Why

Session index updates perform synchronous file I/O and wait on a blocking mutex inside async functions, blocking runtime threads.

## What changed

Run appends and thread-name removals in `spawn_blocking` workers. Acquire a Tokio mutex before dispatch and keep its owned guard in the worker so queued and running updates remain serialized even if the awaiting task is cancelled. Move the lookup's file-existence check into its blocking worker as well.

## Testing

Add tests for lock retention after cancellation of running and queued updates, write ordering after cancellation, and removal that preserves other thread names and malformed lines.

GitOrigin-RevId: 368745d8e5bbf24c527facc0a62ddd0fb76f0ffb
2026-09-30 18:51:29 +00:00
Tamir Duberstein 17e5a4dbcb Upgrade the argument comment lint toolchain and Dylint (#49706)
## What changed

- Move the lint to `nightly-2026-08-20` and Dylint `6.1.0`, updating CI, release artifacts, Bazel configuration, and installation instructions.
- Adapt to the updated rustc and Clippy APIs, including resolving `Option::None` through type aliases when checking for uncommented arguments.
- Set the `chatgpt` crate's `recursion_limit` to `256`.

## Testing

Extend the UI fixture to expect an uncommented-argument warning for `OptionalString::None`, where `OptionalString` aliases `Option<String>`.

GitOrigin-RevId: 34e1b173972f0bfa9b6c8fd3342ca652539efe2f
2026-09-30 18:49:29 +00:00
Ian MacLeod 5602705c96 Prevent npm alpha dist-tags from moving backward (#49704)
## Why

Publishing an older alpha or alpha hotfix can overwrite npm dist-tags that already point to a newer release.

## What changed

Check each package's current npm dist-tag before publishing an alpha release, using the existing release version comparison and workflow concurrency lock. Handle `alpha` and platform-specific tags independently for Codex, the SDK, and the responses API proxy.

When the release does not advance the current version, publish under `release-<version>-<tag>` to keep it installable without changing the alpha or `latest` tags. Abort publishing if the registry lookup fails.

## Testing

Add unit tests for package and platform tag selection, older releases, dotted alpha hotfixes, missing tags, and registry lookup failures.

GitOrigin-RevId: 9c0edec1149bf78c01aac0f700e963630316eaea
2026-09-30 18:40:47 +00:00
Adam Perry @ OpenAI 3b16b5a5b0 Rename exec-server file handle management identifiers (#49702)
## What changed

Rename `file_read` to `file_handle` and `FileReadHandleManager` to `FileHandleManager`. Update the filesystem handler field, handle ID validation helper, and related constants to use file handle terminology. File operations, limits, and error messages remain unchanged.

GitOrigin-RevId: 25ad81a917386da23fd42ecff79bd47a482ce430
2026-09-30 18:37:18 +00:00
Dmitriy Kovalenko 3620b2caf8 Detect SQLite corruption during startup and preserve recovery backups (#49701)
## Why

A database can open successfully while containing corruption that startup previously missed. Detecting it before runtime initialization completes allows recoverable databases to be rebuilt while preserving the damaged files.

## What changed

- Run `PRAGMA quick_check(1)` when opening writable databases, with a 100 ms scan budget. Share attempts across cloned `SqliteConfig` instances by file identity so repeated opens skip validation and replacement files are checked again.
- Back up and rebuild runtime databases that support recovery. Report corruption without rebuilding thread history or other databases without an automatic recovery policy. Treat interrupted or locked checks as incomplete rather than confirmed corruption.
- Collect startup backups across recovery retries and include their locations in the app server warning. Explain that saved conversations can restore the thread list and history, while some database-only metadata may be unavailable.
- Record confirmed corruption in `codex.sqlite.corruption.count`.

## Testing

Add tests for recovery policies, backup preservation, validation caching and concurrency, cancelled and interrupted checks, and locked databases. Add app server coverage for recovery warnings and saved conversation restoration, a TUI warning snapshot, and message board post preservation.

GitOrigin-RevId: 43e26328888e0301def642d69bd324acee867566
2026-09-30 18:29:46 +00:00
Charlie Marsh f2b2e5b2a9 Make exec-server file reads cancellable between chunks (#49696)
## What changed

Run direct `read_file` operations in a blocking task with bounded read chunks and cancellation checks. Dropping the async caller cancels further reads between chunks. Preserve the 512 MiB size limit, symlink-following options, and regular-file validation.

## Testing

Add regression coverage for 4 MiB reads and oversized-file rejection with both symlink-following options, cancellation after the first chunk, and FIFO rejection without waiting for a writer.

GitOrigin-RevId: 19f2816de15a03bd89b463de6b002367e6a692a9
2026-09-30 18:18:03 +00:00
Charlie Marsh 5aa92804d2 Batch rollout listing scans on cancellable blocking workers (#49694)
## What changed

Move directory enumeration and candidate metadata lookups into blocking workers, batching updated-time candidate collection into one worker per scan. Check cancellation between entries and metadata lookups so dropping the async waiter stops further scanning.

Share synchronous rollout metadata resolution with the async helper, preserving plain-file precedence over compressed siblings. Retain scan limits, stable file ordering, and directory-level early stopping for creation-time listings.

## Testing

Add tests for cancellation during directory enumeration and candidate discovery in both flat and date-partitioned layouts, including plain-sibling metadata precedence and filtering of unrelated files, directories, and symlinks.

GitOrigin-RevId: 324289003b29a7d2b3220da03e3c002ab5e23eec
2026-09-30 18:03:48 +00:00
Charlie Marsh ecc205edac Move thread history projection into one blocking task (#49693)
## What changed

Run rollout file opening, metadata lookup, seeking, reading, and record
projection together in a single `tokio::task::spawn_blocking` call. Use
synchronous file I/O in `read_projection_steps_sync` and carry the current
tracing span into the blocking task.

GitOrigin-RevId: a231a8b9a328f6d2e2095a29cde1718ccb6b3901
2026-09-30 18:03:22 +00:00
npancha-openai d1c4e3c3e6 Keep compressed rollout snippet searches on one blocking worker (#49692)
## Why

Compressed snippet searches schedule a blocking task for every line read. Keeping the scan on one worker avoids repeated task scheduling.

## What changed

Use `RolloutLineReader::find_map` to scan compressed rollouts on a single blocking worker, stopping at the first matching snippet. Preserve read metrics and stop delivering records when the search is canceled, including cancellation during a read.

## Testing

Add tests for first-match snippets, case-insensitive literal matching, malformed records, missing matches, stream errors before a match, and cancellation between lines or during a read.

GitOrigin-RevId: 295206b1a00e861bc44606bd843f6ed8c3e6aae1
2026-09-30 17:57:58 +00:00
johnl-oai 7e8878f605 Preserve PowerShell relative paths in the elevated Windows sandbox (#49690)
## Why

An inaccessible user profile directory can prevent sandboxed PowerShell from preserving its working directory and resolving relative paths in a project beneath that profile.

## What changed

Pass `USERPROFILE` to elevated setup and refresh. When the command's working directory is beneath an absolute profile path, grant the sandbox group non-inheriting `FILE_READ_ATTRIBUTES` access to the profile directory.

Preserve existing permissions and deny ACEs during non-inheriting ACL updates without propagating changes to descendants. Expand generic deny masks when checking for conflicting permissions.

## Testing

Add a Windows regression test that checks PowerShell's working directory and reading `.\public.txt` beneath a protected profile. Add an ACL test that verifies a non-inheriting grant leaves an unprotected child's security descriptor unchanged.

GitOrigin-RevId: 7f142a7ffdee795c3255d4a6e79568fa9391c055
2026-09-30 17:50:58 +00:00
jif 0a76a2520f Export skill invocation events through OpenTelemetry (#49689)
## What changed

Emit `codex.skill_invocation` logs for explicit skill injection and detected implicit use, including skill-tool reads. Include skill name, invocation type, conversation, turn, model, and client metadata, plus scope, plugin ID, and ChatGPT user and account IDs when available.

Exclude skill contents, resource paths, email addresses, prompts, and tool payloads. Use the existing OTEL log exporter without an additional opt-in; `otel.exporter = "none"` continues to export no logs.

Document the event fields, exporter configuration, and detection semantics in `codex-rs/otel/README.md`.

GitOrigin-RevId: 0f9c492c3f224455f3de3660be89692d776c1951
2026-09-30 17:45:25 +00:00
jif 49be2c7ab0 Deliver remote message board notifications to active turns (#49686)
## What changed

- Start a turn-owned notification receiver using the same remote board client and session identity as the board tools. Deliver post previews as agent messages and cancel the receiver when the turn stops, aborts, or errors.
- Wait for the initial connection attempt before inference, then retry failed or disconnected streams without waking idle agents.
- Skip malformed notices, mismatched recipients or turns, and oversized previews. Reject delivery to stale or canceled turns and bound remote notices to a 1 KiB context budget.

## Testing

Extend remote board tests to cover interrupted setup, connection failures, reconnection, invalid and stale notices, preview delivery into model context, and receiver shutdown after turn completion.

GitOrigin-RevId: c7c8d977fe74b7a5cb3bd8216dc0146f3f297e44
2026-09-30 17:33:59 +00:00
vishnu-oai 6996cde697 Add a managed feature gate for in-app voice (#49683)
## What changed

Register `in_app_voice` as a stable, default-enabled feature and add it to the configuration schema. The gate is intended for managed requirements to control permission for voice in desktop apps; permission does not establish voice availability or provider support.

## Testing

Add app-server coverage for reporting `in_app_voice = false` from `requirements.toml` in both requirements and feature-list responses. Extend the CLI feature-list test to verify that cloud-managed requirements disable the gate despite a user-configured `true` value, without rewriting the user configuration.

GitOrigin-RevId: 6ec3bc0176fdb3e1714b0136bf812bd56591f6a1
2026-09-30 17:20:35 +00:00
Ian MacLeod fcbed044c8 Escape command drafts when recovering question answers (#49678)
## Why

When a turn ends, recovered question answers are appended to the composer draft. If that draft starts with a shell or slash command, submitting the combined text can interpret it as a command instead of a prompt.

## What changed

Escape command prefixes before appending recovered answers so the combined draft stays editable and submits as literal prompt text. Convert shell mode's separate `!` prefix into escaped composer text, and leave slash-prefixed paths such as `/tmp/file` unchanged.

Keep prefix escaping and answer recovery in the same Vim undo edit.

## Testing

Add regression coverage for immediate and queued submission, whitespace around command prefixes, slash-prefixed paths, and already escaped commands. Extend Vim undo coverage to shell and slash command drafts, including shell mode, and add a snapshot of the recovered shell draft.

GitOrigin-RevId: 03c40f72a834a65bf367103cb9170a86dc35ad98
2026-09-30 17:06:14 +00:00
Justin Beckwith ed0cc1a4ab Serialize Responses routing fields before large inputs (#49675)
## Why

Gateways that inspect request bodies incrementally need routing fields before potentially multi-megabyte prompts so they can route requests without buffering the input first.

## What changed

Serialize `model`, `stream`, and optional `service_tier` before `input` in both HTTP Responses requests and WebSocket `response.create` messages. Preserve field values and omission of unset `service_tier`.

## Testing

Add an HTTP regression test with a 2 MiB input that checks routing field order and unchanged JSON contents. Extend WebSocket serialization coverage to assert the routing fields appear first, and check that HTTP requests omit unset `service_tier`.

GitOrigin-RevId: dbc174e1fe7ca30d0c00f075bc37dd5f97b27b37
2026-09-30 16:57:01 +00:00
iceweasel-oai 67727e7cf1 Allow managed requirements to disable the Windows MXC sandbox (#49642)
## Why

`windows.allowed_sandbox_implementations` permits MXC regardless of the listed implementations. Managed requirements need a separate way to block both explicit MXC configuration and automatic selection through `prefer_mxc`.

## What changed

Add the optional managed requirement `windows.allow_mxc`. Setting it to `false` disables automatic MXC selection and rejects explicit `windows.sandbox = "mxc"` configuration with an error identifying the requirement. Leaving it unset or setting it to `true` preserves existing behavior.

## Testing

Add coverage for the requirement alongside allowed sandbox implementations, preference resolution, and cloud-managed opt-out behavior for implicit, elevated, and explicit MXC configurations.

GitOrigin-RevId: a458a7b4c92cf17e687dbbad8208884d1c097da5
2026-09-30 14:37:56 +00:00
cooper-oai 7219fd735b Use server authentication for explicit remote session commands (#49624)
## Why

Session commands with `--remote` should use the selected server's authentication and execution environment, even when the caller has workload identity configured and cannot read its identity token.

## What changed

Connect `queue`, `archive`, `unarchive`, and `delete` directly to the explicit remote app server after validating configuration. Skip caller credential and runtime initialization, use remote thread parameters, and preserve the caller's working-directory override.

## Testing

Add end-to-end coverage with an unreadable caller identity token to verify queued turns use the server's API key and remote archive, unarchive, and deletion operate on the selected server. Add configuration-validation coverage for all four commands and `--no-daemon` rejection coverage for remote unarchive and delete.

GitOrigin-RevId: 5da7abbb40506cd754a8863e1a9d8fad9b1f09a9
2026-09-30 13:16:08 +00:00
felixxia-oai 92bc601ad6 Reuse unchanged history snapshots when resuming threads (#49600)
## Why

Resuming a thread rereads persisted history even when a preloaded snapshot is unchanged. Reusing that snapshot must still account for writes committed before writer ownership is acquired.

## What changed

- Carry optional, non-serialized revisions from stored history and model context through thread and agent resume paths.
- Validate the revision under writer ownership and reuse the shared snapshot when it matches. Reload stored history when the revision is missing or changed, while preserving explicit history overrides.
- Resolve the selected rollout before loading context, validate compressed snapshots before materialization, and enforce archived-thread restrictions on canonical paths.

## Testing

Extend coverage for snapshot reuse and late-write refresh in legacy and paginated histories, compressed rollout reuse, archived rollout symlinks, and cold child restoration that includes edits made after preloading history.

GitOrigin-RevId: e1fd7aee6ef2b30f41951e6b7e6b01c3e1420cab
2026-09-30 11:59:13 +00:00
felixxia-oai d7b0d4aa66 Return authoritative replay history when resuming a thread (#49599)
## Why

A stored history snapshot can become stale before a resumed thread acquires writer ownership. Resume must include writes committed before that acquisition.

## What changed

Make `ThreadStore::resume_thread` return the replay context and use it for session restoration and metadata initialization. The local store refreshes stored snapshots while holding writer ownership, reads through the installed writer to honor explicit rollout paths, and releases the writer if loading context fails. Explicit histories without a canonical session header retain their override semantics.

## Testing

Extend resume tests to cover edits made after the initial snapshot in both legacy and paginated history modes, stale SQLite rollout paths, and preservation of explicitly supplied history.

GitOrigin-RevId: 2361f524d324c859f5dfcf2863320e2045736c2e
2026-09-30 11:58:50 +00:00
felixxia-oai de02016798 Persist explicit user goal edits in model history (#49598)
## Why

User goal edits and clears need to reach the model as user instructions, including when a thread is unloaded or history is being compacted. Automatic goal lifecycle updates must not supply user authorization.

## What changed

- Add optional `origin` values of `user` and `automatic` to `thread/goal/set` and `thread/goal/clear`, and mark TUI goal requests as user actions. Omitted origins do not supply user authorization.
- Persist explicit user objective, status, and clear instructions before changing goal state. Recording failures leave goal state unchanged.
- Coordinate goal edits with thread resume, reload stored history under writer ownership, and preserve edits accepted after the compaction input snapshot.
- Update generated protocol schemas and TypeScript and Python bindings.

## Testing

Add coverage for user edits and clears on loaded and unloaded threads, concurrent path-based resume, exclusion of automatic goals from user instructions, preservation of edits during compaction, and recording failures that leave goal state unchanged.

GitOrigin-RevId: d779d7c678a0c32a6ef76975dbe5b1400d1df245
2026-09-30 11:58:03 +00:00
jif 1fc8d54807 Make the strict network approval test independent of request order (#49595)
## Why

Guardian and parent requests can arrive in either order after a command yields. A shared response sequence can let parent requests consume Guardian review decisions.

## What changed

Match Guardian responses separately and drive parent responses from the latest tool output in the strict automatic network review test. Poll running sessions with `write_stdin` until the process exits, and assert that the command and network request each receive Guardian review.

GitOrigin-RevId: 21300abd65a3b2d439e8c1ea04e4429d5bd528dd
2026-09-30 11:46:28 +00:00
jif a5cce8895a Skip host skill discovery for Guardian reviews (#49584)
## Why

Guardian does not consume skills, but host skill discovery can block its startup or turn creation when the primary executor is offline.

## What changed

Skip plugin and skill warmup during Guardian session initialization, and use an empty host skills snapshot when building Guardian turn contexts.

## Testing

Add a regression test that discovers skills for the parent session, disconnects its primary executor, and verifies that Guardian still reviews and denies a network permission request.

GitOrigin-RevId: 3c12129721c82cb78a3fa618d6b05faea631966a
2026-09-30 11:05:59 +00:00
Felipe Coury 0b43721d8d Copy selected file paths as plain text in the TUI (#49564)
## Why

Copying a rendered local file target such as `repo/foo_bar!` should preserve the selected path without adding Markdown escapes.

## What changed

Treat selections contained within rendered file targets as plain text, including partial selections and targets in tables. Coalesce adjacent file targets and inline code into literal ranges while preserving Markdown escaping when the selection includes surrounding content.

## Testing

Add regression coverage for partial paths, adjacent literal spans, styled links, table cells, special characters, and mixed selections at narrow and wide rendering widths.

GitOrigin-RevId: 94bcdacf14b013f9198cb84adfdb237eb644dd48
2026-09-30 10:21:00 +00:00
jif 2e5fea64ee Add an opt-in model catalog to multi-agent context (#49560)
## Why

Refreshing available model descriptions changes the `spawn_agent` tool schema. Keep model choices current while preserving tool definitions and earlier conversation input.

## What changed

- Add the disabled-by-default `model_catalog_in_context` feature for multi-agent V1 and V2. When enabled and model overrides are available, move model listings from tool descriptions into developer `<model_catalog>` messages.
- Include picker-visible, compatible models with descriptions, reasoning efforts, and service tiers in a listing bounded to 1,000 bytes. Point `spawn_agent` guidance to the latest catalog.
- Append updated listings only when their rendered content changes, restore missing listings, and invalidate retained catalogs when they no longer apply.

## Testing

Extend integration coverage for V1 and V2 with the feature enabled and disabled. Verify that catalog refreshes preserve tool definitions and prior input when enabled, append the updated listing once, and retain the existing tool-description behavior when disabled. Add a request-history snapshot for the V1 opt-in path.

GitOrigin-RevId: 67b11b4ad6c35f00d0e29edf6343bb0b4804d797
2026-09-30 10:03:09 +00:00
Eric Traut d42056091a Add a fork shortcut to the TUI command center (#49517)
## What changed

- Fork the selected conversation and open the new session with `f`, configurable through `agents.fork` in the TUI keymap.
- Move the default search shortcuts to `F3` and `/`, preserving unshadowed defaults when custom bindings conflict.
- Keep queued input on the source conversation while attaching and forking, and require closing an open side conversation before forking another task.
- Expose the fork action in command-center help and the keymap picker.

## Testing

Add regression coverage for queued-input preservation, side-conversation protection, configurable fork shortcuts, metadata editing, disconnected actions, and search fallback bindings. Update help and keymap snapshots.

GitOrigin-RevId: b11ae21ef6a2053609b31ce97c646104f18806a3
2026-09-30 07:15:14 +00:00
Adam Perry @ OpenAI bcd6d9ab6b Add regression coverage for account switches between analytics batches (#49489)
## What changed

Add a debug-only analytics test that switches accounts after the first isolated event request. Assert that only the first request reaches the server and carries the original account's credentials, so subsequent batches do not send stale credentials after the switch.

Remove an unused `ToolCallSource` import.

GitOrigin-RevId: e66904c7a7176f1eaa37662b836132586328884a
2026-09-30 05:29:56 +00:00
Keyan Zhang 90abcfac02 Add experimental thread prediction protocol types (#49480)
## What changed

Define `thread/prediction/request` with `threadId` and `sourceTurnId`, and `thread/prediction/updated` with a `completed` result containing optional text or a `failed` result.

Update generated JSON schemas, TypeScript types, and Python notification models. Route prediction notifications to their thread in the TUI and ignore them in the chat widget.

The request remains unimplemented and returns a method-not-found error.

GitOrigin-RevId: 09922f583d5c56f808d018121c651dcd92734515
2026-09-30 04:48:50 +00:00
Nick Steele 15fd656ddb Discover and validate MCP authorization servers before ID-JAG exchange (#49478)
## What changed

Add `exchange_ema_auth_token` to discover and validate the MCP resource's authorization server before resolving enterprise identity credentials and performing the ID-JAG token exchange. Keep the lower-level exchange primitive private.

- Probe `server/discover` with the enterprise-managed authorization extension, support recognized legacy discovery rejections, and follow protected-resource metadata challenges or well-known fallbacks.
- Match configured resource and issuer constraints, require advertised public-client JWT bearer support, and validate token endpoint metadata without requiring an authorization endpoint.
- Bound discovery with a shared timeout, redirect and authorization-server limits, reject cross-origin metadata redirects, and restrict private authorization-server destinations while allowing local loopback discovery.

## Testing

Add tests covering resource and issuer mismatches before identity access, metadata capability validation, query preservation, modern challenges, JSON and SSE legacy fallback behavior, cross-origin redirect rejection, and private or malformed issuer destinations.

GitOrigin-RevId: 9a55233a20ff42c293f9bd8175e01141ac2d8576
2026-09-30 04:30:01 +00:00
Ruslan Nigmatullin 9ef9cb1d9f Complete turn abort callbacks before emitting terminal events (#49475)
## Why

`TurnAborted` could be emitted before extension abort callbacks finished, allowing consumers to observe a terminal event while lifecycle cleanup was still pending.

## What changed

Await `on_turn_abort` within task abort handling before emitting `TurnAborted`, retaining callback delivery for already-cancelled tasks. Document that `on_turn_stop` and `on_turn_abort` complete before their corresponding terminal events, if emitted.

## Testing

Add regression coverage for interrupt, conditional interrupt, and shutdown. Hold the abort callback open to verify that `TurnAborted` waits for completion, then verify that the callback runs exactly once with the expected turn ID and abort reason.

GitOrigin-RevId: f34d7e94d04c02544178dc445b85abc65a6ce499
2026-09-30 03:45:21 +00:00
Nick Steele c9b3924a62 Use the rmcp SDK for enterprise-managed token exchanges (#49473)
## What changed

Upgrade `rmcp` to a pinned Git revision of version `3.3.0` and enable `auth-enterprise-managed`. Delegate the two-stage ID-JAG exchange and token validation to the SDK, replacing the local implementation while retaining Codex HTTP routing and credential lifecycle policy.

Map SDK errors by exchange stage so `invalid_grant` distinguishes enterprise identity failures from resource authorization failures, and preserve handling of `insufficient_user_authentication`.

## Testing

Update exchange tests to verify rejection of unsupported `authorization_details` and malformed signed scopes. Exercise errors from both token endpoints to check credential policy, prevent credential reflection in diagnostics, and ensure rejected grants are not retried.

GitOrigin-RevId: a56034aa3fd70002754ea552fd2da70bdcd85b31
2026-09-30 03:33:43 +00:00
Eric Traut b588812e8c Use server-authoritative permissions in the TUI (#49472)
## Why

Client permission definitions and constraints can differ from those on the connected app server. Accepted permission changes also need to survive task transitions before their settings notifications arrive.

## What changed

- Discover permission profiles and availability from the connected server and apply selections through `thread/settings/update`, including custom profiles.
- Adopt the server's effective permission settings instead of reapplying local definitions or constraints.
- Retain accepted selections and effective approval settings across new tasks, forks, side conversations, directory changes, reconnects, and safety retries without blocking navigation on a settings notification.
- Recognize the current built-in permission preset when the server supplies an unnamed profile.

## Testing

Add regression coverage for conflicting client/server profile definitions, rejected and unchanged selections, consecutive requests with omitted approval settings, and permission carryover before confirmation. Extend discovery and menu tests to verify server-provided availability and unnamed-profile highlighting.

GitOrigin-RevId: bcd767b58dc92dc4f945189078e51e6e5fce6d24
2026-09-30 03:33:19 +00:00
Adam Perry @ OpenAI 76a6e55d5a Restore executor tool paths after login shell startup (#49467)
## Why

Login shell startup can reset `PATH`, preventing commands and their children from finding bundled tools such as `rg` in executor-reported directories.

## What changed

When `login_shell_package_path` is enabled, prepend missing executor-reported directories to `PATH` inside the POSIX login shell before running the requested command. Preserve existing entries and the order of newly added directories, and export `PATH` for child commands.

Respect explicit `PATH` overrides and preserve the requested login mode when directories are unusable or `PATH` is read-only. Keep shell diagnostics and `$LINENO` aligned with the original script, including when directory names contain newlines. The feature remains disabled by default.

## Testing

Add shell tests for nested tool lookup, existing entries, quoting, line numbers, and read-only `PATH`. Extend remote execution tests to cover feature gating, explicit overrides, unusable directories, and preservation of the original command in execution events.

GitOrigin-RevId: 301aa34e72cc6292293693250e190c19903f390a
2026-09-30 03:22:55 +00:00
Brent Traut 8c3612fb63 Use memrchr to find newlines in reverse JSONL scans (#49444)
Replace the byte-by-byte reverse newline search with `memchr::memrchr` and add `memchr` as a dependency of `codex-rollout`.

GitOrigin-RevId: b07e42e15efb0d63d7b00ee9a2ee29c446f4cf59
2026-09-30 02:19:47 +00:00
Adam Perry @ OpenAI 6ba4bf9e64 Honor server retry advice across Responses retries and fallback (#49441)
## Why

Responses overload and exhausted-request errors could terminate despite server retry advice, and WebSocket-to-HTTP fallback could issue a request before the advised deadline.

## What changed

- Allow `ServerOverloaded` and `RetryLimit` errors to retry when server advice is present, within the configured retry budgets.
- Preserve `Retry-After` headers from rejected WebSocket upgrades and wait for the server deadline before falling back to HTTP.
- Keep quota, usage-limit, and policy failures terminal even when they include retry advice.

## Testing

Add coverage for HTTP overload and rate-limit recovery, WebSocket upgrade rejection and fallback timing, retry deadline preservation through error mapping, and retry limits for sampling and manual and automatic compaction.

GitOrigin-RevId: 72d30a9f078652664754dfa971fd7dc7a78f20e8
2026-09-30 02:12:42 +00:00
Benjamin Carlsson fc81a7154b Add local audio device selection to TUI voice settings (#49437)
## Why

Voice conversations previously opened the system-default microphone and speaker. Users need to choose which local devices to use, including when connected to a remote app server.

## What changed

- Add input and output device pickers alongside voice selection, with back navigation and a System default option.
- Persist selections as `audio.microphone` and `audio.speaker` on the TUI's machine, excluding project configuration layers. Apply them to the next voice conversation.
- Enumerate devices without opening audio streams and pass the selected names to the voice helper at startup.
- Disable ambiguous device names in the picker and use the same eligibility filtering for discovery and named-device startup.

## Testing

Add tests for device preference persistence across project and remote transitions, picker navigation and duplicate names, discovery without capture, and forwarding selected devices to the helper.

GitOrigin-RevId: d48fb3a09fa9b982a408f5a7c96bdd81776af21d
2026-09-30 01:58:03 +00:00
cooper-oai d8f69ea8bc Preserve bootstrap discovery across authentication changes (#49432)
## Why

Embedded app-server configuration discovery must remain available after login and workspace changes, while content access granted to the previous account must be revoked.

## What changed

Give `AuthRouteConfig` a separate application network policy and bind embedded bootstrap authentication to the effective application policy. Use that policy for account-owned content clients and invalidate it when the authenticated owner changes, preserving the local, endpoint-restricted bootstrap policy.

## Testing

Add a regression test covering bootstrap discovery across login, workspace changes, and sign-out; revocation of previous account clients and permits; and continued enforcement of bootstrap endpoint restrictions and local requirements.

GitOrigin-RevId: 083933e69508224f8232349ba3750c02329af06a
2026-09-30 01:44:14 +00:00
Benjamin Carlsson 2cc65cdd4c Enable analytics by default for daemon-launched app servers (#49426)
## Why

Daemon-launched app servers should use the same analytics default as first-party clients while honoring explicit user opt-outs.

## What changed

Pass `--analytics-default-enabled` when the PID backend launches an app server, with or without remote control. Users can still disable analytics with `analytics.enabled = false` in `config.toml`.

## Testing

Update argument assertions for both remote-control modes and the daemon start/restart test to expect the analytics flag alongside launch feature overrides.

GitOrigin-RevId: 8a222a00fc56737f5fe2b0385abf59466d1a6671
2026-09-30 01:35:21 +00:00
Dmitriy Kovalenko 8ea2c0e0d4 Prune diagnostic logs periodically by age and database size (#49425)
## Why

Startup-only cleanup leaves expired logs in long-running sessions, and age-based retention alone does not limit database usage.

## What changed

Run cleanup in the background immediately after initialization and every 30 minutes. Start with the existing 10-day retention window, then halve it until occupied SQLite pages fit within a 64 MiB budget or the window reaches one second. Preserve logs within that final second even when they exceed the budget.

Exclude free pages from the budget so SQLite can reuse them, and retain the passive checkpoint after the first sweep. Stop the task when the runtime is dropped or the log pool is closed.

## Testing

Add tests for the 10-day boundary, repeated retention-window halving, free-page accounting, the one-second retention floor, immediate startup cleanup, and periodic cleanup without new writes or a restart. Update existing log tests to use current timestamps so background retention does not remove their fixtures.

GitOrigin-RevId: c6eeb5ec13006d4a03354e08322827429be53ce8
2026-09-30 01:34:12 +00:00