Commit Graph

10443 Commits

Author SHA1 Message Date
Benjamin Carlsson
34c5303f49 Ignore closed agents when changing directories (#40625)
## Why

Closed agent channels can retain stale in-progress turns, which can incorrectly
block `/cd` or cause unnecessary background-terminal checks.

## What changed

- Mark agents closed whenever a `thread/closed` notification is routed, including
  for inactive event channels.
- Exclude closed agents from running-turn detection and background-terminal checks
  during working-directory changes.

## Testing

Cover directory-change recovery with both a routed close notification and a
replay-only closed thread that contains a stale in-progress turn.

GitOrigin-RevId: 1072456056f8c1a1b751a52635470b0be160d76c
2026-08-25 15:15:06 +00:00
Benjamin Carlsson
f832b2fe7b Add worktree settings parser (#40624)
## What changed

- Add the `codex-worktree` crate for resolving managed worktree settings from
  the existing `[desktop]` configuration.
- Default the worktree root to `$CODEX_HOME/worktrees`, automatic cleanup to
  enabled, and retained worktrees to 15.
- Validate configured roots, cleanup flags, and retention counts before
  exposing the effective settings.

## Testing

- Cover defaults, configured values, and invalid root and retention settings.

GitOrigin-RevId: 1b279c62ef41e3c8eb540ce9beaf0f6cd96d903f
2026-08-25 15:10:27 +00:00
jif
4b81410a80 Treat user input answers as Guardian authorization changes (#40623)
## Why

Answers collected by `request_user_input` can change what the user authorizes, but post-tool hooks may replace or reject the tool output that Guardian normally sees.

## What changed

- Record bounded, host-observed answers before post-tool hooks run and provide them as trusted evidence to synchronous and asynchronous Guardian reviews.
- Include root-thread answers in worker review context.
- Count successful answers as authorization changes so earlier review evidence becomes stale, while ignoring empty or unrelated answers.

## Testing

Add coverage for allowed and denied stale reviews, empty and oversized answers, hook-modified output, and root-to-worker propagation.

GitOrigin-RevId: 970c52e40338ecd057c7cd2a69d04b06e97cd068
2026-08-25 15:03:46 +00:00
Tamir Duberstein
c395364915 Keep the active goal clock current in the TUI (#40622)
## Why

The active goal's elapsed-time label could become stale while the TUI was idle because it was refreshed only as part of a redraw.

## What changed

- Refresh the goal status indicator when the terminal-title timer fires.
- Request a redraw only when the displayed elapsed-time label changes.

## Testing

- Add a regression test covering the minute transition and confirming that an unchanged label does not trigger another redraw.

GitOrigin-RevId: f10a1c2334cf7a5f1d2ee90d7138114479998c8d
2026-08-25 14:47:53 +00:00
jif
e16d098c00 Instrument exec-server shell snapshot capture (#40620)
## What changed

- Emit `codex.shell_snapshot` and `codex.shell_snapshot.duration_ms` for each
  exec-server capture attempt, including success and failure tags.
- Label exec-server metrics as `v2` and existing core snapshot metrics as `v1`
  so the two implementations can be distinguished.
- Use the exec server's metrics client when available and fall back to the
  configured global client for local execution.

## Testing

- Extend the bounded-retry and single-flight snapshot test to verify metric
  counts and tags for first-attempt success, retries, recovery, and exhaustion.

GitOrigin-RevId: 94f73e58a4a1a90c518fa102f138ca7ee29b5627
2026-08-25 14:34:25 +00:00
Tamir Duberstein
6525b95dae Refresh animated terminal titles without redrawing the TUI (#40618)
## Why

Terminal title animations only need to update the title, but each animation tick
previously requested a full TUI frame.

## What changed

- Track the next terminal title refresh deadline on `ChatWidget`.
- Have the foreground event loop refresh the title when that deadline expires.
- Clear the deadline when title animations are disabled or the configured title is
  empty.

## Testing

- Verify spinner and action-required animations set the expected refresh deadlines.
- Verify refreshing an animated title does not enqueue a TUI draw request.

GitOrigin-RevId: 269347cd48de4ad9ba9a0aef9ed105c25d1a7dae
2026-08-25 14:24:18 +00:00
chess
ed42068c45 Add a turn-scoped service tier override (#40616)
## What changed

- Add `serviceTierForTurn` to `turn/start` so a newly started turn can override the service tier without changing the thread's saved tier.
- Treat `"default"` as standard speed and omitted or `null` values as inheriting the thread tier.
- Keep `serviceTier` authoritative for subsequent turns when both fields are supplied, and ignore the turn-scoped override when steering an active turn.

## Testing

- Extend the app-server turn-start test to verify both the one-turn `"default"` override and inheritance on the following turn.

GitOrigin-RevId: 4c2c4db21d8d31617a7a6e6df65bf54834e72383
2026-08-25 14:04:32 +00:00
jif
d7510aa4b4 Preserve pending input after terminal turn errors (#40613)
## Why

Pending user input or agent mail could cause a regular task to restart immediately after a terminal compaction error, retrying the failed turn instead of completing it and preserving the pending input.

## What changed

- Stop the regular-task continuation loop when the turn records a terminal error.
- Allow turn completion to persist pending input so a later explicit request can retry it after the error is resolved.

## Testing

Added coverage for pre-turn and mid-turn compaction failures with steered input, queued agent mail, and mail that triggers a turn.

GitOrigin-RevId: 48c7a2cba44ac2444957556dd94910fb34515f09
2026-08-25 13:59:52 +00:00
Tamir Duberstein
46aa019e80 Count serialized JSON bytes without allocating strings (#40604)
## Why

History estimation and executed-tool-call limits only need the size of serialized JSON, not the serialized output itself.

## What changed

- Add a shared `serialized_json_bytes` helper that streams JSON into a byte counter.
- Use it for response-item size estimates and executed-tool-call argument limits.
- Preserve serialization errors so callers can apply their existing fallback behavior.

## Testing

- Cover response-item sizing with escaped characters, newlines, and multibyte text.

GitOrigin-RevId: a4417996df96df5c51cae62830adc496912f69c7
2026-08-25 13:10:24 +00:00
Felipe Coury
70b5cfc73b Probe Windows terminal colors without risking startup input (#40598)
## Why

Windows Terminal and xterm.js can render a theme that differs from the
underlying console color table. Querying that visible theme through OSC shares
the console input queue with keystrokes, including input for security-sensitive
startup prompts.

## What changed

- Defer the Windows OSC color probe until protected startup decisions and the
  world-writable workspace scan have completed.
- Preserve and replay unrelated console input records around the probe, while
  removing only valid OSC 10 and 11 replies and retaining the console palette
  as a fallback.
- Require an explicit confirmation key after shortcuts select trust, sandbox,
  or world-writable warning choices, so a fragmented terminal reply cannot
  accept them.
- Accept one- through four-digit OSC RGB components so the visible terminal
  palette is applied across supported response formats.

## Testing

Added coverage for delayed startup scans, protected prompt confirmation,
console-record replay, bracketed paste and malformed OSC preservation, RGB
response parsing, and light-theme composer rendering.

GitOrigin-RevId: b8ae456fe32c701ba3af31e9cc452fc4e8bffa22
2026-08-25 12:20:41 +00:00
felixxia-oai
1f5c9ba183 Optimize Guardian transcript window retention (#40597)
## What changed

- Track protected messages, ordinary messages, and tool entries in separate pools with cached token totals.
- Evict the oldest eligible evidence across pools while preserving transcript token and entry limits and the reserved recent tool entries.

## Testing

- Add regression coverage that a small, tool-heavy transcript window retains the latest final assistant reply.

GitOrigin-RevId: 7aa78d0b0609d8e45cb82e4f7773c0877a4d8224
2026-08-25 12:12:01 +00:00
felixxia-oai
076f17c114 Preserve conversation context in Guardian transcripts (#40594)
## What changed

- Protect developer messages and final assistant replies from eviction by ordinary message evidence in bounded Guardian v2 transcripts.
- Exclude legacy inter-agent messages from that protection and keep recent tool evidence available when the entry limit is reached.
- Retain cache-friendly chunked eviction when protected messages themselves exceed transcript bounds.

## Testing

- Add transcript unit coverage for message and token limits, rejected commentary, legacy inter-agent messages, and recent tool evidence.
- Add an extension test for preserving a final assistant reply after older tool entries are evicted.

GitOrigin-RevId: f37d5f25e4105d2ec8fae226a558b703cda69288
2026-08-25 11:33:59 +00:00
jif
7c6eb0eef1 Scope stop hooks for memory consolidation (#40587)
## Why

Background memory consolidation must honor managed completion policies without
running project completion checks or sending user-facing notifications.

## What changed

- Add a memory-consolidation stop target that selects managed policy hooks and
  executor-scoped cleanup while excluding user, project, session, and plugin
  stop hooks.
- End memory consolidation with an error when a managed stop hook rejects it,
  and propagate that turn error into agent status.
- Disable legacy completion notifications for the background memory worker.

## Testing

- Cover hook selection, executor cleanup, managed rejection, agent error
  status, and notification suppression.

GitOrigin-RevId: be350679ddcde2dde8a408b0972f08facff01a37
2026-08-25 10:29:26 +00:00
jif
4fa6ad1730 Track remaining multi-agent v2 tools in analytics (#40585)
## What changed

- Record collaboration tool analytics for `send_message`, `followup_task`,
  `interrupt_agent`, and `list_agents`, including receiver attribution, duration,
  failures, and interrupted calls.
- Include these calls in per-turn subagent tool counts while keeping the existing
  `subAgentActivity` output unchanged and omitting additional public collaborator
  tool items.
- Extend the collaboration tool schemas with the new tool variants and the
  `interrupted` terminal status.

## Testing

- Add an app-server integration test covering successful and failed calls,
  receiver attribution, duration, prompt omission, activity items, and turn
  counts.

GitOrigin-RevId: e73eaa05c508261e5fc97e7d08d7881a31e04e22
2026-08-25 10:17:03 +00:00
zm-oai
d52478c52e Preserve Unicode paths in Windows batch aliases (#40570)
## Why

Windows batch aliases can fail to invoke Codex when the executable path contains
characters that are not representable in the active console code page.

## What changed

- Generate same-volume executable paths relative to the batch file using `%~dp0`.
- Keep absolute paths as a fallback when the executable and alias are on different
  volumes.

## Testing

Added Windows tests covering a Unicode profile path under code page 437 and an
executable on a different volume.

GitOrigin-RevId: 10093bbc9f19e4fbe2e22d9397e211a113302f45
2026-08-25 07:37:42 +00:00
Benjamin Carlsson
4347f94d55 Register the transcript v2 feature flag (#40554)
## What changed

- Add the under-development `transcript_v2` feature for the interactive
  transcript composer and turn-selection UI.
- Keep it disabled by default and expose it through the configuration schema
  and `codex features enable transcript_v2`.

## Testing

- Verify explicit configuration overrides and CLI persistence for the new
  feature.

GitOrigin-RevId: 138ab7851621c066e8121cc3eb6cd4e7299f9c31
2026-08-25 05:35:25 +00:00
Adam Perry @ OpenAI
8444cf63b5 Derive sandbox contexts from turn environments (#40551)
## What changed

- Add Windows sandbox mode, private-desktop behavior, and legacy Landlock selection to each `EnvironmentConfig`.
- Centralize sandbox context construction on `TurnEnvironment`, preserving environment-owned permissions, paths, and backend settings while applying additional permission grants.
- Use the environment-derived context for project instructions, capability discovery, file uploads, and filesystem-oriented tools.

## Testing

- Verify capability discovery uses the selected environment's permission profile and sandbox backends when they differ from the thread defaults.

GitOrigin-RevId: 7ae2fed90c8ada950f2e8431e571e9b2c793c291
2026-08-25 05:16:45 +00:00
alicec-oai
348f49b292 Include transparent background in image generation analytics (#40544)
## What changed

Add the optional `transparent_background` value to image generation event
parameters and populate it from the corresponding image generation item.

## Testing

Add reducer coverage for completed events with true, false, and unset values,
as well as failed events where the value is unset.

GitOrigin-RevId: a9ee13696acb34feb998b345f54889cac7a401d9
2026-08-25 04:35:51 +00:00
pmccrary-oai
2e4675919e Inject history notes hints into context windows (#40539)
## What changed

- Register the history-notes extension as a context contributor and fetch `thread_hint` from the configured history-notes backend.
- Add non-empty hints of at most 4,000 bytes to the context-window prompt, and omit hints when the request fails or the response is missing, empty, or oversized.
- Verify that app-server sessions use the native backend when `use_history_notes_extension` is enabled and retain the MCP bridge behavior when it is disabled.

## Testing

- Cover hint injection, request context, response validation, backend failures, and disabled-extension behavior in history-notes and app-server tests.

GitOrigin-RevId: 344a7bb79d962ea8b7c969f25b67a79423fc7fcc
2026-08-25 04:05:38 +00:00
pmccrary-oai
3a469a297d Route extension hints into context-window metadata (#40533)
## What changed

- Add a `ContextWindow` prompt slot for thread-scoped extension contributions.
- Include fragments in that slot in the token-budget context-window message.
- Keep the MCP `notes/thread_hint` bridge when the native history-notes extension is disabled, without falling back to it after a native request failure.

GitOrigin-RevId: befcb7cc8570b846094b2b542a112b186b39a30a
2026-08-25 03:38:24 +00:00
Dylan Hurd
9c9675d3d0 Represent terminal input in approval reviews (#40528)
## What changed

- Add a `writeStdin` Guardian action carrying the approval, process, input, and working-directory details.
- Distinguish `command` and `writeStdin` execution approval requests while defaulting missing kinds to `command` for compatibility with older events.
- Render terminal-input review progress, denials, timeouts, and retry actions in the TUI, and record the action separately in analytics.
- Keep terminal-input reviews as child approvals so they do not change the parent command item's lifecycle or reconstructed history.

## Testing

- Cover Guardian serialization, app-server protocol conversion, command history reconstruction, analytics classification, and TUI review flows for terminal input.

GitOrigin-RevId: b083d5e2963bdd23b928644ec03c7eb68ebf2950
2026-08-25 03:08:33 +00:00
mpc-oai
a7b86b6201 Retry provider auth commands after initial failures (#40523)
## Why

A provider auth command can fail during initial credential resolution, leaving
no cached authentication. A subsequent `401` should still give the configured
provider one bounded opportunity to recover.

## What changed

- Treat configured external authentication with an empty cache as eligible for
  unauthorized recovery.
- Allow authority refresh to invoke the external provider when no prior auth is
  cached, while preserving the existing requirements for managers without an
  external provider.

## Testing

Added unit and client coverage for a provider command that fails initially and
succeeds during `401` recovery.

GitOrigin-RevId: 7cab9a03f90ce29b412be8fbd97b297acdad4482
2026-08-25 02:38:22 +00:00
Benjamin Carlsson
c1db22a3cd Add dot-repeat to Vim mode (#40521)
## What changed

- Bind `.` in Vim normal mode to repeat the last complete edit.
- Record semantic delete, change, replace, paste, and insert-mode actions so repeats preserve motions, text objects, inserted text, and editor actions across keymap changes.
- Expose `vim_normal.repeat_last_change` in the configurable keymap and keymap picker, including conflict handling for existing custom bindings.

## Testing

- Add coverage for repeating deletes, replacements, complete changes, pasted and literal text, insert-mode editor actions, custom bindings, unavailable motions, and cleared buffers.

GitOrigin-RevId: 3213df964811e7902377ff1d93641e59f4037914
2026-08-25 02:34:04 +00:00
Andrei Eternal
cbfd999db7 Add hooks for interrupted turns (#40511)
## What changed

- Add an `Interrupt` hook event that runs for an active top-level turn before its
  interrupted abort event is emitted.
- Flush the turn transcript before invoking the hook and provide the session,
  turn, transcript, working directory, model, and permission mode in its input.
- Support command and MCP handlers, including asynchronous commands, with a
  one-second default timeout and a three-second maximum.
- Expose the event through hook configuration, managed requirements, app-server
  notifications, generated schemas, analytics, and the TUI hook views.

## Testing

- Cover handler discovery, timeout normalization, output parsing, protocol
  compatibility, TUI rendering, and interrupt execution ordering.

GitOrigin-RevId: 163fa7c098d94ac2775f6d137f8e916f8ea9b6eb
2026-08-25 01:27:18 +00:00
joeytrasatti-openai
9b2ef38f54 Add persisted thread artifact models (#40509)
## What changed

- Add a `thread_artifacts` SQLite table with per-thread typed identities,
  JSON payloads, cascade deletion, uniqueness enforcement, and an index for
  ordered per-thread reads.
- Export artifact records, attachment and removal outcomes, and paginated
  result models from `codex-state`.

## Testing

- Add a migration test covering preservation of existing thread-section
  metadata and compatibility with the previous migration set.

GitOrigin-RevId: 4e0a8e5bfa168ae2b8871970466e5055e142a4a6
2026-08-25 01:10:10 +00:00
guinness-oai
41ca88e95c Persist realtime events in the thread timeline (#40508)
## Why

Clients need a bounded view of realtime conversations that preserves the order of speech, agent work, and turn lifecycle events without loading the full thread history.

## What changed

- Persist realtime session boundaries, transcript segments, and promoted agent items in paginated thread rollouts.
- Add the experimental `thread/timeline/list` API to page ordinary items, realtime items, and turn boundaries in canonical rollout order. Include `activeRealtimeSessionAtPageStart` so each page can be rendered independently.
- Emit typed `thread/realtime/item/started`, `thread/realtime/item/transcript/delta`, and `thread/realtime/item/completed` notifications around durable realtime items.
- Keep the existing `thread/items/list` response and legacy thread history behavior unchanged.

## Testing

- Cover mixed timeline pagination, realtime-session state at page boundaries, rollout replay, subagent history prefixes, transcript streaming, steering, and promoted agent artifacts.

GitOrigin-RevId: faa2c420192d63e060e8fb32446e3c797422656e
2026-08-25 01:03:20 +00:00
Eric Traut
80e871309a Route cyber Trusted Access links by plan type (#40504)
## What changed

- Send `Free`, `Go`, `Plus`, `Pro`, and `ProLite` ChatGPT users to the individual Trusted Access page when a cybersecurity policy error ends a turn.
- Keep the enterprise Trusted Access application for other plans and sessions without a ChatGPT account or known plan.

## Testing

- Cover individual and enterprise link selection in chat widget tests and history-cell snapshots.

GitOrigin-RevId: a563560d15c401b47f1865a6f58ea4692d31d457
2026-08-25 00:39:27 +00:00
Eric Traut
ebe18fc982 Collapse home paths in AGENTS.md status summaries (#40502)
## What changed

- Render AGENTS.md paths under the home directory with `~` in `/status`.
- Preserve project-relative paths for instruction files inside or above the current working directory.

## Testing

- Add coverage for home-relative, parent, current-directory, and nested AGENTS.md paths.

GitOrigin-RevId: 6dd1ddf481d95dda9d16f7c03a7431d1297f87ec
2026-08-25 00:34:53 +00:00
victor-openai
5918c743f3 Deduplicate plugin skills in unified mentions (#40501)
## Why

Unified `@` search could show a plugin alongside the skills it owns, creating duplicate entry points for the same capability.

## What changed

- Add a nullable `pluginId` to `SkillMetadata` returned by `skills/list` so clients can associate skills with their owning plugin without inspecting names or paths.
- Hide a plugin's owned skills from unified `@` results when that plugin is present, while retaining standalone skills and skills with unknown ownership.
- Keep `$` focused on individual skills and apps, and use it consistently as the skills-list shortcut. Preserve the legacy mention behavior when `mentions_v2` is disabled.

## Testing

- Cover plugin ownership in `skills/list` and the updated `@` and `$` composer results.

GitOrigin-RevId: e168cdff8d0c58f74ce4c228a683880a3167775b
2026-08-25 00:15:49 +00:00
Owen Lin
465eafacbc Harden startup rollout migration against concurrent updates (#40499)
## Why

Another Codex process can write, archive, or compress a rollout while startup
migration is inspecting it. This can leave a discovered path stale or make an
in-progress rollout look empty or busy.

## What changed

- Wait for rollout maintenance to finish before starting background migration.
- Re-read empty rollouts under their writer lock and retry busy rollouts on a
  later startup.
- Find archived or compressed rollouts again when their paths change after
  discovery, while keeping terminal failures from blocking the startup cursor.

## Testing

Added coverage for maintenance contention, writer-owned empty rollouts, busy
rollout retries after archive and compression moves, permanent failure skips,
pending recovery, and paths that move after discovery.

GitOrigin-RevId: 9708f212f2bbff88bd47a01ec4872bf6ce9af535
2026-08-25 00:03:23 +00:00
spasumar-oai
4ef1d4b89b Increase the app-server model refresh interval (#40498)
## What changed

Change the background model refresh interval from 3 minutes to 4 minutes 30
seconds.

GitOrigin-RevId: dcefe471c91dc94a04ddc74595c3ce00d9061e55
2026-08-24 23:29:10 +00:00
Won Park
8476434a97 Harden internal Guardian session isolation (#40497)
## Why

Internal Guardian reviews must remain independent of parent-session customization while still honoring managed execution and environment restrictions.

## What changed

- Apply the restricted Guardian session path to both internal and subagent review sources.
- Start internal reviews without inherited user instructions, extensions, MCP servers, or multi-agent behavior.
- Preserve managed execution policy and selected environment constraints while exposing only the allowed review tools. Honor shell feature restrictions across every selected environment and retain code mode when enabled.

## Testing

- Cover internal review isolation from parent state and managed instructions.
- Cover optional tool filtering, managed shell restrictions, code mode, and secondary environment profiles.

GitOrigin-RevId: edbf7d8a6fe3ee8213a1c75bc8ec331a1cf49006
2026-08-24 23:23:18 +00:00
jif
be3a666143 Track history, notes, and async messages as control tools (#40496)
## What changed

- Emit control-tool analytics for history and notes extension calls and for
  `send_user_message_async`.
- Preserve non-default namespaces in reported tool names, such as
  `history.read_item` and `notes.write_file`.

## Testing

- Add an app-server integration test covering successful and failed calls,
  turn-level tool counts, and omission of tool argument values from analytics.

GitOrigin-RevId: b15a53a311228339f4d577a7b96146ed67f22253
2026-08-24 23:19:03 +00:00
Felipe Coury
5a51caf04d Suggest conversation-based thread titles in /rename (#40495)
## What changed

- Generate a title suggestion from the latest substantive user and assistant messages when the TUI `/rename` prompt opens.
- Prefill the prompt with the result while keeping it editable and preserving any text the user enters before generation finishes.
- Bound and escape the conversation context, omit commentary and IDE context, and correlate responses with the active thread and prompt so stale suggestions are ignored.

## Testing

- Cover conversation selection and prompt construction, generated-title delivery through the embedded app server, loading and prefilled prompt states, stale responses, and preservation of manual edits.

GitOrigin-RevId: 1e7f1d5d4f6503ff9da0548388f610c446c130ca
2026-08-24 23:15:04 +00:00
Felipe Coury
0c992c305d Hide ephemeral system threads from TUI routing (#40494)
## What changed

- Ignore `thread/started` notifications for ephemeral threads whose feature source is `system`, preventing hidden helper threads from entering TUI thread routing or refreshing the agents overview.
- Continue routing persisted system threads normally.

## Testing

- Add coverage for hidden and persisted system-thread notifications in the agents overview.
- Add generated-title normalization cases for wrapping quotes, trailing punctuation, and meaningful leading punctuation.

GitOrigin-RevId: e1ea48502b4f9aa7d5a187c7407df69c55abe2a9
2026-08-24 23:12:33 +00:00
Felipe Coury
b3c7e1a47f Generate descriptive TUI thread titles (#40492)
## What changed

- Give unnamed TUI threads an immediate provisional title from the first user message, then replace it asynchronously with a normalized generated title.
- Preserve manual renames by applying a generated title only while the provisional title is still current, and keep automatic rename notifications out of the transcript.
- Run title generation in a bounded ephemeral structured request that preserves custom permission profiles, otherwise uses read-only access, and disables tools and MCP servers.

## Testing

- Cover prompt and response bounds, Unicode-safe truncation, title normalization, manual-rename races, silent automatic updates, permission preservation, and structured-response failures.

GitOrigin-RevId: 7ed73522f4f6c65a005f65f3a903974d8419e312
2026-08-24 23:06:06 +00:00
Tamir Duberstein
c941572917 Honor response budgets when reading skill resources (#40491)
## Why

`skills.read` paginated resources against a fixed response limit, so a page could exceed a smaller tool-call response budget.

## What changed

- Size each serialized `skills.read` page to the current call's response budget, accounting for JSON escaping and UTF-8 boundaries.
- Cache one bounded executor-resource snapshot per thread so cursor continuations return consistent contents without rereading the file. Replace the snapshot when another resource is read, and reject stale cursors after a reread.
- Tie cached executor snapshots to the selected environment and sandbox context without keeping the environment alive.

## Testing

- Cover budget-constrained reads, escaped and multibyte contents, multi-page reconstruction, changed resources, snapshot eviction, and expired turn-scoped access.

GitOrigin-RevId: e515935b82771b3f29b3fb91ea7a7a72e19a65ee
2026-08-24 23:00:57 +00:00
Winston Howes
fd1bf50410 Harden project config when credential brokering is active (#40490)
## Why

Project configuration must not influence credential-provider environment variables or shell startup behavior while credentials are being brokered.

## What changed

- Track credential brokering as unconfigured, disabled, or enabled, and apply effective network proxy requirements before sanitizing project layers.
- When brokering is enabled, ignore project settings for shell snapshots, profile loading, `ZDOTDIR`, `BASH_ENV`, and credential-provider environment variables.
- Preserve those project shell settings when requirements disable credential brokering.

## Testing

Added coverage for active and disabled broker states, protected credential environment variables, and shell startup settings.

GitOrigin-RevId: 6967cbffdfbb60424a2d2324bad5b91bd2ccfcf6
2026-08-24 22:58:18 +00:00
hefuc-oai
1e9e916923 Honor disabled managed network configuration (#40489)
## Why

Managed network requirements can remain present when `enabled = false`, but a
disabled configuration should not create or expose an active proxy runtime.

## What changed

- Start the managed network proxy only when its effective specification is
  enabled.
- Clear an existing proxy when a permission-profile refresh disables managed
  networking.
- Keep remote executor launches free of managed-network proxy settings when the
  requirements explicitly disable the feature.

## Testing

Added session and unified-exec coverage for initial startup and refresh with
disabled managed networking.

GitOrigin-RevId: f76699802e079eb746d5b1ea6547d19a4bfb7715
2026-08-24 22:51:36 +00:00
xli-oai
2497518490 Export turn cost as an OTEL metric (#40488)
## What changed

- Emit `codex.turn.cost_microusd` as a counter with turn, conversation,
  interruption, speed, and reasoning-effort attributes. Convert the estimated
  USD string to microdollars, rounding to the nearest microdollar and skipping
  values that cannot be represented safely.
- Start turn-cost collection when an OTLP metrics exporter is configured, even
  when the OTEL log exporter is disabled.

## Testing

- Verify cost conversion, rounding, and metric attributes with an in-memory
  metrics snapshot.
- Verify that a metrics-only OTLP configuration starts the turn-cost worker.

GitOrigin-RevId: e60587079f097f10cc1b6d1bf889d3f7a0dc3d5f
2026-08-24 22:44:33 +00:00
rhan-oai
fb9311db5c Extract agent role loading into a dedicated crate (#40487)
## What changed

- Add `codex-agent-roles` for agent role configuration types, parsing,
  discovery, validation, and layered loading.
- Update `codex-core` to consume the new crate's public role configuration and
  parsing APIs.

GitOrigin-RevId: 5a963a219a581b2848dae6fd071aa31a0b5ff22c
2026-08-24 22:40:35 +00:00
Eddie Chen
49880081fe Add root turn IDs to turn and tool analytics (#40486)
## Why

Analytics need to associate subagent activity with the top-level turn that
caused it, while avoiding a stale association when steering makes that origin
ambiguous.

## What changed

- Add `root_turn_id` to turn and tool-item analytics events.
- Read the root from live turn metadata when each event is built, reporting
  `null` when the root is unknown or ambiguous.
- Propagate the metadata through control-tool and code-mode completion facts so
  correlated and background tool events retain the correct root.

## Testing

- Cover root IDs for top-level turns, subagent turns, correlated code-mode
  calls, and tool events emitted after turn completion.
- Verify that queued and subsequent events report `null` after the live root is
  invalidated.

GitOrigin-RevId: 42fd76541c3c716cec74787d47b50adb2d22e6d2
2026-08-24 22:30:59 +00:00
Winston Howes
0280d73c1e Broker credential aliases in child environments (#40484)
## What changed

- Discover supported credentials inherited from the parent even when their canonical provider variable is filtered from the child environment.
- Replace matching values and credentials embedded in longer child environment values with broker dummies, then restore only aliases that the broker virtualized.
- Preserve provider and host bindings when selecting credentials for outbound requests, including GitHub Enterprise and custom OpenAI hosts.
- Expose helpers for identifying provider and binding variables, plus an API for virtualizing credential-bearing text before it is persisted.

## Testing

- Extend credential broker tests for filtered parent variables, exact and embedded aliases, text virtualization, user overrides, and host-bound GitHub and OpenAI credentials.

GitOrigin-RevId: 55d673911900470aab4e206d0f4f5e62ed3611ae
2026-08-24 22:10:44 +00:00
alexsong-oai
4f6d43c267 Support managed AWS access keys for Amazon Bedrock (#40481)
## What changed

- Add the experimental `amazonBedrockAccessKeys` app-server login flow, persist its credentials in the configured auth store, and use them for SigV4-signed Bedrock requests.
- Report `bedrockAccessKeys` as a distinct auth mode and document access-key login alongside AWS profile and environment credential setup.
- Clear the selected Bedrock provider, AWS settings, and Bedrock-specific model on logout while leaving external AWS credentials and `.env` untouched.
- Reject managed access-key login when higher-precedence configuration would prevent its region or profile settings from taking effect.

## Testing

- Cover access-key login, storage, request signing, configuration conflicts, status reporting, and logout cleanup.

GitOrigin-RevId: bbf297887c6503d3651ceb2aad85c4d626e32723
2026-08-24 21:39:48 +00:00
jif
219c203417 Add a computer-use-only Guardian v2 review scope (#40480)
## What changed

- Add `features.guardianv2.review_scope.computer_use_only` to restrict asynchronous classification and fast approvals to browser and computer-use REPL tools.
- Keep other tools on the synchronous approval path without letting them age or reuse scores from in-scope calls.
- Give this scope precedence over `sandboxed_exec_commands` when both options are enabled.

## Testing

- Cover configuration precedence, direct and code-mode tool detection, fast-approval isolation, and end-to-end approval routing for browser, computer-use, and unrelated MCP servers.

GitOrigin-RevId: bfd9ab6abdbd90634b265d354e038724b1e81d65
2026-08-24 21:33:32 +00:00
rhan-oai
d21794d6ba Reload Multi-Agent V2 children through their parent (#40477)
## Why

Multi-Agent V2 children are owned by their parent at runtime. Resuming an
unloaded child directly could rebuild it from caller-provided settings instead
of the parent's current authority.

## What changed

- Route child reloads through their loaded immediate parent and reject direct
  cold resume when that parent is unavailable.
- Preserve the child's recorded model, provider, reasoning effort, and role
  while inheriting the parent's execution policy and MCP extensions.
- Validate cached environments against the parent, intersect local permission
  profiles, and reject stale remote or workspace-root configurations.
- Keep paginated cold-resume token usage attribution when attaching to the
  reloaded child.

## Testing

Add coverage for owner validation, nested-parent reloads, permission and
environment changes, role instruction restoration, paginated usage replay,
and app-server child resume behavior.

GitOrigin-RevId: 84014762bcdb57f94fc23974c9c1af55dc1babf1
2026-08-24 20:47:10 +00:00
iceweasel-oai
3a211471d2 Request read control when updating Windows sandbox ACLs (#40475)
## Why

`SetSecurityInfo` can reject a directory handle opened with only `WRITE_DAC`.

## What changed

- Request `READ_CONTROL` alongside `WRITE_DAC` when opening or creating a
  no-reparse sandbox directory.
- Add a Windows regression test that provisions and locks a plain sandbox
  directory through the handle-based ACL path.

GitOrigin-RevId: bd50dc54d4cc80e9609323ddb4ecc7e4780a31fb
2026-08-24 20:34:13 +00:00
Won Park
333beecd41 Add structured full approval reviews to extensions (#40472)
## What changed

- Split the approval review contributor into a `fast_decision` path for existing evidence and a `full_review` path for structured reviews.
- Add host-owned full-review inputs with action evidence, conversation history, thread and turn identifiers, approval context, and extension data.
- Add structured assessment and error types, and resolve full reviews using the first contributor that claims the request.

## Testing

- Cover full-review input propagation, first-claim ordering, and short-circuit behavior in the extension registry tests.

GitOrigin-RevId: 6f763d874af8c0b66a0d760b7b7c7dfe32251c9e
2026-08-24 20:25:26 +00:00
Benjamin Carlsson
bb8cada846 Render Markdown links as clickable labels in supported terminals (#40471)
## What changed

- Render web-link labels in cyan with an underline and hide the repeated destination in recognized terminals with hyperlink support.
- Keep destinations visible for unknown terminals, multiplexers, non-terminal output, and empty labels so the URL remains usable.
- Preserve OSC 8 link targets through prose and table wrapping, streaming updates, transcript clipping, and pager scrolling.

## Testing

- Add coverage for terminal detection, label formatting and fallbacks, wrapped tables and prose, streaming parity, history output, and scrolled transcript rendering.

GitOrigin-RevId: 4a09e41e349ba299022a9c00f0c25892d9aaefe3
2026-08-24 20:04:52 +00:00
Winston Howes
c3d5e4418f Add credential brokering to network proxy feature config (#40466)
## What changed

- Add `features.network_proxy.credential_broker` and preserve structured network proxy settings when toggling the feature through config APIs.
- Protect broker enablement and provider context variables from project config, while carrying trusted context into filtered shell environments.
- Propagate brokered credentials through shell snapshots and restore real credentials for unsandboxed escalated commands.
- Normalize broker context environment keys case-insensitively on Windows and avoid conflicting remote managed-network enforcement when no proxy launch configuration is available.

## Testing

- Cover config layering, editing, project sanitization, Windows environment handling, shell snapshots, escalated execution, and end-to-end GitHub credential brokering in the zsh-fork runtime.

GitOrigin-RevId: 500e51e804e1988022052ccfe00b8fac5e495f4f
2026-08-24 19:52:27 +00:00