Commit Graph

5081 Commits

Author SHA1 Message Date
Benjamin Carlsson
5a0419edb5 Add Vim replace mode to the TUI composer (#42194)
## What changed

- Add Vim Replace mode, entered with `R`, which overwrites graphemes and appends at the end of a line.
- Restore overwritten text with Backspace and record replace edits for undo and dot-repeat.
- Preserve composer behavior for attachments, completions, paste bursts, history previews, and external editor imports while replacing text.
- Expose `vim_normal.enter_replace_mode` in the configurable TUI keymap.

## Testing

- Add coverage for grapheme replacement, Backspace recovery, dot-repeat, custom bindings, atomic attachments, completions, paste handling, and history interactions.

GitOrigin-RevId: cb04e3adcce013c1eb7b82c994b00e944310c481
2026-09-02 03:35:41 +00:00
rka-oai
2c79ee6dac Add structured asynchronous user input requests (#42178)
## What changed

- Replace `send_user_message_async` with `request_user_input_async`, accepting one or more questions with optional suggested answers while allowing the turn to continue.
- Attach structured question metadata to asynchronous agent messages while retaining readable fallback text, and preserve it through app-server events, thread history, and generated schemas.
- Continue enabling the new tool for model catalogs that advertise either the old or new tool name.

## Testing

- Cover tool registration, question validation, emitted items, continued turn execution, history preservation, and backwards-compatible deserialization.

GitOrigin-RevId: ffc49aebde2e854c3c50a122aa52805fec3fc6b3
2026-09-02 02:09:35 +00:00
ningyi-oai
12ed76b09b Record result sources in app tool analytics (#42164)
## What changed

- Add per-tool `analytics_result_source` requirements, with support for the
  `detailed_message_search_v1` format and normal configuration precedence.
- Attach host-generated source IDs from accepted app tool results to recorded
  executed tool calls for both direct and Code Mode invocations.
- Bound and deduplicate source metadata, reject caller-supplied values, and
  shed optional source data before dropping tool-call or completion metadata.
- Preserve source updates across waits and retries while preventing stale or
  compacted records from overwriting accepted metadata.

## Testing

Add coverage for requirement parsing and merging, trusted source snapshots,
metadata budgets, retries, waits, and compaction.

GitOrigin-RevId: 7d5e394219eb33e0ab7b6db3f039138a78569d17
2026-09-02 01:06:18 +00:00
jif
e576993911 Skip Guardian reviews in Full Access (#42147)
## Why

Full Access already combines `approvalPolicy: "never"` with unrestricted
permissions, so confirmation-only actions do not require a model review.

## What changed

- Detect Full Access consistently across the thread and every selected
  environment. Pending, failed, or restricted environments are not treated as
  Full Access.
- Approve confirmation-only Guardian and MCP requests without synchronous
  review, sampler prewarming, or background scoring. Cancellation, explicit
  denials, and forms that require user input keep their existing behavior.
- Re-evaluate the active permission state on each turn so an existing thread
  can enter or leave Full Access safely.

## Testing

Added coverage for switching approval modes, strict sensitive MCP
confirmations, failed and pending environments, and suppression of Guardian
requests and background-scoring connections.

GitOrigin-RevId: 089ab4296dde473b8e33ab8324be79c5446c46f6
2026-09-01 22:16:54 +00:00
iceweasel-oai
cd8bd62c6e Resolve permission requests in the executor context (#42146)
## Why

`request_permissions` paths and grants need to be evaluated against the selected executor environment, including its path convention, home directory, workspace roots, and temporary directories.

## What changed

- Resolve relative and home-relative permission paths using the executor context, reject mismatched path conventions and lossy paths, and support legacy `read` and `write` path lists.
- Move grant intersection into core so requested and granted permissions use the originating environment's sandbox context. Preserve deny entries conservatively when a special path cannot be resolved.
- Keep the full originating environment with pending permission requests so delayed responses are normalized against the same context.

## Testing

- Cover POSIX, Windows, UNC, relative, and home-relative path resolution and invalid path contexts.
- Verify end-to-end app-server grants are limited to the requested workspace scope and unresolved temporary-directory denies are preserved.

GitOrigin-RevId: 730a2aacd391262e92a6314f3a5b6c262e3dca10
2026-09-01 22:08:08 +00:00
jif
86b7d12742 Add Guardian V2 analytics events (#42144)
## What changed

- Emit `codex_guardian_v2_classification` events with the outcome, risk
  level, duration, model, and thread attribution.
- Emit `codex_guardian_v2_fast_decision` events when Guardian V2 approves an
  action without a full review.
- Add `guardian_v2_enabled` to turn analytics, accounting for review scope
  and model requirements.

## Testing

- Extend the Guardian V2 app-server coverage to verify event payloads,
  attribution, enablement state, and scoped event emission.

GitOrigin-RevId: 0805975f8e8f9d954aa1058ea8c60545a090ae74
2026-09-01 22:02:42 +00:00
Benjamin Carlsson
b192442fc7 Add redo support to Vim composer history (#42140)
## What changed

- Add a bounded redo stack for complete composer drafts, including paste payloads and image attachments. `Ctrl+R` now reapplies the last undone edit in Vim normal mode, while new edits clear stale redo history.
- Add the configurable `vim_normal.redo` action to the keymap schema and picker. Preserve reverse prompt-history search in Vim insert mode and non-Vim mode, and honor explicitly configured bindings.
- Keep pending edit snapshots outside the shared undo/redo byte budget so canceled commands cannot evict committed history.

## Testing

- Cover grouped edits, Vim searches, direct draft changes, history limits, empty redo stacks, and custom or unbound shortcuts.

GitOrigin-RevId: 0cf5bb376ff865ddc0a77705dcb322ef6b57b3a3
2026-09-01 21:30:27 +00:00
jif
612e6491d5 Prewarm shell snapshots for eligible turns (#42137)
## Why

Shell Snapshot V2 previously captured the login-shell environment lazily when a
command started, adding that work to the command path.

## What changed

- Start one asynchronous snapshot capture after turn hooks accept the turn, so
  eligible local `exec_command` calls can reuse it without blocking the model.
- Use the turn's resolved tools, permissions, sandbox, environment, and shell
  configuration, and skip prewarming for unsupported or network-managed cases.
- Cancel outstanding prewarming during shutdown. Keep failed speculative
  captures retryable by real commands without consuming their retry budget.

## Testing

Added coverage for non-blocking capture and reuse, failure recovery, sandbox and
permission isolation, shutdown cancellation, hook-stopped turns, eligibility
gates, and concurrent capture retries.

GitOrigin-RevId: ff24a4f0328c06653e09d03fd0a3db1eccd65030
2026-09-01 21:16:12 +00:00
Alex Zamoshchin
a30fa3d830 Include app link metadata in MCP approval elicitations (#42134)
## What changed

- Preserve the selected app account `link_id` when building native MCP tool
  approval requests.
- Add `link_id` and `link_is_implicit` to the elicitation metadata, recognizing
  IDs with the reserved `implicit_link::` prefix as implicit links.

## Testing

- Extend the app link policy integration test to verify elicitation metadata
  for default, explicitly selected, and implicit account links.

GitOrigin-RevId: a76731d9f5f3640318187511ccdc0dc82967a9c5
2026-09-01 20:54:25 +00:00
Alex Zamoshchin
2393b5c920 Scope session MCP approvals to app account links (#42133)
## Why

Remembering an app tool approval by connector and tool alone could reuse an
approval when the same tool was called with a different selected account.

## What changed

Include the app `link_id` in MCP tool approval keys so remembered session
approvals apply only to the account link that was approved. Calls for another
link, or calls without a link selector, request their own approval.

## Testing

Add an integration test covering calls across two link IDs and the legacy
no-selector case.

GitOrigin-RevId: 7dd88330b75de312469020d5892dfb2fa5d5fada
2026-09-01 20:46:17 +00:00
Charlie Marsh
8436b749a4 Bound Git root discovery for metadata enrichment (#42132)
## Why

Git root discovery is optional metadata work, but filesystem probes can block. They should not exhaust Tokio's blocking pool, delay runtime shutdown, or prevent later turns from observing repository changes.

## What changed

- Add a shared `GitRootDiscovery` service that coalesces concurrent lookups for the same working directory and limits probes across directories.
- Run probes on detached threads, retain in-flight work across caller cancellation, and discard completed results instead of caching them.
- Use the service for turn and memory metadata enrichment, abort unused turn enrichment when its state is dropped, and limit memory metadata waits to one second.

## Testing

Add coverage for probe sharing, capacity limits, cancellation, fresh discovery, runtime shutdown, memory timeouts, and repositories restored after startup prewarming.

GitOrigin-RevId: bca46fc263e7a12a2f69146d8a0b3e7c7e0846cb
2026-09-01 20:41:32 +00:00
Matthew Zeng
bd89ce67cc Prepare MCP connections for coordinated OAuth refresh (#42128)
## What changed

- Add the under-development `mcp_oauth_refresh_coordination` feature and pin its selected refresh mode to each MCP connection.
- Treat the refresh mode as part of OAuth connection identity so runtime and MCP configuration refreshes reconnect when the mode changes.
- Keep legacy refresh behavior in builds where coordination is unavailable and emit a warning when coordinated mode is selected.

## Testing

- Cover connection replacement when the feature is toggled through both runtime and MCP configuration refresh paths.

GitOrigin-RevId: 89596150f0338e6ede0e712badecea4450831766
2026-09-01 20:26:57 +00:00
jif
9112564114 Allow updating the approval reviewer for active turns (#42121)
## What changed

- Add `approvalsReviewer` to the experimental `turn/settings/update` API.
- Apply reviewer changes to subsequently captured steps and new background approval requests while preserving pending approvals and future-thread defaults.
- Allow reviewer-only updates without `step_model_switching`, while continuing to enforce managed reviewer restrictions and model-required auto review.
- Use an explicit live reviewer update for MCP approvals while retaining refreshed thread defaults for clients that have not set one.

## Testing

- Cover switching between user and automatic review during a live turn, future-turn isolation, and managed-authority rejection.

GitOrigin-RevId: e1216b09c6a7972c2c9eaf4955d8d57d60604ca1
2026-09-01 19:19:52 +00:00
iceweasel-oai
1f4c47343a Apply remote platform semantics to exec safety checks (#42113)
## Why

Unified exec can run commands on an OS that differs from the Codex host. Using
host path and shell semantics for approval checks can therefore miss dangerous
Windows and PowerShell commands sent to a remote executor.

## What changed

- Thread the executor platform through command parsing, executable-name
  normalization, and dangerous-command classification. Legacy executors fall
  back to the host platform, while unknown reported platforms use Windows rules
  conservatively.
- Bound model-facing `exec_command` rejection messages and avoid echoing the
  rejected command into the error.
- Keep deterministic process IDs reserved after release so rejected test
  commands cannot reuse an earlier ID.

## Testing

- Add coverage that a long dangerous PowerShell command targeting a remote
  Windows executor is rejected with a bounded response.
- Verify deterministic process IDs advance after release.

GitOrigin-RevId: a26b4a63ea3d6df7140032b88b3e7aec0b85b948
2026-09-01 18:24:56 +00:00
teddywyly-oai
c7c824dce4 Treat bundled cleanup hooks as built-ins (#42110)
## What changed

- Centralize the allowlist for bundled MCP cleanup hooks and use it for both local and executor-discovered plugins, including `unified-computer-use` cleanup through `cua_repl`.
- Mark matching cleanup hooks as trusted built-ins so they run without saved hook trust and remain active when regular hooks or their per-hook state are disabled. Plugin enablement and managed-only policy still apply.
- Hide built-in cleanup hooks from hook listings and lifecycle notifications while retaining their metrics. Keep the built-in classification out of serialized protocol data.

## Testing

- Cover allowlist boundaries, trust and enablement behavior, inline and file-based hook declarations, MCP success and error responses, hook listing, lifecycle notifications, metrics, and protocol serialization.

GitOrigin-RevId: f93b7bc99f4ed9694f529def8ec383b45f31430e
2026-09-01 18:02:27 +00:00
Felipe Coury
8ea297ff60 Add a TUI setting to disable automatic recaps (#42101)
## What changed

- Add the `tui.auto_recap` configuration option, enabled by default.
- When disabled, cancel scheduled automatic recap checks, reject automatic
  requests, and discard pending automatic results without retrying.
- Keep manual `/recap` requests available regardless of the setting.

## Testing

- Cover configuration defaults and command-line overrides.
- Cover scheduling cancellation, pending request cleanup, discarded results,
  and manual recaps while automatic recaps are disabled.

GitOrigin-RevId: 7d5323f58a2c84e60683a25a8c77653097efe6e2
2026-09-01 17:09:13 +00:00
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
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
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
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
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
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
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
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
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
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
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
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
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
iceweasel-oai
b51b07785b Make permission transforms aware of executor path context (#41909)
## What changed

- Add context-aware normalization, materialization, and intersection helpers for additional filesystem permissions.
- Resolve project roots, home-relative deny globs, temporary directories, and filesystem roots from the executor's `FileSystemSandboxPolicyContext` while preserving URI path conventions and symlinked paths.
- Keep deny constraints when intersecting grants across POSIX, Windows, and UNC paths, and reject incompatible path conventions when executor context is available.

## Testing

- Cover cross-convention validation, empty temporary-directory contexts, home-relative deny globs, and rooted deny globs for POSIX, Windows, and UNC paths.

GitOrigin-RevId: 14fd866a17a0ac4a595aa4f0e2fb82bfae1a8838
2026-08-31 20:50:44 +00:00
Bryan Ashley
f88ff940c0 Load bounded context after empty wake turns (#41901)
## Why

Paginated threads can accumulate wake turns with no user-message boundary. The
reverse context scan could not use those turns as a bounded replay cutoff, even
when a compaction and its resume state provided everything needed to reconstruct
the latest model context.

## What changed

Treat a full world-state snapshot that survives the latest compaction as a
durable baseline when it is paired with a compatible turn context. This lets the
scan stop at empty wake turns while still scanning further back for patches,
snapshots before compaction, or missing and mismatched turn contexts.

## Testing

Add coverage for repeated empty wake turns and verify that bounded replay
matches full rollout reconstruction across successive compaction windows.

GitOrigin-RevId: ae90c5f939c660ea539fbfc11128cc7259efaa9c
2026-08-31 19:30:05 +00:00
felixxia-oai
032d15cba7 Use shared transcript collection for Guardian reviews (#41870)
## What changed

- Build Guardian review transcripts with `codex-guardian-context` while preserving Guardian-specific filtering and transcript budgets.
- Apply per-entry truncation during collection, including the larger limit for Node REPL output.
- Retain standalone function and custom tool outputs even when their matching calls are unavailable.

## Testing

- Update Guardian transcript tests to cover shared entry types, Node REPL truncation limits, standalone tool outputs, and recent-tool retention.

GitOrigin-RevId: ec73e80c09fe63c3cf100684cb15574d5d6c2c95
2026-08-31 15:56:32 +00:00