Commit Graph
14224 Commits
Author SHA1 Message Date
Jackson Moody e2c31f625a Use ChatGPT account preferences for Codex voice chat (#63810)
## Why

Codex stored voice selections in `realtime.voice` and supplied voice overrides when starting realtime sessions. Reading and saving the ChatGPT account preference lets Codex use the same voice selection as ChatGPT.

## What changed

- Add experimental `account/voiceSettings/read` and `account/voiceSettings/write` methods. The terminal voice picker shows the selected voice and available display names, then saves the chosen voice ID to the connected app server's ChatGPT account, including when the server is remote.
- Require ChatGPT sign-in for terminal voice chat and create its WebRTC calls through the ChatGPT backend.
- Remove voice overrides from realtime session startup. Existing `realtime.voice` entries still parse but are ignored.

## Testing

Cover voice picker loading and saving, remote catalog failures, the ChatGPT sign-in requirement for local calls, and omission of voice overrides from realtime call payloads.

GitOrigin-RevId: 9e6f30b8020c47701d3c1604075063924f191685
2026-11-25 02:31:54 +00:00
jamy-OAI 986a6b3b11 Preserve the saved Daybreak choice across live goal continuations (#63809)
## Why

Automatic goal continuations could lose the thread's saved Daybreak
choice, even when the thread was enrolled in Daybreak propagation.

## What changed

Capture the saved choice when an externally created live goal first
becomes active. For goals created by a tool, carry forward the
originating turn's choice and preserve explicit access program
overrides.

Keep the captured choice in memory for the life of the goal and check
it against the current account and model on continuation. Changing
the thread's Daybreak setting takes effect for new goals.

## Testing

Add coverage for enrolled and opted-out threads, including blocking
a goal when the model lacks Daybreak support and starting a new goal
after turning Daybreak off. Also cover account changes and isolation
from foreground turns.

GitOrigin-RevId: 0baf08f06baf267595cb5a2b3b1fe033db52ad06
2026-11-25 02:31:14 +00:00
cooper-oai 19e95b9be8 Fix API workload identity authentication at startup and refresh (#63808)
## Why

Installing workload identity credentials at startup can revoke the network
policy already configured for them. The managed model provider also expects
a ChatGPT account identity, which API workload identity credentials lack.

## What changed

- Preserve the configured network policy while installing the initial
  credentials. Later changes in credential ownership still revoke the policy.
- Bind managed API authentication to its initial credential owner so requests
  can use renewed workload identity tokens for the same service account,
  organization, and project.

## Testing

Add regression tests for preserving network restrictions and existing permits
at startup, revoking permits when the owner changes, and rejecting header
generation and unauthorized recovery after an API key owner change, even if
the original key is selected again.

GitOrigin-RevId: 25b748863064334e622097c04d74e1fbee4b8a0b
2026-11-25 02:30:37 +00:00
smurching-oai 07963a34f2 Discover model catalogs from HTTPS gateways (#63807)
## Why

A custom gateway can serve a Codex model catalog at its existing
`/models` route. Requiring a separate `model_catalog_url` leaves that
catalog undiscovered when only `base_url` is configured.

## What changed

Probe `/models` automatically for custom providers with a query-free
HTTPS base URL and no explicit catalog URL. Use a valid Codex catalog
as the model picker inventory. If discovery fails, keep the picker
usable with an available catalog or the bundled models. Gateway login
and token refresh errors still propagate.

## Testing

Add HTTPS app-server tests that verify the authenticated
`/v1/models` request, picker population from a Codex catalog, and
fallback to bundled models for a generic OpenAI model list or a
`403` response.

GitOrigin-RevId: 654095be1c221d79d932acde8b7289bc4cad0437
2026-11-25 02:29:04 +00:00
viyatb-oai e5c2440d5e Harden SSH host checks for plugin marketplaces (#63806)
## Why

Git and SSH can interpret ambiguous remote URLs differently from the URL parser
used by the marketplace allowlist. A host pattern can therefore match a
different host from the one Git would contact.

## What changed

Validate the SSH authority and repository path before matching a
`host_pattern`. Reject ambiguous host syntax and unsafe usernames in
`ssh://` URLs, and check the host and path in scp-style `git@host:path`
remotes.

## Testing

Add regression cases that reject ambiguous remotes during marketplace add
and verify that host patterns still accept supported SSH usernames,
bracketed IPv6 addresses, and scp-style remotes.

GitOrigin-RevId: 0b7c040c0db2f2f7a802373aeb073969f48cbcd2
2026-11-25 02:14:25 +00:00
Eric Traut cb491754f6 Centralize terminal capability checks in the TUI (#63802)
## What changed

Use `terminal_capabilities` to select notification protocols, apply
Ghostty's 255-byte notification limit, and provide the focused-window
notice for notification tests. Reuse the shared tmux passthrough encoder
for OSC notifications.

Move program-status support checks and startup telemetry labels into the
same module.

## Testing

Extend the OSC 9 capability test to verify the notification body limit
for each supported terminal.

GitOrigin-RevId: ef3c9806dfafceba77cce3714073472224f1d173
2026-11-25 02:00:08 +00:00
Eric Traut 21fdf0f834 Centralize TUI image capability checks (#63801)
## What changed

Reuse shared terminal session detection and tmux passthrough escaping for
image commands. Drive image rendering with explicit checks for fullscreen
virtual placement, pixel data retention after placement removal, and
whether a protocol's images survive history insertion.

## Testing

Extend the automatic pet image protocol test to check that either `TMUX`
or `TMUX_PANE` alone requires virtual placement.

GitOrigin-RevId: 5d85e09bd9d1dcdfd01588adc8c2f0f4c6019ea1
2026-11-25 01:59:00 +00:00
Eric Traut bede3b5df8 Centralize TUI clipboard decisions in terminal capabilities (#63797)
## Why

Terminal checks for clipboard behavior are spread across the clipboard
worker, local settings, and right-click paste handling.

## What changed

Use `terminal_capabilities` to determine whether the terminal forwards
copy shortcuts or handles paste itself, whether X11 primary selection is
available, and how to send OSC 52 through tmux or GNU Screen. Have TUI
callers use the same SSH and WSL session checks.

Keep the automatic copy-on-select decision in settings and base it on
whether the terminal forwards the copy shortcut. Route tmux clipboard
copies through the client buffer with OSC 52 as a fallback.

GitOrigin-RevId: 623599783b70d66a06c52458fc82305a422cf507
2026-11-25 01:42:33 +00:00
Eric Traut 8603da0718 Centralize terminal compatibility policy in the TUI (#63793)
## What changed

Have startup and screen code consume capability decisions for inline mode,
Kitty graphics, mouse capture, session polling, and pointer reset. Keep
terminal and multiplexer detection behind the capability helpers for these
decisions.

Share stdout color detection between the CLI and standalone TUI exit
messages, and use the TUI's terminal warning helper for the CLI startup
confirmation.

## Testing

Exercise mouse-capture cleanup in separate Kitty and Ghostty test processes
and verify that each emits its expected OSC 22 reset sequence.

GitOrigin-RevId: 15cb972034397e521a97c2813628533b71539530
2026-11-25 01:27:56 +00:00
Eric Traut ebb1ff0e8b Centralize TUI terminal capability decisions (#63790)
## Why

Terminal-specific checks are spread across rendering and scrollback code.
Independent capability queries let callers share those checks without
starting unrelated terminal probes or caching live settings together.

## What changed

Move scrollback strategy, title encoding, and Markdown link display
decisions into `terminal_capabilities`. Route color detection and resize
reflow limits through the same module. Rendering and scrollback code
apply the selected modes.

GitOrigin-RevId: 6803e4b50ff5d3517efb5c07474d9ce17690e12d
2026-11-25 01:14:25 +00:00
Eric Traut 6e32b34f27 Consolidate terminal capabilities in the TUI (#63789)
## What changed

Group terminal probing and identity, keyboard modes, resize reflow, and
tmux settings and clipboard forwarding under `terminal_capabilities`.

Move pet image protocol detection and its tests into the same module
tree.

GitOrigin-RevId: 6d77b980982f6ea160b6d947760f04749352d94e
2026-11-25 01:13:41 +00:00
Eric Traut da973317bb Collapse turn details by default in the full-screen transcript (#63788)
## What changed

Summarize tool calls and collapse completed turns when
`tui.collapse_turn_details` is unset, including when the entire `[tui]`
table is absent. Set `tui.collapse_turn_details = false` to opt out.

Keep patches out of tool-call summaries so their inline diffs stay
available for review during approval. Record the configured setting at
startup with the `codex.tui.collapse_turn_details` counter.

## Testing

Update configuration tests to cover the new default and an explicit
opt-out.

GitOrigin-RevId: 8a1de12bd2a26f445bbc1eee68f31fe93fe4925a
2026-11-25 01:13:00 +00:00
Eric Traut 1ace17a02e Show a resize cursor on the TUI workspace divider (#63786)
## Why

The divider between the command center and the conversation pane is
draggable, but it lacks the resize cursor that signals this on the
sidebar divider.

## What changed

Show the resize cursor when the pointer is over the workspace divider
and keep it visible while dragging. Use the same hit test for hover and
drag start, and track sidebar divider highlighting separately from the
cursor shape. Clear workspace drag state when focus is lost or tmux
mouse support is disabled.

## Testing

Extend the workspace navigation test to cover cursor changes on hover,
press, drag, release, and focus loss, and verify that dragging moves
the divider.

GitOrigin-RevId: f63db5196bb73d28df3f341646f767394982b357
2026-11-25 00:58:35 +00:00
Eric Traut c7f0d3da0c Preserve multiline pastes without bracketed paste markers (#63785)
## Why

When a terminal sends pasted text as individual keystrokes, the TUI can
mistake a pasted newline for a submit key. This can happen after a short
Unicode prefix or after a redraw has already displayed a pasted line.

## What changed

Keep the paste detection window open after buffered text becomes visible.
Treat plain Enter within that window as a pasted newline and buffer any
following indentation with it. A single IME character still allows Enter
to submit in the regular composer.

Apply the same paste timing to startup drafts so Enter can confirm the
draft once the paste window expires. Keep newline-and-tab-only pastes
literal inside blockquotes.

## Testing

Cover multiline pastes with Unicode prefixes, tabs after pasted newlines,
and Enter handling before and after the paste window expires.

GitOrigin-RevId: e8f63dfead0cc97d44001000e961a6f6d05d4900
2026-11-25 00:57:54 +00:00
Eric Traut a6fadff7a2 Prevent accidental TUI interrupts after a steer is accepted (#63784)
## Why

A pending steering message offers a shortcut to interrupt the running turn
and send the message immediately. If Codex accepts the message before the
terminal redraws, pressing the shortcut while that hint is still visible
can interrupt the turn even though the message has already been accepted.

## What changed

Track whether the interrupt-and-send hint appeared in the last terminal
frame. If Codex has since accepted the last pending steer for the running
turn, ignore one interrupt press and its key repeats and briefly show
“Message received. Ignored one interrupt.” A fresh press can still interrupt
the turn. If the hint was never drawn or a redraw has removed it, the first
press interrupts as usual.

## Testing

Add regression coverage in both TUI rendering modes for an interrupt before
and after redraw, a hint that was never displayed, held-key repeats, and an
image submission in progress.

GitOrigin-RevId: 8be3bd51c623af44c108987fe0c2148eeb4515c7
2026-11-25 00:57:16 +00:00
teddywyly-oai 358e3dd088 Recover when an MCP reply hits an expired HTTP session (#63782)
## Why

A Streamable HTTP server can return HTTP 404 when Codex replies to an
elicitation after the session expires. That reply has no waiting client
request to trigger session recovery, so in-flight tool calls can remain
pending.

## What changed

Close the expired transport and fail its in-flight calls without replaying
them. Reconnect on the next operation and count the handshake against that
operation's timeout. If the replacement session also returns HTTP 404 during
the operation, surface the failure without reconnecting again in the same
operation.

Attempt to delete sessions allocated during failed or cancelled recovery
handshakes.

## Testing

Add regression coverage for closing in-flight calls with a full inbound
queue, reconnecting without replay, enforcing the recovery deadline, and
cleaning up failed or cancelled handshakes while retaining healthy sessions.

GitOrigin-RevId: e6f8747644a85686ecea0a61d118fb02078d5442
2026-11-25 00:55:42 +00:00
arnavpatidar-OAI b8e2d0cdef Reuse configuration server OAuth discovery across startup reads (#63781)
## Why

The one-shot startup flow uses separate invocations to check requirements,
sign in, and reload policy. Each invocation can repeat OAuth discovery.

## What changed

Accept `configRequirements/read` in `codex app-server --startup-oauth`
with the same validation and errors as `--print-startup-config`. Successful
responses include `appServerVersion`.

When the read reports `configServerLogin`, clients can sign in and retry
the read over the same stdio connection. The retry reloads policy with the
saved credentials and reuses OAuth discovery while the configuration server
and proxy settings still match.

GitOrigin-RevId: b5342cead5ebb9f2e0692061bf4b6ef933dc8cdd
2026-11-25 00:44:23 +00:00
iceweasel-oai a5815ebe65 Add opt-in Statsig initialization to Codex core (#63780)
## What changed

Add `Config::start_statsig` so launchers can initialize or reuse a
process-wide Statsig runtime. Initialization requires
`features.statsig_gates`, which defaults to off, and a nonempty
`CODEX_BUNDLED_STATSIG_CLIENT_KEY` set at build time.

Support serving-account, local-account, and installation identities.
Include the installation ID, launch surface, Codex version, OS, and
locale in the targeting context. Use the analytics setting and the
selected identity's defaults to control exposure logging.

GitOrigin-RevId: da1e04e1a617085cb810d81776d6b49fa62b589e
2026-11-25 00:28:07 +00:00
viyatb-oai b0b0852ee0 Require port grants for Linux sandbox proxy bridges (#63775)
## Why

A managed network context with no loopback port grants could still
create host proxy bridges from proxy environment variables. The
managed network policy should determine which host ports the sandbox
can reach through those bridges.

## What changed

Authorize host proxy bridges against `loopbackPorts`. An empty list
creates no bridges, and a nonempty list rejects a route plan containing
an ungranted loopback endpoint. Transparent TCP routing still requires
a port grant.

Keep network access blocked when managed networking has no grants,
even with a full-access profile. Explicit local binding and Unix socket
permissions can still apply without a TCP proxy route.

## Testing

Extend route-planning and Linux sandbox tests to cover empty port lists,
ungranted endpoints, and local binding and Unix socket access without a
host proxy bridge.

GitOrigin-RevId: f048e9afa355c6ce87137c9ef1924c358ecae558
2026-11-25 00:12:21 +00:00
eagle-oai 5505daf388 Preserve Daybreak selection across automatic goal continuations (#63774)
## What changed

For enrolled threads with Daybreak propagation enabled, carry the
creating turn's explicit access program into automatic continuations
of the same model-created goal. Reuse it only while the account, model,
and provider still match. Editing the objective preserves the selection,
and clearing the goal discards it.

## Testing

App-server regression tests check that automatic continuations honor
enrollment even after an objective edit, that explicit requests retain
their selection regardless of enrollment, and that a replacement goal
created after clearing starts without the previous goal's selection.

GitOrigin-RevId: 346742f6587f14867b1acc9c570383d1fa405d17
2026-11-25 00:11:12 +00:00
Dmitriy Kovalenko 17b00277cc Make Bazel Rust tests portable across Linux environments (#63773)
## Why

Some test fixtures depend on `python3` being on the host's `PATH` or
on reading Rust's process arguments from a constructor. Bazel workers
need a declared Python runtime, and musl does not provide those
arguments to constructors.

## What changed

- Put Bazel's Python 3.12 runtime on `PATH` for Linux test suites that
  invoke `python3`, including their Wine launchers.
- Use standalone helper binaries for exec-server and sandbox fixtures on
  musl, and read `/proc/self/cmdline` for the MCP hook fixture.
- Add launcher options for test execution tags and for routing selected
  Linux cases to a local companion target that shares the test binary.
- Adjust test fixtures for platform differences in file creation
  timestamps and shell script execution. Keep cloud-config error tests
  pointed at their mock server after startup falls back to defaults.

## Testing

Exercise marketplace upgrade negotiation at Git 2.20 and check whether
the installed Git supports limiting the refs advertised by the clone.

GitOrigin-RevId: 3a83cde954d52ca29d346d67488c9a25c0790614
2026-11-24 23:57:49 +00:00
RJ e1492bd86d Include parent evidence in recorded Guardian reviews (#63770)
## Why

An archived worker's transcript can omit the original user instructions and
assistant context that Guardian needs to assess a recorded tool call.

## What changed

Let clients supply optional `rootEvidence` to experimental
`thread/guardianReview` on an idle, ephemeral non-subagent thread. Guardian
reviews the ordered parent messages and omission flags alongside the worker
history loaded through `thread/inject_items`. The parent evidence stays out
of the worker history, and `usedRootEvidence: true` confirms that the review
used it.

Guardian can reuse reviewer history when the evidence is unchanged. Changing
or omitting the evidence resets that history.

## Testing

Add an app-server integration test covering rejection on persisted threads,
reviewer history reuse and reset, and review without executing the tool call.

GitOrigin-RevId: a4e78d770af5ad29864cb745b2e31f0fc921f213
2026-11-24 23:56:17 +00:00
Dylan Hurd ff2ee6212c Track additional context in conversation world state (#63769)
## Why

The baseline for comparing additional context submissions lived in memory,
so resuming a conversation could append context that was already in its
history.

## What changed

Persist the rendered fingerprints and history item IDs for active context
entries in world state. Reuse unchanged entries across turns and resumes,
and use their IDs to restore active items during compaction.

A client submission replaces the active set. Tool-provided context updates
only its own keys and is recorded after tool results, before the next
prompt.

## Testing

Extend scenario coverage to check deduplication after resume for both
message and tool-output rendering. Verify that edits in the truncated
portion of application context do not produce duplicate developer messages.

GitOrigin-RevId: 12a65a70d871f8dcefa082825c0ec4e9446efb56
2026-11-24 23:55:40 +00:00
Dylan Hurd bc6728ef68 Stabilize code-mode panic and process metrics tests (#63767)
## Why

Formatting a panic backtrace can outlast the process metrics RPC deadline.
A timed-out RPC can also hold the collector permit before its worker starts,
so checking the invocation count immediately can race with worker scheduling.

## What changed

- Trigger the collector unwind without running the panic hook. Check the
  collection failure, panic, and busy errors explicitly, and wait for the
  blocked collector to start before checking invocation and connection counts.
- Await the V8 runtime thread panic notifications directly in both tests,
  removing their one-second receive timeouts.

GitOrigin-RevId: 9b2c36577e838c9d327592f9729d3a8a7868c56b
2026-11-24 23:39:47 +00:00
Brandon Zhang ff146c344d Support structured dynamic tool results in Code Mode (#63766)
## Why

Dynamic tool clients could return JSON as text in `contentItems`, so Code Mode scripts had to parse that text to access fields in the result.

## What changed

App server dynamic tool requests advertise `supportedResultFormat: "structuredContent"`. Clients can reply with `structuredContent` and a `success` flag, report a failure with `errorMessage` and `success: false`, or continue using `contentItems`.

Code Mode exposes structured replies as MCP-style tool results, with the original JSON under `structuredContent` and failure status in `isError`. Completed tool items include a text representation of the reply. Matching post-tool-use hooks can receive the structured result for successful calls.

## Testing

Add protocol tests for the wire formats and rejection of ambiguous replies, plus an app server integration test that exercises structured results, content items, and errors through Code Mode.

GitOrigin-RevId: d63152633b43bd5bd236f6e0dcb41ee7e98e7947
2026-11-24 23:38:37 +00:00
iceweasel-oai 0adee0df26 Add a process-wide runtime for Statsig evaluations (#63762)
## Why

Codex callers need to read feature gates and dynamic configs locally and
stop using account-scoped decisions when the authentication owner changes.

## What changed

- Bootstrap ChatGPT evaluations through the Codex backend. Initialize
  API-key and installation identities through the Statsig SDK.
- Share one background worker per process to retry initialization and
  refresh evaluations through the SDK. Keep the last successful values
  on refresh failure while the authentication owner remains current.
- Expose `Gate` and `DynamicConfig` readers that return `false` and an
  empty JSON object, respectively, when current evaluations are unavailable.

## Testing

Add a mock-server test for bootstrap retries after credential changes,
local gate and config reads, and value retention after a failed refresh
followed by replacement on a successful refresh.

GitOrigin-RevId: c02cd976a44229518a7159eb2bd35107ef280b56
2026-11-24 23:15:42 +00:00
Brent Traut 9202c7916b Search inline link labels in user messages (#63758)
## Why

Searching raw user messages can return hits from Markdown link destinations
that readers never see in the link label.

## What changed

Use inline Markdown link labels for user-message matches and snippets while
preserving surrounding whitespace and code blocks. Keep literal text for
messages with byte-ranged inline elements.

Reject cursors that counted raw-text matches because hidden URL hits could
shift the index and cause pagination to skip a visible match.

## Testing

Extend the thread search integration test to check match offsets, snippet
formatting, pagination, and rejection of a raw-text cursor.

GitOrigin-RevId: 19af5ab4aa16933e83b4eb2cb15e57cc92597b6b
2026-11-24 22:46:22 +00:00
Joe Savona 110f065202 Add whitespace preservation to status line text (#63757)
## Why

Status line text collapses spaces and tabs by default. Authors need a
way to retain indentation and alignment while styling parts of the text.

## What changed

Add the optional `preserveWhitespace` prop to text nodes. When enabled,
it preserves spaces and tabs across nested styles and uses the same
wrapping rules as inline code. Inline code continues to preserve
whitespace automatically.

## Testing

Add a rendering test that compares styled and unstyled text across
terminal widths and checks tab expansion and bold styling. Add a
TypeScript contract fixture that uses the new prop.

GitOrigin-RevId: 525ae1d7df2df036d74990e18092286030041b23
2026-11-24 22:45:14 +00:00
Joe Savona 15843299be Support inline code in custom status lines (#63755)
## Why

Ordinary status line text collapses spaces and tabs, so it cannot
preserve the spacing of commands and other literals.

## What changed

Add a `code` element to the terminal UI tree and expose it as
`CodeElement` in the status line TypeScript contract. Code spans
preserve literal spacing, expand tabs to terminal tab stops, and use
theme-aware foreground and background colors. They prefer word breaks
and can wrap long tokens at grapheme boundaries in narrow layouts.

## Testing

Add renderer coverage for whitespace, wrapping across styled children,
clipping, and theme contrast. Extend the TypeScript contract fixture to
check that `CodeElement` requires a child list.

GitOrigin-RevId: 626d7624829a25e342fc052ab5194ff53b2a7673
2026-11-24 22:26:31 +00:00
Joe Savona 38e42cdb21 Add vertical layouts to custom status lines (#63752)
## What changed

Add a `col` element that stacks children vertically with a required `gap` measured in blank terminal rows. Rows and columns can nest, and a column inside styled text starts a new block while inheriting the surrounding style.

In both `row` and `col`, adjacent strings form one layout item. Null children and standalone whitespace are skipped, while explicit empty elements still count when spacing items.

## Testing

Add renderer tests for nested layouts, wrapping, viewport clipping, and spacing around empty elements. Extend the TypeScript contract checks to cover `ColElement` and its required `gap`.

GitOrigin-RevId: cca7d0057582de001bd8f5008fe949a05d7ebe22
2026-11-24 21:58:29 +00:00
Joe Savona d18dddd984 Fix blank lines and backgrounds in nested TUI rows (#63748)
## Why

Blank nested rows can consume a column and crowd out a wide glyph in
an aligned row. A gap before trailing blank content can also trigger
horizontal truncation when the glyph fits at the viewport edge.

## What changed

Keep blank lines in the layout height and let zero-width flex items
occupy zero columns. Clip gaps before empty fragments to the visible
width. Fill explicitly colored nested rows across their visible flex
allocation, including blank lines, without painting into sibling cells.

## Testing

Add regression tests for wide glyphs beside blank nested rows, wrapping
at the viewport edge, and background coverage with both blank and
nonblank sibling lines.

GitOrigin-RevId: 1acb06e0bb900a7f99bc06e542518708b89b7728
2026-11-24 21:42:02 +00:00
viyatb-oai f22cc03b04 Review saved exec escalations when read denials apply (#63743)
## Why

A saved command allow rule can skip review, but it cannot authorize
broader filesystem access when the sandbox enforces read denials. This
left explicit escalation requests running with baseline permissions even
when Guardian could review the request and the executor could preserve
the denials.

## What changed

Route those explicit `exec_command` escalation requests through Guardian
when auto-review is configured and the executor supports widening access
while preserving read denials. Tell Guardian that approval can broaden
filesystem access outside the denied paths and globs.

Evaluate read denials and sandbox selection using the target executor's
path conventions. A `:slash_tmp` denial applies on Linux and has no
effect on Windows.

## Testing

Cover Guardian approval and rejection for commands with saved allow
rules, plus `:slash_tmp` handling on current and legacy Linux and Windows
executors.

GitOrigin-RevId: abfe9888a1e168cfebb64e3faf12546e1f626aa2
2026-11-24 21:27:17 +00:00
rhan-oai 20c7f26cd2 Use root evidence in Guardian reviews for hosted agents (#63742)
## Why

Guardian could resolve root instructions for locally managed agents through the
agent tree. Detached workers need their host to supply that evidence so Guardian
can evaluate their actions against the root user's instructions.

## What changed

- Let trusted hosts capture reusable root evidence, watch for committed changes,
  and select handoff context for each worker. Supply that evidence to Guardian
  while keeping it out of the worker's conversation.
- Bound hosted evidence reads by the review deadline and cancellation. Recheck
  root evidence before approving, and invalidate cached authorization when the
  root runtime is replaced.
- Let a cached score end a pending review only when it covers the action under
  review and its worker and root evidence revisions still match.

## Testing

Add coverage for hosted reviews that receive root instructions, unavailable and
stalled evidence reads, root replacement, and delayed scores for an earlier tool
call.

GitOrigin-RevId: 52553041ef449a2e180f9f1b7fc261dcbcb76f01
2026-11-24 21:10:00 +00:00
Eric Traut c6b00eacb9 Add composer borders when the terminal background is unknown (#63741)
## Why

When Codex cannot detect the terminal background, the composer loses the
fill that sets it apart from the surrounding UI. Guessing a fill color
could hide the terminal cursor.

## What changed

Use gray top and bottom borders to mark the composer when it has no
background fill, leaving the terminal background visible. Draw the
borders only when there is room for the text area and the terminal can
render a color.

## Testing

Add a snapshot for a missing terminal palette that shows the borders
around a draft with a file mention and an image attachment.

GitOrigin-RevId: da74996fcde8f669c7b1577fa93a7744ad65e4f6
2026-11-24 21:08:47 +00:00
Eric Traut 39f38dcfab Prefer terminal clipboard writes in VS Code dev containers (#63740)
## Why

A native clipboard write inside a dev container can succeed on the
container's desktop while leaving the host clipboard unchanged.

## What changed

Detect VS Code dev containers with `REMOTE_CONTAINERS=true` and route
clipboard copies through tmux or OSC 52. On Linux with a nonempty
`WAYLAND_DISPLAY`, use the native clipboard for copies over the
100,000-byte terminal limit and retain clipboard ownership.

Host delivery remains unconfirmed on both paths. The copy status asks
users to try pasting and points them to `/export` if the text is missing.
Keep that status out of exported transcripts.

## Testing

Add coverage for dev container detection, terminal send success and
failure, and clipboard ownership at the terminal size limit and one
byte over it.

GitOrigin-RevId: 057f7956fce8a16c8a3022b697e443b524740376
2026-11-24 20:50:04 +00:00
Eric Traut 32f77f824d Restore the TUI Working indicator when a Stop hook continues a turn (#63736)
## Why

A final answer hides the Working indicator. If a Stop hook then asks
Codex to continue, the TUI can look idle while the turn is still running.

## What changed

Restore the indicator when a completed `HookPrompt` belongs to the
current running turn, both during live updates and when replaying a
thread snapshot.

## Testing

Add a regression test that snapshots the restored Working row during a
live retry, checks that snapshot replay also restores it, and verifies
that replaying the prompt after turn completion leaves it hidden.

GitOrigin-RevId: 67909c92b628ff5389ea9b417e7e5133a9acdeec
2026-11-24 20:35:36 +00:00
Adam Perry @ OpenAI 9a3c131eb4 Deduplicate model catalog strings in memory (#63735)
## Why

Identical instructions and tool descriptions can appear in multiple
model catalog records. Each decode or clone previously allocated its own
copy of that text.

## What changed

Use `CodexCachedStr` for catalog instructions, messages, and tool
overrides. It stores short strings inline and interns longer strings so
independent decodes and clones can share storage. Resolved incremental
tool messages also reuse cached text from overrides and bundled defaults.
JSON and generated TypeScript still represent these values as strings.

## Testing

Add tests for shared storage across catalog fields, independent decodes,
clones, and incremental tool defaults. Cover plain JSON string round
trips and borrowed access to short inline UTF-8 strings.

GitOrigin-RevId: 6f53b4e19f01f6ed52a8fd364279b924cf794be2
2026-11-24 20:21:47 +00:00
surajs-oai 7a24022794 Allow async user messages through code mode (#63730)
## Why

Agents could send async user messages only through a top-level tool call, even in code mode.

## What changed

Set `features.send_message_to_user_async.direct_only` to `false` to make the tool follow the session's tool mode. Direct mode exposes it as a top-level tool, code mode allows both top-level and nested calls, and code-mode-only sessions require nested calls and reject direct calls. The default keeps the tool top-level only. Existing agent opt-ins still apply.

## Testing

Add integration coverage for tool visibility, call results, and message delivery across all three tool modes with both values of `direct_only`. Improve failure diagnostics in the multiline shell snapshot test and paste `/status` as a single input event in the daemon compatibility test.

GitOrigin-RevId: c69bb2fba8bf776eff01382d8869fc869fc9d479
2026-11-24 19:56:22 +00:00
Eric Traut 7015377ecd Keep terminal pet animations in step with task status (#63729)
## Why

The terminal pet could settle into its idle animation while a task was
still running or waiting for approval. Its running notification also
expired after three minutes, even if the task was still active.

## What changed

Use the terminal program status to select the pet's reaction on redraw.
Loop the running, waiting, and failed animations while their notifications
are active. Play the review reaction three times before returning to idle
animation, and clear the reaction when the program status returns to idle.
Apply the same playback rules to custom task animations.

Schedule animation redraws only when the pet can be drawn and the sprite
can change. A pet that cannot fit or is covered by the shortcut HUD
requests no animation frames.

## Testing

Extend tests to check sprite selection through approval, completion,
failure, and acknowledgment, along with custom animation playback and
redraw scheduling when the pet is hidden.

GitOrigin-RevId: 09ef2a8558190eb2f63f5c286b4271838f228f67
2026-11-24 19:55:43 +00:00
jif 35ca204afa Remove the image generation extension's dependency on codex-core (#63727)
## Why

The extension depended on the full core configuration to resolve a small
set of per-thread settings. Accepting those settings from the host lets
the extension work with other host configuration types.

## What changed

Make the extension generic over any host configuration that can provide
`ImageGenerationSettings`. Resolve the settings and artifact save root
at thread startup and refresh them when the thread configuration changes.

Share the `image_gen` namespace through `codex-config` and the
`x-codex-turn-metadata` header through `codex-api`.

GitOrigin-RevId: 3f10fd0a45c910e87bb6beea7f7c2e6c3f7eb707
2026-11-24 19:54:23 +00:00
Ben Romano ae21235afb Trace fork history preparation and spawn-edge persistence (#63719)
## Why

Agent spawn traces need separate timings for preparing forked history and
persisting the parent-child relationship. The persistence write runs in
a separate Tokio task, so it needs the caller's tracing context.

## What changed

Add spans for fork history preparation and the spawn-edge upsert. Carry
the caller's span and subscriber into the persistence task, and enter
the upsert span both when calling the graph store and when polling its
future.

## Testing

Extend the failed-publication test to verify cleanup after a lost commit
acknowledgement and check the exported trace. It asserts that fork
preparation finishes before the upsert starts, that both spans belong
to the spawn caller, and that the graph store span is nested under the
upsert.

GitOrigin-RevId: 28bf2d69ce494ab146aa124f045e28d6a0f5dab9
2026-11-24 19:26:52 +00:00
viyatb-oai 1263a383a5 Bind sandbox CA access to the prepared managed proxy route (#63711)
## Why

A sandboxed command needs read access to the generated CA bundle for its
managed proxy route. Choosing the bundle from the command environment or
from live proxy settings can give the sandbox a different bundle from
the one captured when the route was prepared.

## What changed

Capture the generated CA bundle alongside the proxy environment and
sandbox network policy. Validate the captured bundle when granting read
access. A locally prepared route with no generated CA grants no CA
access. Controller-supplied portable routes still look up and validate
the generated bundle in the command environment.

## Testing

Cover restricted reads for remote processes using both portable routes
and executor-local proxies. Verify that a borrowed proxy's prepared
route preserves its listener and CA grant across a proxy configuration
change.

GitOrigin-RevId: 1a4024b5b84c14febda7cdd6b6f4f950a7741054
2026-11-24 18:51:41 +00:00
Eric Traut 7f8dcb3e64 Detect Ghostty truecolor when SSH omits COLORTERM (#63710)
## Why

SSH can forward Ghostty's `TERM=xterm-ghostty` without `COLORTERM`,
leaving Codex to use an ANSI-16 palette for a truecolor terminal.

## What changed

Centralize stdout color detection in `codex-terminal-detection`. Upgrade
an ANSI-16 result to truecolor when `TERM` is `xterm-ghostty` and neither
`FORCE_COLOR` nor an active `CLICOLOR_FORCE` override is present.

Use the shared detection for TUI colors, including shimmer and activity
indicators. Share the existing Windows Terminal palette rules between
diff rendering and theme colors.

## Testing

Cover Ghostty's `TERM` fallback, explicit color overrides, and Windows
Terminal palette detection in unit tests. Exercise theme preview,
selection, and restoration with Ghostty's `TERM` and no `COLORTERM`.

GitOrigin-RevId: e7b6832fc7e721d5e2c23ef19df5fe55fbfeb21a
2026-11-24 18:50:19 +00:00
Eric Traut c4345a0079 Refresh the Codex CLI screenshot in the README (#63708)
Show a prefix-search optimization with an inline code diff and a
side-by-side Markdown preview of the benchmark results.

GitOrigin-RevId: 3ca40e4e29b8ec5745f49fde5e7da592db0d9217
2026-11-24 18:36:52 +00:00
Eric Traut 2ee23c7f8f Show URL elicitation instructions in the TUI confirmation (#63701)
## Why

A URL elicitation request can include instructions users need to complete
the browser action, such as a code to enter. The TUI's “Finish in Browser”
screen previously showed only generic guidance for that step.

## What changed

Render the request message above the generic browser instructions when
confirming an external action.

## Testing

Update the URL elicitation confirmation snapshot to verify that a payment
confirmation code appears on the “Finish in Browser” screen.

GitOrigin-RevId: 85566e783341fc46d8e21ef4710b7c30687316f8
2026-11-24 18:19:40 +00:00
jif 44308610ef Measure initial output collection time for exec_command (#63695)
## Why

End-to-end tool duration does not show how much time `exec_command`
spends collecting its initial output. Tracking the duration and call
count separately lets readers of the metrics compute the mean
collection time for each configured shell snapshot mode.

## What changed

Record the initial output collection time in whole milliseconds and
count each successful process manager response, including collections
shorter than a millisecond. The timing starts after the early-exit wait
and can include draining output after the process exits.

Tag both counters with the configured `shell_snapshot_mode` (`disabled`,
`v1`, or `v2`), including when execution falls back. Intercepted patches,
process manager errors, and `write_stdin` calls are excluded.

## Testing

Extend a unified exec integration test to check that the recorded time
matches the initial response within one millisecond, both counters carry
the `v2` tag, and a subsequent `write_stdin` leaves the count at one.

GitOrigin-RevId: 289336cf2544a78abb3417484b48d2d22109a56c
2026-11-24 17:34:10 +00:00
felixxia-oai 4ec69d3c5f Preserve Guardian review evidence when callers are cancelled (#63693)
## Why

Cancelling a turn or tool call could drop a pending history write or
lose an answer the session had already accepted. A missing write leaves
Guardian unable to confirm that its review history is complete.

## What changed

Let the session finish tracked evidence writes in queue order after the
caller is cancelled, and drain those writes on shutdown. Record verified
`request_user_input` answers at acceptance before waking the tool.
Continue persisting evidence after an earlier write goes unconfirmed,
while still reporting the history gap to Guardian.

## Testing

Regression tests cover initial and retried reviews waiting for a
revocation after caller cancellation, and an accepted answer reaching
history before the turn interruption even with an earlier unconfirmed
write.

GitOrigin-RevId: b8e212d34686bbc793002a34f5a97834a900a342
2026-11-24 17:33:28 +00:00
jif 9a3303253b Remove unused standalone connector listing helpers (#63692)
## Why

The app server already passes its environment and MCP managers to
connector discovery, leaving the standalone listing helpers unused.

## What changed

Remove the unused listing wrappers and re-exports from `codex-core`
and `codex-chatgpt`, including the setup that created temporary managers.
Move `tokio` to the dev dependencies of `codex-chatgpt` and enable only
the features its tests use.

GitOrigin-RevId: 757b32afeb6e46dddb46d507c5af07bf8ff7a2a3
2026-11-24 17:32:08 +00:00
jif f67868d050 Align sandbox retries with the permissions reviewed for them (#63683)
## What changed

Build the retry from the initial sandbox attempt. When policy permits an
unsandboxed retry, clear the sandbox settings and mark the command as
`RequireEscalated` for approval. When policy requires the sandbox to stay
in place, reuse the initial attempt so a network retry preserves file read
restrictions.

## Testing

Cover both Guardian verdicts after a sandboxed attempt. An approved retry
reaches the exec server without a sandbox, and a denied retry is blocked
before it reaches the executor.

GitOrigin-RevId: 5bf36dd4f43b7c0379457b88b8ddbf3dbd482b87
2026-11-24 17:19:40 +00:00
jif a009fc6a4e Remove unused core config loading wrappers (#63682)
Drop the deprecated `load_config_as_toml_with_cli_*` helpers and
`Config::load_with_cli_overrides_and_harness_overrides`. Existing callers
can use `ConfigBuilder` to apply harness overrides and
`load_config_toml_with_layer_stack` to inspect raw config during startup.

GitOrigin-RevId: 4901d876cf4d87094055f9907bd761525057fa99
2026-11-24 17:18:29 +00:00