Commit Graph

10640 Commits

Author SHA1 Message Date
Ian MacLeod
33bdf976cc Fade Astra composer stars and stabilize cursor redraws (#44879)
## What changed

- Fade Astra stars over one second after 15 seconds from the first visible frame, or quickly on composer input, drafts, voice input, and popups. Disconnected key handling also dismisses the animation.
- Preserve placeholder and draft text, including spaces. Stop scheduling animation frames when unfocused or finished, while allowing the idle deadline to elapse without terminal focus.
- Hide the terminal cursor before repainting and cache its style to avoid redundant anchor repairs. Invalidate cursor state after screen transitions, external programs, resume, and caught-panic recovery.

## Testing

Add regression tests and snapshots for fade timing, input dismissal, focus changes, text preservation, and frame scheduling. Add cursor redraw tests and a PTY test for cursor visibility and shape restoration after a caught panic. Update the reconnect test to wait until both the draft and notification are visible.

GitOrigin-RevId: 0c9aaa13e6bde820f88e3757457063680d7921a3
2026-09-11 17:43:36 +00:00
riley-oai
7b491281c8 Return public key metadata from user verification enrollment (#44877)
## Why

The trusted UI host needs the local credential's public metadata to complete backend registration. `userVerification/enroll` previously returned only `credentialId`.

## What changed

- Return `algorithm` and `publicKey` for newly created or reused credentials. The algorithm is `ecdsaP256Sha256X962`; the public key is unpadded base64url SPKI-DER.
- Keep both fields optional in the protocol for compatibility with older app-servers, while current servers populate both.
- Document caller-owned backend registration and revocation, including checking metadata, signing an enrollment challenge with `userVerification/verify`, matching credential IDs, and preserving the authenticated account throughout registration.

## Testing

Add protocol coverage for absent or null metadata and populated-response round trips. Add an RPC assertion for enrollment metadata and extend the local enrollment test to check metadata when creating and reusing a key.

GitOrigin-RevId: f0726e8c430e27559e1a01ba2ea635993cbeba09
2026-09-11 17:36:50 +00:00
iceweasel-oai
2c9e1a5775 Add managed network policy support to the Windows MXC sandbox (#44872)
## What changed

Add `create_command_args()` to encode argv, permissions, policy cwd, and optional managed network context through the existing bounded environment transport.

For managed networking, generate a policy that allows IPv4 and IPv6 loopback while denying direct non-loopback egress and general inbound access. Require nonempty, nonzero proxy ports and reject `allow_local_binding=false` at both launcher and policy boundaries because native host-loopback access is bidirectional.

Document the MXC launch contract, platform requirements, and limitations.

## Testing

Add portable tests covering managed network transport and policy translation, plus rejection of missing proxy ports, zero ports, and unsupported local-binding restrictions at both boundaries.

GitOrigin-RevId: 8d31b98f94a2ba3769369aa50de8e53dc143bac4
2026-09-11 17:19:23 +00:00
Benjamin Carlsson
68bc5369ba Enable worktrees by default and clarify local daemon errors (#44870)
## What changed

- Mark `worktrees` stable and enable it by default, removing it from `/experimental`. Point users who explicitly disable it to their Codex configuration.
- When a local daemon lacks `thread/backgroundTerminals/list`, block worktree creation and `/cd` with guidance to run `codex app-server daemon update` and restart Codex.

## Testing

Add regression coverage for unsupported local daemon methods, unrelated errors, embedded servers, and empty background terminal lists. Update feature-gating tests to disable worktrees explicitly and remove worktrees from the experimental menu snapshot.

GitOrigin-RevId: 3f21d0ebaa02da11a6aaa2e1ac615b4518fc98d8
2026-09-11 17:08:59 +00:00
Abhinav
122d55cba8 Preserve originating budgets for code mode notifications (#44867)
## Why

A yielded code mode cell can emit a notification after the session switches models. Its output should retain the originating model's truncation budget instead of using the receiving model's budget.

## What changed

Carry the cell's output token limit, including the serialization allowance, through notification dispatch and attach it as `history_truncation_token_limit` metadata. Allow `inject_if_running` to accept response item envelopes so queued notifications preserve this metadata in history and rollouts.

## Testing

Add regression coverage for delayed notifications across a model switch, verifying per-cell truncation budgets, full notification text in raw events, and persisted rollout metadata. Add a task-completion test that checks notification budgets are preserved alongside queued user input.

GitOrigin-RevId: 28380a039a6d41ea324401fcf1f611d81a279477
2026-09-11 17:03:21 +00:00
Abhinav
2fc4bda3ca Preserve originating context for yielded code-mode tool calls (#44866)
## Why

A code-mode cell can outlive its turn. Nested tool calls dispatched during a later turn need the original step's tools and context, while approval handling must still work across that turn boundary.

## What changed

- Retain each cell's originating `StepContext` for nested tool dispatch and cancel queued calls whose context has been released.
- Keep MCP approval metadata available for the lifetime of the running invocation, keyed by server and call ID.
- Apply Guardian denial accounting and interruption to the active turn, including reviews from an earlier cell.
- Carry `turn_id` in legacy MCP begin/end events so history reconstruction and rollout migration assign late completions to their original turn. Preserve the current-turn fallback for older records without it.

## Testing

Add regression coverage for originating tool selection across turns, callback and metadata cleanup, delayed MCP elicitation review, Guardian interruption of the active turn, and late MCP completion attribution with legacy compatibility.

GitOrigin-RevId: 4533379aae6e4ecb4aabe5a25e4aca5d65385d76
2026-09-11 17:01:17 +00:00
Abhinav
3305c4f31d Scope code mode callback delegates to individual executions (#44865)
## Why

A delegate bound at session creation cannot provide different callbacks for cells sharing that session. Each execution needs to retain its own delegate across yields and release it when the cell is cleaned up.

## What changed

- Pass `CodeModeSessionDelegate` to `execute` instead of session creation.
- Route tool calls, notifications, and cell closure callbacks through the execution's delegate in the in-process runtime and the gRPC and stdio transports.
- Retain delegates with pending executions and live cells, releasing them through closure and cancellation cleanup.

## Testing

Add coverage for distinct delegates across yielded cells, gRPC callbacks before cell admission, and delegate release after completion or abandoned execution cleanup. Update transport tests to verify callbacks reach the owning cell's delegate.

GitOrigin-RevId: 7469f52104b993e790a40c65fb800ad02b7fd606
2026-09-11 17:00:07 +00:00
jif
bc5957eac9 Preserve parent cache affinity for ephemeral forks (#44862)
## Why

ChatGPT derives Responses cache affinity from the `session-id` header. Ephemeral forks need to reuse their parent's cache routing while retaining their own session and thread identities.

## What changed

- Inherit the parent session ID as the `prompt_cache_key` for ephemeral root forks.
- Use the prompt cache key for root-agent Responses `session-id` headers, including WebSocket handshakes. Preserve the actual session identity in turn metadata and leave non-root-agent routing unchanged.
- Keep enabled goal tool definitions visible on ephemeral threads, but reject execution with `Goal tools require a persistent thread.` and disable automatic goal continuation without persistent state.

## Testing

Add regression coverage for inherited cache routing with distinct fork identities, matching parent and fork tool definitions, WebSocket session headers, and rejection of ephemeral goal tool execution.

GitOrigin-RevId: d235e97630068b27f7ebd562dd23ac6266ebc1b9
2026-09-11 16:41:56 +00:00
Eric Traut
0818b6550b Add consistent theme-based thread colors across the TUI (#44857)
## What changed

Assign thread colors deterministically from the full thread ID and the active syntax theme's accents. Use the same color for thread names and titles in the status line, status previews, agents overview, and resume/fork pickers, independent of renaming or list order.

Preserve thread colors when picker rows are selected and honor `tui.status_line_use_colors`. Load the configured theme before startup pickers render and refresh the cached palette when the theme changes. Fall back to the terminal's default color when no accents are available.

## Testing

Add unit and snapshot tests for palette extraction and refresh, default accent coverage, selected titles in both picker layouts, color suppression, and preview/footer consistency during automatic naming.

GitOrigin-RevId: 2b83a66bb3e80d4a1daea48ab9a86dbf2b525eef
2026-09-11 16:20:50 +00:00
Nick Steele
654b0a77d0 Add trusted enterprise MCP auth configuration (#44832)
## Why

Enterprise MCP authorization must remain controlled by host, user, or managed configuration. Project settings and plugin declarations must not redirect enterprise credentials or downgrade the selected authentication mode.

## What changed

- Add `auth = "ema_auth"`, shared `mcp_enterprise_managed_auth` IdP configuration, and per-plugin enterprise registration settings.
- Require enterprise registrations to come from one non-project configuration layer, preserve managed IdP precedence, and reject project overrides that change authorization or re-enable disabled enterprise servers.
- Add the disabled-by-default `use_xaa` feature flag and require non-project opt-in or a managed requirement.
- Reject plugin declarations that select `ema_auth`. Keep EMA connections unsupported and block ordinary MCP OAuth login and credential fallback for this mode.
- Extend the configuration schema and serialization for the new settings.

## Testing

Add coverage for IdP precedence, incomplete registrations, alternate credential validation, project-only opt-in, plugin self-declaration rejection, configuration round-tripping, and trusted-project attempts to downgrade enterprise auth to OAuth or ChatGPT auth.

GitOrigin-RevId: f193bdfda74208c98e496a23bf2916955b131a1c
2026-09-11 14:25:56 +00:00
Gabriel Peal
7a6f469dcf Expose advertised MCP server capabilities in status responses (#44826)
## What changed

Add `serverCapabilities` to `mcpServerStatus/list` responses in both `full` and `toolsAndAuthOnly` modes, including thread-scoped reads. Return the initialized server's capabilities object, including its `extensions` map, or `null` when unavailable.

Capture capabilities during initialization so they remain available when tool discovery fails. Clear them on each new connection attempt and keep them independent of shared tool caches. Update the protocol schemas, generated TypeScript and Python types, and documentation.

## Testing

Add coverage for extension capabilities surviving tool-discovery failures in both detail modes. Extend existing tests to check advertised extensions, absent capabilities after initialization failure, and serialization of unavailable capabilities as `null`.

GitOrigin-RevId: 8e9d67c10fac3a54e82bef8be5d99caaf82597d1
2026-09-11 13:55:24 +00:00
jif
624ccf7947 Test approved command execution with managed unified exec disabled (#44814)
## What changed

Add an app-server integration test for `requirements.toml` with `unified_exec = false` and `shell_tool = true`. Verify that:

- The model receives `exec_command` without `write_stdin`.
- Command approval carries the expected thread, item, and environment IDs.
- Accepting approval completes the command and turn successfully.
- The model receives command output without a running session ID.

GitOrigin-RevId: 67977c20b9b206e210807d0ce1e305259d25b7ba
2026-09-11 12:37:04 +00:00
Eric Traut
02a8f038b8 Check folder consent before creating or resuming TUI tasks (#44755)
## What changed

- Check directory trust when dispatching tasks from Agent Command Center, resuming sessions, and opening loaded tasks.
- Return connected users to Agent Command Center when they cancel folder consent. Clear launch prompts and images on startup cancellation, and restore the composer draft when task dispatch is canceled.
- Reload local configuration after saving folder trust and review startup hooks before creating a new task.
- Label connected consent screens with “Back to Agent Command Center”; retain quit behavior for embedded sessions.

## Testing

Add a terminal integration test covering unknown and untrusted folders, server-authoritative trust, cancellation and retry, resumed tasks with changed directories, and hook review before task creation. Update consent-screen snapshots.

GitOrigin-RevId: db88d2113fd47bc4c57369cc20ebf3042e6fb7ab
2026-09-11 07:13:19 +00:00
Eric Traut
b9934480bf Render Markdown in agent overview task details (#44752)
## Why

Task details displayed prompts as plain text and flattened agent messages, losing Markdown formatting and layout.

## What changed

Render prompt and last-message previews as Markdown at the details panel width, using the source thread's working directory. Preserve newlines and tabs within the 512-character preview limit, strip other control characters, and unwrap Markdown fences around agent messages. Keep prompts limited to two rendered lines and wrap long code lines to fit the panel.

## Testing

Add snapshots for Markdown formatting, long lines, and tables; verify cached and live messages render identically; and test preview layout preservation, control-character filtering, and Unicode character limits.

GitOrigin-RevId: b605d3f5920f0d15cc7682f45988a2e933e00602
2026-09-11 07:05:47 +00:00
Benjamin Carlsson
ab95cd4dd9 Preserve voice caption order when replaying TUI history (#44749)
## Why

Retained voice captions were appended after replayed history, placing earlier speech after later typed turns when switching back to a thread.

## What changed

Anchor completed captions to the next live turn and restore them before that turn during replay. Handle buffered item, delta, and completion events even when the turn-start event has been evicted. Restore remaining captions at the end of replay.

## Testing

Extend regression coverage to verify caption order and avoid duplicates across repeated thread switches. Add coverage for inactive-thread captions replayed before a later buffered turn without its start event, with and without a message delta.

GitOrigin-RevId: 6860a649bdcdda4937afb3ab4bbd75cf4ea5b4e6
2026-09-11 06:56:37 +00:00
richardopenai
eab107fed0 Update quinn-proto and allow the pinned H3 Git source (#44747)
## What changed

- Bump `quinn-proto` from `0.11.14` to `0.11.15` in the Cargo and Bazel lockfiles.
- Allow `hyperium/h3` as a Git source in `codex-rs/deny.toml` for the pinned revision needed by `CONNECT` request handling until released.

GitOrigin-RevId: 1e977e28d9e57acd8eac6a49a5e15fe04602c38d
2026-09-11 06:45:09 +00:00
Eric Traut
84e7d4a1fe Check folder trust after resolving the startup destination (#44746)
## Why

Resume and fork selection can change the working directory. Folder consent needs to cover the selected destination, and existing tasks in untrusted folders may retain settings and history loaded while trusted.

## What changed

- Move startup consent after destination selection and reload local configuration when trust is saved.
- Check both selected and saved folders for local daemon resumes, and reread the task after consent to catch working directory changes.
- Resolve local trust using project markers, Git roots, and normalized paths, honoring explicit working directory decisions and canonical path precedence.
- Offer restricted-folder consent without changing saved trust, with distinct wording for existing tasks that may retain configuration or hooks. Preserve remote checks scoped to explicit `--cd`.

## Testing

Extend trust lookup coverage for parent/child decisions, repositories without project configuration, path aliases, and custom project markers. Update restricted-folder snapshots and add an existing-task snapshot.

GitOrigin-RevId: caf8c70f1e953c4f7b4ddc89dd29bb1fd8ed62f1
2026-09-11 06:44:40 +00:00
Eric Traut
eaa8b6d917 Make archive confirmation number shortcuts act immediately (#44744)
## What changed

Allow `2` to confirm archiving a task and its child agents in the agents overview without an additional confirmation keystroke. Keep explicit confirmation for permanent deletion.

## Testing

Add a regression test verifying that `1` cancels and `2` dispatches the archive action, with both shortcuts closing the confirmation popup.

GitOrigin-RevId: 9a4b941f36a7876eccf9d8b0ea6a63e799f53b98
2026-09-11 06:34:46 +00:00
Benjamin Carlsson
eabb7c91d1 Preserve editor yanks across new sessions and thread switches (#44742)
## Why

Starting a new session with `/new` or switching threads replaces the chat composer, losing the last editor kill or Vim yank.

## What changed

Transfer the kill buffer to the replacement composer, preserving both its text and whether it is characterwise or linewise. Yanked text remains available to paste within the same TUI session.

## Testing

Add regression tests for new sessions and root thread switches that delete a line with Vim `dd`, then paste it with `p` in the replacement composer and verify the text and rendered output.

GitOrigin-RevId: edb4790d4de7b7425de6ef6af4e2786f6a4771c1
2026-09-11 06:27:28 +00:00
Eric Traut
40b0409aa1 Clarify folder trust prompts and add restricted widget support (#44732)
## What changed

- Explain that folder settings can run code automatically and that the trust decision is saved. Label the actions “Trust and continue” and “Quit”, and show the Escape shortcut.
- Add a restricted state to `TrustDirectoryWidget` with an “Open restricted” action and a disclosure of which project features remain disabled. Skip trust persistence for this state. Onboarding still initializes the widget with `restricted: false`.

## Testing

Add a restricted-folder rendering snapshot and a test that accepting or cancelling the restricted widget does not persist trust. Update existing trust snapshots and the interactive startup safety test for the revised prompt.

GitOrigin-RevId: d913f5624ac7c24ff1a16c19b5889573ab2752e6
2026-09-11 05:38:18 +00:00
Benjamin Carlsson
da20788df9 Bundle Linux voice runtimes and improve audio reliability (#44714)
## Why

Linux voice needs system ALSA plugins and enough buffering to accommodate PipeWire graph cycles without losing capture samples. Voice startup failures also need actionable diagnostics without exposing native error details.

## What changed

- Build and bundle GNU voice helpers and runtimes with primary Linux musl release archives, and sign the archives. Keep Python wheels free of these libraries to preserve `manylinux_2_17` compatibility.
- Discover ALSA plugins in fixed system directories and increase Linux capture and playback buffering to support larger PipeWire graph cycles.
- Report voice failures by stage, preserve negotiation timeout classification, and discard native error sources. Suppress the misleading `requested` closure message after failure cleanup.
- Add explicit Windows MSVC, pkgconf, and CMake toolchain configuration and preserve host architecture in native build environments.

## Testing

Add coverage for Linux release assembly, ALSA plugin discovery, PipeWire capture and playback, classified startup failures, failure cleanup rendering, and Windows build environment handling.

GitOrigin-RevId: d805eace96a669ce3a4489f12e2db6f68f9f7f53
2026-09-11 03:16:01 +00:00
Eric Traut
08e49689b8 Return to the command center after session cancellation or deletion (#44711)
## Why

Deleting a session, canceling an archived session resume or fork, and pressing `Esc` in a conversation open in another app previously exited the TUI. Local daemon and remote connections can instead return to the command center to select another conversation.

## What changed

- Return to the command center after successful deletion on local daemon and remote connections. Shut down side conversations before deletion and clear the deleted thread's local state.
- Return to the command center when an unarchive prompt is canceled, discarding startup input intended for the canceled resume or fork. Keep explicit quit actions and embedded server exit behavior.
- Make `Esc` open the command center from a conversation open in another app. Reselecting that conversation preserves its read-only snapshot and draft; `R` explicitly retries attachment.
- Update deletion confirmation text and keyboard hints to reflect these destinations.

## Testing

Add lifecycle tests for deletion success and failure, side conversation cleanup, unarchive cancellation and quitting, and read-only snapshot preservation. Add snapshots for command center navigation hints and deletion confirmation.

GitOrigin-RevId: 55a96358edb7af73949877a515614943bdc73643
2026-09-11 03:10:55 +00:00
vkg-oai
fc948f8c47 Add a provider for thread-scoped instructions (#44701)
## What changed

- Expose `ThreadInstructionsProvider` through `StartThreadOptions`. Load its snapshot at startup and model-request boundaries, composing it after global instructions and before repository instructions. Empty or blank output clears only the thread contribution.
- Reject thread instructions exceeding 10,000 estimated tokens independently of the repository instruction budget. Allow host-provided instructions without a filesystem source and rename the shared future type to `LoadInstructionsFuture`.
- Retain the provider across warm resumes; require hosts to supply it again for cold resumes and offline forks. Live forks and subagents inherit applied snapshots without inheriting the source thread's provider, including when the parent is unloaded during setup or reload.
- Include thread instructions in guardian reviewer inheritance and reuse decisions.

## Testing

Add coverage for composition and clearing, refresh within an active turn, size rejection before sampling, cancellation-safe refresh, fork and resume behavior, parent eviction, and reviewer reuse invalidation.

GitOrigin-RevId: 7be9a523cbbfd67704067dfd526188dad89a3c88
2026-09-11 01:57:54 +00:00
johnl-oai
dc55274818 Include the Windows sandbox service in release artifacts (#44694)
Add `codex-windows-sandbox-service` to the Windows release binaries and
helper builds for x86_64 and ARM64. Register both architectures in the
DotSlash configuration to resolve their compressed service executables.

GitOrigin-RevId: 363ad9229856391b283e57cfb10f28910fed96fb
2026-09-11 01:09:50 +00:00
Alex Ryan
aff3e0db94 Preserve selected profile settings over managed new-thread defaults (#44693)
## Why

Managed new-thread defaults could overwrite model, reasoning effort, and service tier settings from an explicitly selected profile.

## What changed

- Treat effective profile settings as explicit launch choices when applying managed defaults. A profile setting for either `model` or `model_reasoning_effort` opts out of both managed values; `service_tier` remains independent.
- Count a profile setting only when it supplies the highest-precedence active value, so settings shadowed by project configuration do not block defaults.

## Testing

Add regression coverage for profile precedence at startup, session replacement, and background task creation, plus custom-provider profiles, service tiers, unrelated profile settings, and project settings that shadow profiles.

GitOrigin-RevId: 98f036b8b7059bab8598283600dbc6967c71d3e3
2026-09-11 00:59:27 +00:00
andrewgu-oai
e53c444964 Warn about ignored configuration settings (#44691)
## Why

Unrecognized settings can be silently ignored, leaving typos or deprecated configuration unnoticed.

## What changed

- Collect warnings for unrecognized fields in effective configuration and requirements layers, including unknown feature keys in configuration.
- Report sources and field names without configuration values, show up to three entries, and provide migration hints for `network_proxy`, `allowed_permissions`, and `include_view_image_tool`.
- Emit project-specific warnings when starting a thread and suppress repeated startup warnings in the app server and TUI.

## Testing

Add coverage for merged configuration, disabled layers, startup and project warning delivery, omission of configuration values, and warning deduplication.

GitOrigin-RevId: 464cef87882502b19865ae10b50b6f82defb7296
2026-09-11 00:55:51 +00:00
Sean Huang
9e22e74e8d Resolve permission profiles with explicit execution-host path context (#44676)
## Why

Permission paths need to follow the execution host's path conventions and home directory. Literal directory names containing glob syntax must not change the meaning of deny patterns, and profile availability checks need to account for configured workspace roots.

## What changed

- Use `ConfigPathContext` to compile built-in and custom profiles, returning the resolved profile and deduplicated `PathUri` workspace roots. Materialize configured roots while retaining runtime workspace symbols.
- Use the same compiler for configuration loading, persisted profile validation, and profile catalogs. Resolve roots against the requested `cwd` when listing profiles.
- Resolve home-relative scoped rules using the supplied home directory and reject unsafe directory prefixes when constructing globs.
- Share workspace-root materialization across native paths and URIs. Deny the affected root when a workspace glob cannot be safely resolved, and clear grants for legacy home-relative workspace denials whose target is unknown.

## Testing

Add coverage for POSIX, Windows, and UNC path resolution, inherited workspace roots, scoped home denials, missing home context, and conservative denial behavior for unsafe globs. Add an app-server test verifying that profile availability reflects the requested `cwd`.

GitOrigin-RevId: ca259434742365c16d0b72629cabfbab41513a80
2026-09-11 00:03:40 +00:00
vkg-oai
935ac7710d Refresh global instructions at model-request boundaries (#44675)
## Why

Running root threads retained their startup global instructions, so edits to global `AGENTS.md` files did not take effect during an active session.

## What changed

- Reload global instructions when capturing model-request context, including after tools within the same turn. Apply changes without repeating unchanged instructions or rediscovering repository instructions when the environment and trust level are unchanged.
- Preserve the last successful global instructions on read failures, suppress recurring warnings until recovery, and clear instructions when their source is removed or blank.
- Serialize refreshes and allow cancellation without blocking subsequent requests.
- Give new subagents the parent's applied instruction snapshot and update Guardian reviewer reuse to account for refreshed instructions.

## Testing

Add regression coverage for live edits and removal, read failures and recovery, warning suppression, cancellation, subagent inheritance, and Guardian reviewer reuse. Update resume, fork, and compaction tests to verify refreshed instructions.

GitOrigin-RevId: f7e9b399740fa4f45e482c070f6e901ee7cf85cd
2026-09-10 23:46:33 +00:00
Benjamin Carlsson
28f43b0417 Keep voice sessions alive through mute and audio backlog (#44671)
## Why

Audio queue saturation and processing delays could terminate voice sessions. Muted sessions also need outgoing audio to keep the peer alive.

## What changed

- Drop stale or excess incoming, capture, render-reference, and playback audio so fresh audio can resume. Reset affected processing state while preserving queue bounds and mute generations.
- Send paced, generated Opus silence while muted, without using device or processing buffers.
- Add fixed helper exit stages and session failure categories to default TUI logs without logging raw native errors, SDP, or device error text. Preserve observed helper exit status for shutdown.

## Testing

Extend tests to cover decoded mute silence and RTP sequence continuity, recovery after stale audio and queue saturation, and shutdown after observing helper output closure. Verify the helper's exit stage when the parent pipe closes during blocked startup.

GitOrigin-RevId: 17d580a72acd4423fb0b4f5107d9b541b964d069
2026-09-10 23:25:10 +00:00
Drew Hintz
1b83e5cdf9 Restrict login setup redirects to known platform origins (#44670)
## Why

The login success pages use `platform_url` from the query string to build an organization setup redirect that includes the ID token. An arbitrary destination could receive that token.

## What changed

Require `platform_url` to exactly match `https://platform.openai.com` or `https://platform.api.openai.org` before showing the setup prompt or starting the redirect countdown. Apply the check to both the current and legacy login success pages.

GitOrigin-RevId: 37a08482c23b82483fd519f943a0b4eb6caaa161
2026-09-10 23:15:48 +00:00
Sean Huang
cc05ecfe17 Resolve filesystem denials with explicit path context (#44669)
## Why

Filesystem denial paths need to use the owning environment's path syntax, base directory, and home directory. Host-native resolution cannot supply those facts for another platform, and invalid denials must not be silently skipped when building the sandbox policy.

## What changed

- Add `ConfigPathContext` to requirements layers so `permissions.filesystem.deny_read` can resolve using explicit POSIX or Windows path facts, with native defaults when no context is supplied.
- Share URI-based resolution and validation for literal paths and glob prefixes. Reject ambiguous or lossy paths, including NUL bytes, Windows stream syntax, and unsupported UNC spellings.
- Move denial conversion into `FilesystemConstraints::apply_to_policy`, preserving glob patterns and deduplicating entries. Validate all denials before modifying the policy and propagate failures through configuration loading.

## Testing

Add tests for per-layer base and home resolution, Windows drives and globs, nested context restoration, missing home directories, and policy conversion without partial mutation. Add a configuration-loading regression test for a required denial glob containing a NUL byte.

GitOrigin-RevId: fa0da0d149407958e39897a39fe7b87edd6f1644
2026-09-10 23:08:23 +00:00
Ian MacLeod
78600239a1 Honor system reduced-motion preferences in the TUI (#44666)
## Why

The TUI should respect the host's accessibility preference even when `tui.animations` is enabled.

## What changed

- Read the system motion preference once at launch on macOS, Windows, and Linux. Changes to that preference require restarting the TUI.
- Suppress animations when reduced motion is requested without changing saved configuration. Preserve configured behavior when detection is unavailable, and limit the Linux portal query to 250 ms.
- Use the effective animation setting for voice controls and transcripts, and honor system reduced motion in the startup composer.

## Testing

Add tests for animation preference resolution and preservation of saved settings, plus composer snapshots without sparkles at widths of 40 and 80 columns.

GitOrigin-RevId: 3ea4e721ae23220a040a06123a27286a8c8f1c7c
2026-09-10 22:55:04 +00:00
Adam Perry @ OpenAI
84ed5744d9 Trace tool call receipt, result readiness, and code-mode dispatch (#44661)
## Why

Tool results can be ready before the sampling loop collects them, and code-mode cells can outlive a turn. Separate trace milestones make these timings visible and link nested calls to the turn that dispatches them.

## What changed

- Emit `codex.tool_call_received` and `codex.tool_result_ready` events for direct and code-mode calls, using identifiers and tool names without arguments or output. Record readiness before result encoding or collection, including ordinary errors and aborted responses, but excluding fatal errors.
- Assign nested call IDs at broker receipt and carry them through dispatch. Trace dispatch and interruptions caused by cancellation, cell closure, or abandonment.
- Add code-mode execute and wait handler spans with conversation, turn, call, and cell identifiers and `completed`, `failed`, or `interrupted` outcomes.

GitOrigin-RevId: b098a29d8ee030c823665e4b1031a0d67cc09502
2026-09-10 22:33:32 +00:00
joeytrasatti-openai
e004dc6a4b Preserve turn triggers across delegated agent work (#44659)
## Why

Delegated usage should retain the trigger of the turn that initiated it, including composer input and scheduled automation.

## What changed

Propagate `turn_trigger` through agent spawning and follow-up messages in both multi-agent tool implementations. Apply the supplied trigger when pending mailbox work starts a new turn.

## Testing

Extend tests to verify trigger propagation to spawned and nested agents, updated triggers on reused agents and peer follow-ups, and preservation of the active turn's trigger when steering.

GitOrigin-RevId: e8fea208587c633fec7cb3f1c0815ff91d1a44e5
2026-09-10 22:26:26 +00:00
chess
4caa5d615d Keep Windows sandbox private desktops alive across helper exits (#44658)
## Why

Private desktops owned by short-lived sandbox wrappers disappear when those wrappers exit, preventing reuse across filesystem helper requests.

## What changed

- Select and cache private desktops in the calling process, keeping desktops separate for different sandbox permissions.
- Pass the desktop name through the wrapper to the restricted-token and elevated backends so helpers reuse the selected desktop.
- Separate sandbox account preparation from filesystem ACL refresh so desktop selection does not perform the wrapper's refresh.
- Propagate desktop preparation errors and require a desktop name when the wrapper's private desktop flag is set.

## Testing

Add a Windows filesystem regression test covering desktop survival and reuse across reads, writes, metadata queries, and streaming reads, plus separate read-only permissions and rejected writes. Extend wrapper argument tests to cover named desktops and rejection of a missing desktop name.

GitOrigin-RevId: 05a1cb829a902732248bfa7f4ad7470d911fa9f6
2026-09-10 22:17:03 +00:00
Andrei Eternal
c8a8295e79 Attribute turn metrics to the models used during the turn (#44656)
## Why

Turn completion metrics used session-level telemetry, which could label usage with the wrong model after a model switch. A turn can also include compaction and responses from different models, so a single token total cannot attribute usage correctly.

## What changed

- Accumulate token usage by model using each response's resolved step settings, and emit one histogram sample per model and token type per turn.
- Preserve zero-valued samples when no usage is reported, without adding a sample for an unused selected model when only compaction ran.
- Use turn telemetry for tool-call, memory, network-proxy, and running-process metrics.

## Testing

Add regression tests for model switches, step-level model changes, compaction followed by a response or an aborted turn, and turns without responses. Verify repeated requests aggregate into one sample per model and earlier session usage is excluded.

GitOrigin-RevId: 03ab1dcde7da0b16b3a500a9a05e4c86583ee585
2026-09-10 21:58:58 +00:00
Matthew Zeng
8570091e14 Honor thread-level plugin exclusions across runtime capabilities (#44655)
## What changed

- Apply `disabled_plugin_ids` to plugin skills, recommendations, hooks, and MCP servers without modifying shared plugin state.
- Activate selection changes when the next task starts, keeping pending settings from changing the active runtime.
- Hide app tools contributed only by disabled plugins from model tool catalogs and search. Preserve connectors shared with enabled plugins and existing direct Apps RPC behavior.
- Include plugin identity in MCP approval keys and use that identity when persisting plugin tool approvals.

## Testing

Add regression coverage for disabling and re-enabling plugin skills and tools, deferred activation of settings, shared connector ownership, selected plugin servers, executor hooks, and plugin-specific approval keys and persistence.

GitOrigin-RevId: 1153ff6aa7ab6953d50e838da05203904ecd2956
2026-09-10 21:51:34 +00:00
Eric Traut
5c94936b56 Preserve missing environment variable diagnostics in Codex Doctor (#44654)
## Why

Secret redaction can hide missing environment variable diagnostics when names contain `token` or `secret`, obscuring which MCP configuration inputs need to be set.

## What changed

Preserve the variable name and `is not set` diagnosis for environment, bearer token, and header environment variables in text and JSON reports. Redact malformed variable names and identifiers matching recognized credential patterns, and strip credentials from server URLs.

## Testing

Add redaction cases for ordinary names, credential-like names, and server identifiers, plus JSON assertions and a human-output snapshot for missing environment variable diagnostics.

GitOrigin-RevId: 8ce5bd4c6ce25b62b42b083cefe85e87eff69afd
2026-09-10 21:51:08 +00:00
Eric Traut
db2e09106c Keep command center errors visible and preserve drafts (#44651)
## Why

Command center failures need to remain visible while users retain their task selection and composer draft, including when a task is already managed by another app server.

## What changed

- Show action errors above the retained dashboard with a return option and a clear explanation for tasks open elsewhere.
- Keep the dashboard open until task attachment succeeds, and return to the conversation when selecting the already displayed task.
- Offer “View unsent task” in a pager when restoring a failed submission would overwrite newer input.
- Show task refresh failures inline and clear the notice after a successful refresh.

## Testing

Add regression tests and snapshots for attachment conflicts, preserved selection and drafts, successful attachment, inline refresh recovery, unsent task viewing, and visible action failures.

GitOrigin-RevId: 19670c5ea506414a835296141004db567b0cafef
2026-09-10 21:42:01 +00:00
alexsong-oai
1aaa453ce2 Enforce managed model provider selection and definitions (#44650)
## What changed

- Support `model_provider` and `model_providers` in managed requirements. Required selection overrides local and session configuration; each required provider definition replaces the corresponding local entry, including its authentication and headers.
- Merge provider requirement fragments before validation, preserving source-relative `auth.cwd` paths. Reject invalid cloud provider definitions before replacing the cached bundle, including unsupported Bedrock overrides.
- Expose `modelProvider` and `modelProviders` through the configuration requirements API and generated schemas. Reject writes to managed provider settings and omit their local origins, including for provider IDs containing dots.

## Testing

Add tests for requirement precedence, authentication fragment merging, path resolution, cloud cache preservation, and read-only configuration RPCs. Integration tests verify that model discovery and inference use the required gateway and ChatGPT authentication without leaking local headers, and that provider requirements survive configuration rebuilds.

GitOrigin-RevId: d1448604d4ef5662ebb5df7b693712d3b8ad6d54
2026-09-10 21:41:39 +00:00
priyanshusingh-de
60825b4988 Honor thread analytics opt-outs when using shared clients (#44646)
## Why

An enabled shared analytics client could override a thread's explicit opt-out.
Delegated threads also emitted initialization events through the parent's client,
bypassing the child's analytics setting.

## What changed

- Use a disabled analytics client when `config.analytics_enabled` is `Some(false)`,
  without disabling analytics for sibling threads or overriding a disabled host client.
- Emit delegated thread initialization events through the child's analytics client.
- Expose the effective analytics state through `CodexThread::analytics_enabled()`.

## Testing

Add regression tests for explicit and unset thread settings with enabled, disabled,
and absent shared clients, plus delegated child opt-outs with an enabled parent.
Update compaction and rollout-budget rollback tests to wait for thread idle after
turn completion and fail immediately on rollback errors.

GitOrigin-RevId: 547852909af1a6822b95c0bcd2336b0d6bc7aad1
2026-09-10 21:30:56 +00:00
viyatb-oai
e25bedc166 Block non-loopback inbound traffic for the Windows offline sandbox (#44639)
## Why

The offline sandbox's non-loopback firewall block covered only outbound traffic. Add a matching inbound block for the offline sandbox user.

## What changed

- Configure an inbound firewall rule scoped to the offline user's SID, blocking all protocols and ports for non-loopback remote addresses.
- Make firewall rule direction explicit while preserving the existing outbound rules.
- Remove the new inbound rule during uninstall.

## Testing

Extend the elevated Windows sandbox integration test to inspect effective inbound and outbound rules, asserting their uniqueness, direction, block action, enabled state, profiles, address and port filters, protocol, and user scope.

GitOrigin-RevId: cbc1ca0d8d08a31fc53da5ad5be6ee5d51afa63d
2026-09-10 21:02:14 +00:00
malsamiri-oai
8e2afc0912 Recover OAuth metadata discovery from 503 responses via OIDC (#44636)
## Why

A `503` from an issuer's OAuth metadata endpoint can block discovery even when its OIDC metadata is available, preventing expired OAuth tokens from being refreshed during MCP startup.

## What changed

Try the same issuer's OIDC discovery endpoints when an OAuth authorization-server metadata GET returns `503`. Support issuers with path components and keep all attempts within the original request's timeout.

Reuse existing header, origin, and response-size checks, leave issuer validation to RMCP, and do not follow fallback redirects. Preserve discovery errors when fallback fails instead of enabling legacy endpoint fallback, and propagate terminal HTTP failures.

## Testing

Add tests for OIDC candidate order, malformed metadata, issuer mismatches, header isolation, redirects, terminal failures, unaffected requests, and the shared timeout. Add startup coverage for refreshing expired persisted tokens after OIDC fallback in both legacy and coordinated refresh modes.

GitOrigin-RevId: 6d94fd09e9ba26cb83e029171449e91410a0f6cb
2026-09-10 20:50:10 +00:00
Eric Traut
b9852fe6f7 Focus the task list when reopening the agent command center (#44631)
## Why

Reopening the agent command center focused the composer, requiring an extra focus change before browsing tasks.

## What changed

- Focus the task list when opening the overview from a session or returning after task lifecycle actions. Keep composer focus when starting directly in the overview.
- Fall back to the composer when no visible tasks remain, after discovery and pending metadata have resolved.
- Preserve unsent drafts and explicit focus changes across populated refreshes.

## Testing

Add regression coverage for requested focus, draft and cursor preservation, arrow-key and Vim navigation, and empty-list fallback while metadata is pending. Add a snapshot of the reopened overview with list focus.

GitOrigin-RevId: 8713eadc4a2a72e2db4a962184d43c4028c7178d
voice-cygwin-108b38cf67cbb731
2026-09-10 20:06:51 +00:00
willwang-openai
f8ab57359d Add manual callback input to MCP OAuth login (#44629)
## Why

Allow MCP authentication to complete when the browser cannot reach the callback page by accepting the full redirect URL copied from its address bar.

## What changed

- Add `codex mcp login <name> --no-browser` to print the authorization URL and accept a pasted callback without launching a browser. HTTP callbacks remain supported while waiting for input.
- Validate pasted redirect URLs and OAuth responses before exchanging tokens, hide terminal input, bound input size, and avoid echoing callback values in diagnostics.
- Preserve manual input across discovered-scope retries and support cancellation during callback input and token exchange.

## Testing

Add unit and CLI integration tests for callback validation, bounded input, credential storage, HTTP callback completion with stdin open, scope retries, and cancellation during token exchange.

GitOrigin-RevId: 16ea9c3221f72d93e6e3e5acdc6b9465293a0a65
2026-09-10 19:51:52 +00:00
marksteinbrick-oai
9b033b4642 Expose session analytics state in Responses turn metadata (#44628)
## What changed

Add an optional `analytics_enabled` boolean to `x-codex-turn-metadata`, sourced from the session's selected analytics client. It reports collection state independently of event eligibility or delivery and is omitted without initialized session analytics context.

Reserve `analytics_enabled` so configured or client-supplied metadata cannot override it. Continue accepting existing configurations containing this key while filtering their values from request metadata.

## Testing

Add coverage for the selected analytics client's state taking precedence over turn configuration, reserved-key filtering and compatibility, enabled state in HTTP headers and body metadata, and disabled state in WebSocket prewarm and turn requests.

GitOrigin-RevId: d95375c5ebc27e9d763a7e1a98687a27e4a8d99c
2026-09-10 19:41:14 +00:00
iceweasel-oai
4150a2c205 Add bounded environment transport for MXC launch requests (#44626)
## Why

Sandbox policies can exceed Windows command-line limits. Provide an environment transport for these larger MXC launch requests.

## What changed

- Make `MxcCommand` serializable and add JSON encoding and decoding through `CODEX_MXC_LAUNCH_*` environment variables.
- Split payloads into UTF-8-safe chunks of at most 4,096 bytes, with a 1,000,000-byte payload limit and at most 256 chunks.
- Reject malformed or duplicate transport entries and remove all transport variables during decoding, including on failure. Preserve unrelated environment variables.

## Testing

Add tests for large Unicode and escaped-argument round trips, stale variable removal, malformed transport rejection and cleanup, and oversized payload rejection without modifying the environment.

GitOrigin-RevId: 0e5ae2535ef313985a95eb8a5fd4884974dfb1eb
2026-09-10 19:29:54 +00:00
Benjamin Carlsson
9c9451131f Add /voice settings to choose a voice for future conversations (#44622)
## Why

The TUI has no voice picker, and realtime start requests omit the voice preference. Voice selection also needs to reflect the active project's effective server settings, which can differ from cached local settings.

## What changed

- Add `/voice settings` with the server's voice catalog and current effective selection, falling back to the built-in catalog when unavailable.
- Save `realtime.voice` through the app server and reread effective settings before confirming the selection. Report save failures and overrides.
- Resolve the effective voice for each realtime start. Apply selections to the next voice conversation without interrupting live audio, and retain compatibility with servers that lack `config/read` or return unknown voice names.

## Testing

Add picker and confirmation snapshots, plus request tests covering persistence, server defaults, catalog fallback, unknown voices, config read failures, overrides, and project settings after thread switches.

GitOrigin-RevId: d47e3da6c1164053c5be9d1da0f5932f2a09261f
2026-09-10 19:14:57 +00:00
iceweasel-oai
5c013177d8 Support temporary and minimal filesystem grants in MXC (#44620)
## Why

MXC rejected symbolic temporary-directory and minimal filesystem entries, preventing policies using them from reaching execution.

## What changed

- Resolve `Tmpdir` entries from absolute `TEMP` and `TMP` paths in the filtered command environment, matching variable names case-insensitively.
- Ignore `SlashTmp` entries because `/tmp` has no special meaning on the Windows executor.
- Include platform read roots when the policy requests platform defaults, preserving explicit denies.

## Testing

Add coverage for temporary paths and invalid environment values, optional platform roots, explicit denies, empty commands, and Windows case-insensitive read/write overrides.

GitOrigin-RevId: feb69157ff35bcf648fa0ed0e7d4376818bc1941
2026-09-10 18:57:16 +00:00
jif
1afffeabb2 Allow discarded code mode tool responses to be garbage collected (#44619)
## Why

Tool response delivery handles kept discarded results alive until the cell ended.

## What changed

Add a local V8 handle scope in `resolve_tool_response` so delivery handles are released when response delivery finishes. Live promises continue to retain their results.

## Testing

Add a regression test that verifies a live promise preserves its response through garbage collection and that dropping the promise makes the response collectible before the cell ends.

GitOrigin-RevId: a74e78acae3ec9a465694d7503150aee123792ec
2026-09-10 18:55:57 +00:00