Commit Graph

10443 Commits

Author SHA1 Message Date
Jiwon Kim
b6ab99ed87 Prefer remote Sites over the bundled plugin (#42100)
## Why

When the remote Sites plugin is installed and its local bundle is available, exposing the bundled copy as well creates duplicate catalog entries and can load the wrong skills.

## What changed

- Persist an account- and backend-scoped exclusion for `sites@openai-bundled` once the remote replacement is installed and loadable.
- Apply the exclusion to plugin catalogs, search, direct reads and installs, runtime loading, hooks, and skill caches while preserving the remote plugin's server-owned enabled state.
- Restore the bundled fallback when the remote plugin is absent or its local files are unavailable, and throttle repeated availability checks for 60 seconds.

## Testing

- Added manager tests for persistence across restarts, account/backend isolation, fallback restoration, concurrent checks, and refresh throttling.
- Added app-server and agent-turn tests confirming that catalog, search, and skill loading prefer remote Sites.

GitOrigin-RevId: bc1154f79d3107910fee9fa27389a0ddb48ce6cf
2026-09-01 16:58:54 +00:00
chess
a17ee5705c Make diagnostic report uploads resilient to slow networks (#42096)
## Why

Diagnostic reports can span several envelopes, and the previous 10-second shared
network budget could expire before slow uploads and their attachments completed.

## What changed

- Give each diagnostic report a single five-minute deadline shared by the event,
  attachments, retries, and retry backoff.
- Stop reading or sending later attachments once the deadline or a Sentry rate
  limit is reached.
- Limit the app server to three concurrent report uploads and return an
  overloaded JSON-RPC error for additional requests until a slot is released.

## Testing

Add coverage for slow multi-envelope reports, deadline-aware retries, skipped
attachments, rate-limit handling, and concurrency-slot release after failures.

GitOrigin-RevId: bdacf6c9731df16d2763e204565986eb6d540233
2026-09-01 16:49:16 +00:00
iceweasel-oai
ade0ccacf9 Record Windows MXC availability (#42094)
## What changed

- Probe whether the native Windows MXC process security environment is usable
  when selecting a sandbox.
- Emit `codex.windows_mxc.available` at most once per process, labeled with the
  probe result.
- Add the MXC workspace dependencies for Cargo and Bazel, and pin
  `tracelogging` to a version compatible with the GNU Windows toolchain.

GitOrigin-RevId: d7cfeed6f0333feda5764e1ee44fe5bbd50f9a58
2026-09-01 16:40:05 +00:00
Alec Barber
f4e6cb7876 Attribute Guardian reviews to OpenAI app tools (#42086)
## Why

Custom MCP tool names may contain user data, so they should not be added to Guardian metric tags.

## What changed

- Add the sanitized `tool` tag to Guardian review counts for MCP calls served by the OpenAI Apps server.
- Keep custom MCP calls and Guardian duration and token-usage histograms on their existing tags.

## Testing

- Cover network access, OpenAI app tool calls, and custom MCP tool calls in the Guardian metrics test.

GitOrigin-RevId: 6bd09ae461eab504f8f07bf7d0c9d1c0aa1317c9
2026-09-01 16:04:32 +00:00
felixxia-oai
6127478086 Centralize Guardian context composition (#42085)
## What changed

- Add `SectionRegistry::compose` to group collected authorization fragments and transcript entries while preserving fragment boundaries and registration order.
- Use the shared composed context in the core Guardian prompt and Guardian V2 synchronous and asynchronous reviewers.
- Keep transcript rendering, retention, and delta handling with each caller while removing duplicated section grouping and authorization rendering.

## Testing

- Cover composition for synchronous and asynchronous targets, including root conversation role handling, trusted user answers, transcript entries, empty context, and contributor failures.
- Verify the synchronous reviewer preserves authorization fragment boundaries in prompt items.

GitOrigin-RevId: 9268343631fd6417bb05a3c0abce883559a37685
2026-09-01 15:54:18 +00:00
Ankush Gupta
67cc3c318d Attribute nested REPL reviews to their tool calls (#42082)
## What changed

- Retain MCP invocation metadata for Node-backed REPL servers so nested
  elicitations can resolve the enclosing tool call.
- Use a valid, same-server `callId` from the current turn as the Guardian
  assessment target while continuing to review each nested action and connector
  independently.
- Fall back to an elicitation-specific target when `callId` is missing,
  malformed, unknown, from another server, or from an earlier turn.

## Testing

- Cover ordinary and strict reviews for `node_repl` and `cua_repl`, multiple
  nested decisions, unrelated servers, and invalid or stale call IDs.

GitOrigin-RevId: adea4b5cff96726a540ff3b3ea902b0f5dd99299
2026-09-01 15:34:03 +00:00
felixxia-oai
2350823caa Unify Guardian context section collection (#42076)
## What changed

- Add typed context sections for root-conversation evidence, trusted user answers, and conversation transcripts to `codex-guardian-context`.
- Use the shared section registry when building core Guardian prompts and asynchronous Guardian V2 scoring context.
- Preserve source-role labeling while delivering authorization evidence as user-role context, and fail closed when context collection fails.

## Testing

- Cover shared section ordering and role preservation for synchronous and asynchronous targets.
- Verify trusted user answers appear exactly once as user-role input in Guardian V2 approval flows.

GitOrigin-RevId: 1d5d793ffbf166077411a66e85e039596907fb7e
2026-09-01 15:22:21 +00:00
Charlie Marsh
d141438342 Detect Vite+-managed Codex installs (#42071)
## Why

Vite+ launches Codex through the same JavaScript shim as npm, so Codex could
misidentify Vite+-owned installations and recommend npm for updates.

## What changed

- Detect Vite+ global installs from their package ownership metadata and pass a
  dedicated `CODEX_MANAGED_BY_VITE_PLUS` marker to the native binary.
- Represent Vite+ in install context and `codex doctor` output.
- Recommend `vp install -g @openai/codex` in update and repair flows for
  Vite+-managed installs.

See https://github.com/openai/codex/pull/30880.

GitOrigin-RevId: 8add724eefd31170a078086392609dbbd7f20b26
2026-09-01 15:12:53 +00:00
jif
82461c9990 Remove redundant test coverage (#42069)
## What changed

- Remove standalone TUI configuration tests whose defaults or parsing paths are
  already covered by broader configuration tests.
- Remove a duplicate JSON-result test that invoked the same model as the
  retained test.
- Remove a service-tier test whose `None` input case is already asserted by
  the neighboring filtering test.

GitOrigin-RevId: ae1304e72d03a1d44a735b4e5816936e7e4e2de5
2026-09-01 15:04:11 +00:00
Eric Burke
3c6bb8b3eb Detect standalone installs from the macOS CLI bundle (#42068)
## What changed

- Recognize executables under `CodexCLI.app/Contents/MacOS` and resolve the
  surrounding standalone package layout from its sibling `bin` directory.
- Preserve standalone install detection and access to bundled resources and
  path entries when Codex is launched through the app bundle.

## Testing

- Add a regression test for package layout and install method discovery from a
  bundled executable.

GitOrigin-RevId: 02b41a978b256da43df95a922bc5ee99a78b8168
2026-09-01 14:51:54 +00:00
jif
25ba0ae6cd Remove selected core test cases (#42066)
## What changed

Remove targeted tests for history normalization, exec-policy amendments,
default reasoning effort, collaboration instruction overrides, and sandbox
approval telemetry.

GitOrigin-RevId: 6f79bf4cd4b625b4ff750e3aa00a88871afc97f4
2026-09-01 14:43:27 +00:00
jif
28097e98eb Preserve Guardian history across thread reconstruction (#42065)
## Why

Guardian review evidence must remain available after a compacted thread is resumed or forked, while rolled-back or parent-local evidence must not grant authorization in a different context.

## What changed

- Store the bounded, model-invisible Guardian transcript alongside compacted rollout history and restore it from the newest surviving checkpoint during replay.
- Trim Guardian history at rollback boundaries, clearing it when the boundary has already been evicted.
- Preserve the checkpoint for user-initiated forks, but remove it when spawning a subagent so parent review evidence is not inherited.
- Keep the new rollout field optional for compatibility with existing compacted records and legacy readers.

## Testing

- Cover Guardian history across compaction, restart, paginated and pathless stores, user forks, rollback, bounded replay, serialization, and subagent forks.

GitOrigin-RevId: 6ab076d5e0c3aac4d6a41ebd50ba2b200c90213e
2026-09-01 14:33:58 +00:00
Alex Zamoshchin
3a04482645 Honor app link settings for MCP tool approvals (#42056)
## What changed

- Pass the resolved app `link_id` into MCP tool approval policy evaluation.
- Apply link-specific `default_tools_approval_mode` and `approvals_reviewer`
  settings before app and global defaults, while preserving per-tool and managed
  policy precedence.

## Testing

- Cover link-specific approval prompts, selected account links, reviewer
  routing, fallback behavior, and managed-policy overrides.

GitOrigin-RevId: caa07ec3e73c87aad9522bd69808cd1c0b1686f5
2026-09-01 13:43:27 +00:00
Alex Zamoshchin
0e37d834d4 Honor explicit account selectors for Apps tool calls (#42054)
## What changed

- Resolve `link_id` from tool-call arguments when Apps metadata sets
  `requires_explicit_link_id` to `true`.
- Reject the call before approval or execution when the required selector is
  missing, empty, or not a string.
- Preserve catalog-provided account metadata for legacy Apps tools and leave
  non-Apps MCP tools unchanged.

## Testing

- Add unit coverage for required selectors, malformed values, legacy
  fallbacks, and non-Apps tools.
- Add end-to-end coverage for execution, approval prompts, and rejection when
  an Apps call omits `link_id`.

GitOrigin-RevId: 667fd04102a3934d53ded020da6d1bf68a1ca3e5
2026-09-01 13:29:18 +00:00
Alex Zamoshchin
0ec375eb70 Add per-account approval settings for apps (#42047)
## What changed

- Add `apps.<app_id>.links.<link_id>` configuration for overriding
  `approvals_reviewer` and `default_tools_approval_mode` per connected account.
- Expose link settings through the app-server protocol and generated JSON and
  TypeScript schemas.

## Testing

- Extend `config/read` coverage for populated, empty, and absent `links`
  sections.

GitOrigin-RevId: 43004d2722439060fdadc5e5cd9ed3108774ecaf
2026-09-01 13:07:56 +00:00
jif
90ae0c4ef9 Tag Codex home size metrics with compression state (#42043)
## What changed

Add a `compression_enabled` attribute to each
`codex.app_server.codex_home.size_bytes` sample. The value reflects whether
`LocalThreadStoreCompression` is enabled in the effective startup configuration.

GitOrigin-RevId: c087d36b4e578245aee6cfe5257075dfd3bdd025
2026-09-01 12:41:37 +00:00
jif
9d0eae74cd Include shared histories in rollout compression (#42039)
## What changed

- Make `local_thread_store_compression` compress cold rollout files across shared and forked histories without a separate compression mode.
- Retire `local_thread_store_shared_compression` while continuing to accept it in strict configuration without changing compression behavior.
- Read rollout files through the compressed-rollout reader when `codex exec resume` determines the latest turn's working directory.

## Testing

- Cover compression and restoration of an archived fork chain.
- Cover cwd-based resume selection when only the compressed rollout remains.
- Cover the removed compatibility key in strict configuration.

GitOrigin-RevId: 8edebf61eccc1f79cabb8e641f8982c76f337bf1
2026-09-01 12:23:20 +00:00
jif
2e5ee418ad Improve Guardian report diagnostics (#42033)
## Why

Reports from a large thread tree can exceed the rollout attachment limit, making
the threads involved in a failed Guardian review harder to diagnose.

## What changed

- Prioritize descendants with retained failed reviews when selecting bounded
  report rollouts, while always preserving the reported thread.
- Include each selected thread's available Guardian trunk rollout alongside its
  conversation rollout.
- Add a thread index attachment with selected filenames, bounded omission details,
  retained failure threads, and the process-wide discarded-record count.
- Link failed-review records to their reviewed turn and target item when available.

## Testing

- Cover failed-review prioritization, bounded omission metadata, discarded-record
  accounting, and turn/item linkage in Guardian report records.

GitOrigin-RevId: ae7916c27a3c279e899cd5a6ead8a4b7e0cc26a1
2026-09-01 11:14:20 +00:00
felixxia-oai
8209978616 Share Guardian user-message retention logic (#42031)
## What changed

- Add a shared `select_user_messages` helper in `guardian-context` that always
  anchors the first user message and fills the remaining token budget from
  newest to oldest.
- Use the helper for both core Guardian prompt rendering and the Guardian V2
  async scorer so they apply the same retention policy.

## Testing

- Cover empty and single-message transcripts, over-budget anchors, and
  newest-first selection across multiple token budgets.

GitOrigin-RevId: 7db246013875263ceb5806d2a6a19b4e2a3db1c4
2026-09-01 10:40:33 +00:00
Eddie Chen
2b7c279735 Report turn trigger and source in turn analytics (#42003)
## What changed

- Add `turn_trigger` and `codex_turn_source` to `codex_turn_event` analytics.
- Read the source from effective Responses metadata, preserving configured-over-client precedence and reflecting accepted steer metadata.
- Omit trigger and source values from analytics when they exceed the existing Responses metadata value limit.

## Testing

- Cover event serialization, turn lifecycle emission, configured and client source precedence, size limits, and source updates after steering.

GitOrigin-RevId: bbd45af4c6af52956d2394b722ea78e65e5b9bd7
2026-09-01 07:32:54 +00:00
sayan-oai
e017e93ace Preserve raw response usage metadata (#41980)
## What changed

- Include the complete upstream `response.usage` object in
  `ResponseUsageMetadata.metadata` while retaining the existing `amount` field.
- Expose the metadata through `rawResponse/completed` notifications and update
  the generated JSON and TypeScript schemas.

## Testing

- Cover SSE, WebSocket, turn, and compaction completion paths.

GitOrigin-RevId: 6d79b1b4c92ac11abf43ec98f380b4868288a701
2026-09-01 05:17:11 +00:00
Eric Traut
d038f3448f Move disable_paste_burst under [tui] (#41976)
## What changed

- Add `tui.disable_paste_burst` as the preferred configuration key.
- Keep the top-level `disable_paste_burst` key as a legacy fallback.
- Give the `[tui]` setting precedence when both keys are present, while preserving configuration-layer precedence.

## Testing

Add configuration tests covering defaults, both key locations, precedence between the keys, and command-line overrides.

GitOrigin-RevId: e7fc9337d5b19d2fd9407e08b8301cee77a11779
2026-09-01 04:53:57 +00:00
Eric Traut
c7fced56eb Track TUI starts by app server mode (#41974)
## What changed

Emit the `codex.tui.start` counter once per TUI launch with an
`app_server_mode` label of `in_process`, `local_daemon`, or `remote`. Recording
the metric during startup keeps reconnects from counting as additional
launches.

GitOrigin-RevId: 7527f319b95ae53f5278fa16120120a433a29ae4
2026-09-01 04:33:38 +00:00
willwang-openai
633ab199cf Enforce marketplace source policy for curated plugins (#41953)
## Why

Marketplace source restrictions should cover curated plugins backed by the OpenAI plugins repository, not only user-configured marketplaces.

## What changed

- Validate both local curated catalogs against the existing OpenAI plugins Git source allowlist.
- Apply that policy to catalog discovery, installation, cached plugin and skill loading, and startup repository sync.
- Keep bundled and remote installed plugins independent of the curated Git source policy.

## Testing

Added coverage for exact and shorthand Git allowlist entries, host patterns, blocked and invalid rules, curated catalog variants, plugin skills, startup sync, and remote installed plugins.

GitOrigin-RevId: 04617acb4a93040c70a13759eb4ce872877ba211
2026-09-01 01:37:15 +00:00
Adam Perry @ OpenAI
55e5158e18 Improve tracing for nested tool calls and exec processes (#41950)
## Why

Code-mode callbacks can outlive their initial request and run in separate tasks,
so their trace context must be preserved explicitly.

## What changed

- Preserve the execution context for code-mode callbacks and add spans for
  nested tool invocations in the runtime and dispatch broker.
- Propagate each tool invocation span as the parent of its streamed gRPC
  callback, falling back to the outer execution context when needed.
- Add a `codex.exec_server.process` span for each process lifetime, including
  its process ID and completion result, without retaining the request span.

GitOrigin-RevId: a6059e34d895416f5517e51dad6ca0078355adca
2026-09-01 01:00:50 +00:00
Matthew Zeng
bfa9646787 Add plugin reconciliation app-server API (#41949)
## What changed

- Add the `plugin/reconcile` JSON-RPC method to synchronize installed remote plugin bundles and wait for required hook updates.
- Return affected plugin IDs with MCP, Apps, hooks, and skills refresh hints, plus remote update and materialization failures.
- Refresh loaded hook runtimes after relevant updates and return an empty result when plugins or backend authentication are unavailable.

## Testing

- Cover workspace and global bundle installs, unchanged passes, enablement changes, updates, removals, materialization failures, hook refreshes, and disabled plugins.

GitOrigin-RevId: 45c02518d71990d13eb09d56ed51505c91c66956
2026-09-01 00:50:11 +00:00
Adam Perry @ OpenAI
c2e5692e2c Expand extension permission regression coverage (#41946)
## What changed

- Verify image-generation extensions rebind permissions on every turn, preserving session grants while expiring turn-only grants.
- Cover executor skill reference reads under current filesystem permissions, including paginated reads, permission changes, and edits between pages.
- Verify oversized live executor skill prompts emit a warning without replacing previously injected prompt content.

GitOrigin-RevId: 1fc8eef409fa65db4bb1ab6a00408fe72c9e938f
2026-09-01 00:42:19 +00:00
xli-oai
e39ab0c185 Emit turn cost telemetry for ChatGPT sessions (#41944)
## What changed

- Query workspace-visible turn estimates for ChatGPT-authenticated sessions through the appropriate Codex or ChatGPT endpoint.
- Track completed response IDs and emit `codex.turn.cost_microusd` only when the estimate is nonnegative, visible, and covers every observed response.
- Keep error response bodies out of turn-cost worker logs.

## Testing

- Cover both endpoint styles, nullable estimates, settlement validation, exact micro-USD conversion, and response-ID tracking.
- Add an app-server integration test that verifies a settled ChatGPT turn reaches the OTLP metrics exporter with its turn, conversation, and auth-mode attributes.

GitOrigin-RevId: 6ae3f8df729fad52984a0c6efafd8c96c7214e55
2026-09-01 00:30:55 +00:00
Benjamin Carlsson
9c7edd4bc3 Add Vim undo to the TUI composer (#41941)
## Why

Composer drafts include attachments, mention targets, and deferred paste payloads in addition to visible text. Vim undo needs to restore that complete state as a single edit.

## What changed

- Add bounded, draft-level Vim undo history, with `u` as the configurable default binding in normal mode.
- Group complete Vim commands and insert sessions into undo steps, including direct composer changes such as pastes and attachments.
- Preserve undo, repeat, and search state when a reverse-history preview is canceled, and start fresh history when another prompt is accepted.

## Testing

- Cover grouped edits, custom bindings, history and search interactions, attachments, and large paste payloads.

GitOrigin-RevId: 12ecdb3c34a2d66f5d856aa2f82dc15bd91b230b
2026-09-01 00:21:22 +00:00
Benjamin Carlsson
c5a3700dd7 Preserve transcript layout caches during backtrack selection (#41940)
## Why

Moving between prompts in backtrack mode rebuilt every transcript renderable and
discarded their cached heights, causing the entire transcript to be laid out
again for each selection change.

## What changed

Rerender only the previously highlighted cell and the newly highlighted cell.
Keep all other renderables, cached heights, and the live tail intact while
continuing to scroll the selected prompt into view.

## Testing

Add regression tests that verify selection changes preserve unrelated height
caches and produce the same viewport and scroll position as a full rebuild,
including with a live tail and terminal width changes.

GitOrigin-RevId: 685a8ce65ecadef20521ce2ded7b516fdf8499c9
2026-09-01 00:12:22 +00:00
Benjamin Carlsson
0e03f88a30 Clarify resume guidance in exit summaries (#41938)
## What changed

- Show the exact `codex resume <thread-id>` command on its own indented line.
- When a thread has a name, also explain that users can run `codex resume` and select the named thread from the picker.
- Apply command highlighting to both resume options when color is enabled.

## Testing

- Cover unnamed, empty-name, named, colored, and embedded-session exit summaries.

GitOrigin-RevId: d97c04db8a34376c6d9ea839b515b04a384b85d1
2026-09-01 00:02:38 +00:00
Benjamin Carlsson
115ffaf8bf Limit background terminal input previews (#41937)
## Why

Large input sent to a background terminal can require excessive wrapping work and fill the inline history view.

## What changed

- Limit inline input previews to 12 rendered rows and bound preview processing to 64 KiB.
- Show a transcript hint when input is omitted, while preserving the complete input in transcript and raw views.
- Keep URLs intact when they fit and truncate only the final overflowing line when needed.

## Testing

Add regression coverage for long wrapped input, narrow viewports, zero-width Unicode payloads, URLs, and inputs that fit within the preview budget.

GitOrigin-RevId: c20edf156d5c8364083b1690e41cabd29786a279
2026-08-31 23:54:28 +00:00
jif
13d75cd1c3 Attach failed Guardian reviews to diagnostic reports (#41936)
## What changed

- Retain bounded, process-local records for failed Guardian reviews, including the reviewed action, decision, status, model, instructions, and reviewer history.
- Add recent records from the reported thread and its descendants to log-enabled report uploads as `auto-review-failures.jsonl`.
- Preserve the action and decision while omitting oversized reviewer context, and exclude successful, ephemeral, and capture-disabled reviews.

## Testing

- Cover denied and invalid decisions, cleaned-up ephemeral reviewers, descendant-thread selection, record count and byte limits, and oversized-context fallback.

GitOrigin-RevId: 5f12f7605041c3c84e826e6bac1cf06b1518ab24
2026-08-31 23:44:41 +00:00
Jennifer Zhao
981d6b652b Omit undersized WAV output from Code Mode (#41934)
## Why

Audio models cannot reliably encode tool-generated clips shorter than 25 ms.

## What changed

- Measure the available audio frames in base64-encoded PCM and IEEE float WAV outputs.
- Replace clips under 25 ms with explanatory text while preserving surrounding Code Mode output.
- Leave clips at or above the threshold and unrecognized audio formats unchanged.

## Testing

- Cover the duration boundary across multiple sample rates and all supported `audio()` input forms.
- Verify bounded and truncated WAV chunks, output after `yield_control()`, and end-to-end mixed text and audio output.

GitOrigin-RevId: 342b4bdbc65db4238580f9cdc372763c2576eca5
2026-08-31 23:36:04 +00:00
Charlie Marsh
a62ff9a5d4 Report configured sandbox policy consistently (#41933)
## Why

Sandbox diagnostics could report `read-only` when a configured writable root did not yet exist, because policy labeling used filesystem-aware runtime root resolution.

## What changed

- Derive diagnostic policy labels from configured writable roots without inspecting the filesystem. Runtime sandbox authorization continues to use filesystem-aware resolution.
- Capture sandbox labels once per turn and reuse them for response metadata and tool-result metrics.

## Testing

Add coverage for missing project roots, denied roots, and deny rules on project subpaths.

GitOrigin-RevId: ccbdb8c32a1f44bfa63ae4d2ae1f9cc408e66b9c
2026-08-31 23:29:20 +00:00
jif
4ac20a7f74 Increase Guardian message transcript limits (#41931)
## What changed

- Raise the Guardian message transcript budget from 10,000 to 20,000 tokens.
- Raise the per-message entry limit from 2,000 to 5,000 tokens.

GitOrigin-RevId: 93a92e3d806fd3bf005e6c27964babd7ed2f948e
2026-08-31 23:26:25 +00:00
jif
2c3bf4ea79 Open the agents overview directly in the reconnect test (#41929)
## What changed

Dispatch `AppEvent::OpenAgentsOverview` in the daemon reconnect navigation test instead of simulating the Alt+A keyboard shortcut.

GitOrigin-RevId: 99729a39496ffb96747f6d0c4be0edf52d1ef3f6
2026-08-31 23:07:21 +00:00
iceweasel-oai
c4350b4ca2 Use executor path context for permission preapproval (#41928)
## Why

Permission grants can belong to an executor whose path convention differs from
the local host, such as a Windows remote environment. Matching those grants
against a host-native working directory can reject valid permissions.

## What changed

- Normalize, materialize, and compare additional filesystem permissions using
  the selected executor's URI-based sandbox context.
- Apply the same context-aware preapproval flow to `exec_command`,
  `apply_patch`, and extension tools.
- Fail closed when symbolic temporary-directory or project-root permissions
  cannot be resolved from executor metadata, while accepting opaque working
  directory URIs when requested paths use the executor's convention.

## Testing

- Added coverage for reusing a Windows permission grant from a non-Windows
  host, resolving symbolic temporary-directory grants, and normalizing paths
  with an opaque Windows working directory.

GitOrigin-RevId: aee54350a25430a0443f8319e2bb0bbdc4f44282
2026-08-31 22:58:26 +00:00
Adam Perry @ OpenAI
9127f21890 Test repository-wide Rust formatter discovery (#41925)
## What changed

- Exercise Rust source discovery through a mocked `git ls-files` call, including files outside `codex-rs`, paths containing spaces, and stale entries that no longer exist.
- Assert that the formatter invokes `rustfmt` from `codex-rs` with the repository configuration in both format and check modes.
- Keep the multiline argument-comment lint fixture stable under formatting and update affected Rust test files to the expected style.

GitOrigin-RevId: 0cfffde1bb91bf620d2118bed1efc68466c0cca6
2026-08-31 22:47:53 +00:00
guinness-oai
64c9cde458 Record realtime conversation history in Core (#41924)
## Why

Realtime history should be recorded consistently for every Core host, including
when no app-server event listener is attached.

## What changed

- Move transcript segmentation, session boundaries, and backing-agent artifact
  promotion into Core for paginated threads.
- Persist canonical realtime items through the thread store in event order and
  emit dedicated history lifecycle events for hosts to present.
- Translate those Core events into the existing app-server realtime item
  notifications without app-server persisting the items a second time.

## Testing

- Cover Core-only persistence across repeated sessions, ephemeral sessions,
  accepted and rejected steering, typed input ordering, and artifact promotion.
- Verify app-server notifications correspond to the persisted timeline.

GitOrigin-RevId: 7cbef14129d77f6d6d7099b733be91f5279c55f5
2026-08-31 22:38:23 +00:00
Zahan Malkani
34c4f7e72d Allow per-call sideband endpoints for existing realtime calls (#41923)
## What changed

- Add an in-process `sideband_base_url` override to `ConversationStartTransport::ExistingCall`, while keeping app-server requests on the configured or default endpoint.
- Prefer the per-call endpoint when attaching and reconnecting a sideband, falling back to `experimental_realtime_ws_base_url` when no override is supplied.
- Preserve runtime authentication headers on the selected endpoint without adding bearer authorization.

## Testing

- Cover configured and per-call endpoint selection, authentication headers, call-specific handshake paths, and reconnect behavior.

GitOrigin-RevId: 16c439fe0a9ff8bcdda4ec615bb9983e30935052
2026-08-31 22:29:40 +00:00
Benjamin Carlsson
0344625ccf Start fresh Vim drafts in Insert mode (#41921)
## What changed

- Start the composer in Vim Insert mode when Vim is enabled and return to
  Insert mode after submissions and slash-command dispatch.
- Record the fresh Insert session as a Vim edit so `.` can repeat text entered
  in a new draft.
- Keep `/` and `?` as Normal-mode composer searches, and let Backspace cancel
  an empty search query and any pending operator without changing the draft.

## Testing

- Add coverage for startup, submitted and queued drafts, inline and goal slash
  commands, repeatable edits, and canceled searches.

GitOrigin-RevId: 1a5ee30c44685d2b2a037e46c3ab4ab611024919
2026-08-31 22:26:09 +00:00
olliem-oai
865bbf9a69 Source Guardian REPL policy from model metadata (#41919)
## What changed

- Add `auto_review.node_repl_policy` to model messages for `node_repl` and `cua_repl` reviews.
- Use the reviewer model's configured policy, falling back to the bundled policy when the field is absent and skipping injection when it is explicitly empty.
- Include the effective policy in Guardian session reuse checks and reject unsafe parent-model fallback transitions that would change it.

## Testing

- Cover catalog, bundled, and explicitly empty policies across Node and CUA review paths.
- Verify that policy changes invalidate cached reviewer sessions and incompatible fallback transitions.

GitOrigin-RevId: 51c0bdfed9b464091b6eb47d91ca5a0990d7a315
2026-08-31 22:08:44 +00:00
Eric Traut
746798b2f7 Restore agent navigation after TUI reconnects (#41918)
## What changed

- Keep the agent command center visible with its cached inventory and draft while reconnecting, then refresh it without losing the selected task.
- Allow cached, unavailable conversations to reattach when selected while preserving their drafts, recap progress, and runtime permissions.
- Report an unsubmitted rename when its target disappears during refresh, and continue to quarantine queued input instead of resending it automatically.

## Testing

- Add a Unix socket replacement test covering command-center recovery with and without an active conversation, failed reconnects, inventory changes, and subsequent live task input.

GitOrigin-RevId: 774aca2dfb8358e9abd6a2e2ef0d509646648f66
2026-08-31 21:59:56 +00:00
Eric Traut
0a2e2bf957 Open the agents overview from an empty composer (#41917)
## What changed

- Open the agents overview with Left from an empty, focused composer in local-daemon sessions.
- Keep the shortcut inactive while editing text, using transient input surfaces, or when Left has been explicitly remapped.
- Show the contextual shortcut in the footer and shortcuts overlay.
- Leave the configurable `open_agents` action unbound by default instead of assigning `Alt+A`.

## Testing

- Add coverage for session eligibility, input-state guards, editor and Vim remaps, event dispatch, and footer rendering.

GitOrigin-RevId: ef17db3d9d09c3a08c3f7353c5b8a02f2b61c696
2026-08-31 21:53:02 +00:00
Eric Traut
907c34e867 Reconnect TUI app-server sessions automatically (#41916)
## What changed

- Reconnect out-of-process TUI sessions after the app-server transport drops, bootstrap a fresh client, and resume the active thread.
- Preserve cached transcripts, drafts, runtime settings, task-tool capabilities, and live notification routing across the new connection.
- Keep recovered or possibly submitted input paused for manual review instead of resending it, and leave conversations that cannot be resumed available as read-only cached views.
- Show reconnect progress and actionable failure states while still allowing drafts to be edited or copied.

## Testing

- Add app-level coverage for successful recovery, failed and unavailable resumes, input quarantine, and preserved session state.
- Extend the terminal integration test to verify that a draft survives reconnection, the thread is resumed without starting a turn, and notifications arrive through the replacement connection.

GitOrigin-RevId: 5dcb867c89e226a0c545d6313a77424c233cd47a
2026-08-31 21:36:49 +00:00
Tamir Duberstein
9a4b78579a Move the config schema generator into a dedicated crate (#41915)
## What changed

- Add the `codex-config-schema` workspace and Bazel crate for the
  `codex-write-config-schema` binary.
- Preserve `codex-rs/core/config.schema.json` as the default output location.
- Update `just write-config-schema` to run the new crate and remove the schema
  generator's `clap` dependency and binary target from `codex-core`.

GitOrigin-RevId: 7447f97d6e44d1077b16d2d850f8a8add9117ea6
2026-08-31 21:27:51 +00:00
Ian MacLeod
17e8101699 Preserve TUI status timing when the status row is hidden (#41913)
## Why

Streaming can temporarily hide the status row, but its elapsed time is still
needed when the row returns and when the final `Worked for` duration falls back
to the local clock. Approval prompts must also keep that clock paused.

## What changed

- Own the pause-aware status timer in the bottom pane independently of the
  optional status row.
- Preserve elapsed time and modal pause state while hiding or restoring the row,
  and reset the clock for new turns and Windows sandbox setup.
- Use the independent timer as the fallback for the final turn duration.

## Testing

Add timer unit coverage and TUI tests for hidden rows, outstanding approvals,
fallback turn durations, and fresh Windows sandbox setup clocks.

GitOrigin-RevId: a77931e465d5aedd4a8cd606a3a3117d1bb37ce7
2026-08-31 21:19:22 +00:00
Owen Lin
5f79a92e39 Persist response token usage in rollout history (#41912)
## Why

Resumed threads need to continue per-turn and per-thread token totals without scanning arbitrarily far beyond the latest compaction checkpoint.

## What changed

- Add durable `TokenUsageRecord` rollout items with response, turn, thread, session, and root-turn attribution.
- Restore accumulated usage on resume and snapshot the latest record plus the compaction response ID in compaction checkpoints.
- Preserve root-turn lineage in persisted turn context, while ensuring forked child threads start with their own usage totals.

## Testing

- Cover usage accumulation across multiple responses and resumed turns.
- Cover local and remote compaction checkpoints, invalid remote compaction output, rollout reconstruction, and fork isolation.

GitOrigin-RevId: ef9e0c4a9102a08a2c382be4cdac68c84353c90a
2026-08-31 21:15:38 +00:00
Eric Traut
a7913390f7 Preserve TUI drafts after app-server disconnects (#41911)
## Why

Losing an external app-server connection can leave a submission's outcome uncertain. The TUI must preserve local work without retrying it or allowing stale server events to trigger more actions.

## What changed

- Enter an offline state when an external app-server transport disconnects during startup, event streaming, or submission.
- Keep conversation drafts, queued input, expanded pastes, attachments, and agent-overview input editable while blocking submissions, remote actions, and automatic queue replay.
- Show a connection-lost notice that directs users to copy their work and relaunch, while retaining `Ctrl-C` and an empty-composer `Ctrl-D` as quit shortcuts.
- Cancel pending views and asynchronous work, and ignore stale completions after the disconnect. Embedded app-server behavior is unchanged.

## Testing

Added unit, snapshot, and pseudo-terminal coverage for lost startup and mutation replies, offline draft editing, queued-input recovery, stale-event quarantine, agent-overview behavior, and end-to-end preservation without reconnection or resubmission.

GitOrigin-RevId: 7219a95fad676dda447d625db9e465345b469d58
2026-08-31 21:00:25 +00:00