Commit Graph

9386 Commits

Author SHA1 Message Date
Owen Lin
d132b69219 Deprecate full-history hydration for paginated threads (#40676)
## Why

Paginated thread history should be loaded incrementally through
`thread/turns/list` and `thread/items/list` instead of being fully reconstructed
in `thread.turns`.

## What changed

- Emit `deprecationNotice` when `thread/read`, `thread/resume`, or `thread/fork`
  requests full history for a paginated thread.
- Direct clients to omit `includeTurns` for reads or use `excludeTurns: true` for
  resumes and forks, then page history through the list APIs.
- Document the deprecation in the protocol schemas and app-server README.

## Testing

- Cover notices for paginated reads, cold and loaded resumes, and forks.
- Verify metadata-only requests, legacy threads, and rejected forks do not emit
  the notice.

GitOrigin-RevId: 0d387b46d73608f90b7960120a54af4ef332e510
2026-08-25 19:06:42 +00:00
Owen Lin
5cb7a35de9 Promote paginated thread history APIs (#40673)
## What changed

- Make `thread/turns/list`, `thread/items/list`, and `thread/revert` available
  without the experimental API capability.
- Stabilize `thread/reverted`, `thread.historyMode`, and the pagination fields
  used by `thread/resume` and `thread/fork`.
- Publish the promoted requests, responses, and fields in the stable JSON and
  TypeScript schemas, and update the app-server documentation accordingly.

GitOrigin-RevId: 18b8c53c265211597bb1a62fd62f66f4a3df5f06
2026-08-25 19:03:27 +00:00
chess
7e1ee6df6c Reuse private desktops across Windows sandbox commands (#40672)
## Why

Private desktops need to remain available across command-runner exits and idle
gaps.

## What changed

- Keep parent-owned private desktops alive and reuse them only when the sandbox
  account and effective permissions match.
- Pass the selected desktop name to elevated command runners, which validate and
  open the existing desktop instead of creating their own.
- Apply the same policy-aware reuse to the legacy Windows sandbox path.

## Testing

Add Windows tests for desktop-name validation, lifetime and concurrent reuse,
and separation when effective permissions differ.

GitOrigin-RevId: 2df8b1c31ff22d72549f2ec3065cd80ea1dd0c6a
2026-08-25 18:41:03 +00:00
Eric Traut
731d969d03 Clarify session exit messages (#40670)
## What changed

- Report `Session archived: <thread-id>` after successfully archiving the current session.
- Show the session ID when no resume hint is available, including for non-fatal exits.
- Keep deleted-thread exits distinct from successful archive exits.

## Testing

- Add coverage for archive lifecycle handling and exit-message formatting.

GitOrigin-RevId: 1812374e4c74fa1b3f11feb323de18a9dbff745b
2026-08-25 18:27:42 +00:00
pakrym-oai
afb797cae6 Enable content item kinds by default (#40669)
## What changed

Mark `content_item_kinds` as stable and enable it by default. Remove the
test harness override that previously enabled the feature explicitly.

GitOrigin-RevId: 86b0c3f295c4de3b8900981bfdd8830f275073f5
2026-08-25 18:19:25 +00:00
Owen Lin
45288d994d Start rollout migration after runtime feature enablement (#40668)
## Why

App-server clients can enable `background_paginated_rollout_migration` after the server has started, so the startup-only migration path does not handle that transition.

## What changed

- Allow runtime enablement of `background_paginated_rollout_migration`.
- Start the local rollout migration when the feature transitions from disabled to enabled at runtime.

## Testing

Update the app-server integration test to enable migration through the runtime feature API, wait for paginated history, and verify that cold resume preserves model context.

GitOrigin-RevId: d695624a03b4f056be94fcaac2075f91896f19e5
2026-08-25 18:14:32 +00:00
pakrym-oai
538900ee76 Add turn trigger metadata (#40665)
## What changed

- Add an optional `turnTrigger` field to app-server `turn/start` requests and
  expose it in the generated protocol schemas.
- Propagate non-empty trigger values to Responses request metadata as the
  reserved `turn_trigger` field, while preserving the original value when a
  request steers an active turn.
- Classify turns started by queue dispatch, goal continuation, retry recovery,
  and realtime handoff.

## Testing

- Cover HTTP and WebSocket metadata forwarding, steering behavior, reserved
  metadata handling, and the built-in trigger classifications.

GitOrigin-RevId: c12fe2c522286db21b76081ae6154fbf6bfb3639
2026-08-25 18:11:04 +00:00
iceweasel-oai
ba9567daf3 Propagate temporary directories into sandbox policy contexts (#40660)
## Why

Filesystem policies containing `:tmpdir` need executor-local directory bindings,
including when execution occurs in a remote environment.

## What changed

- Cache temporary directories reported by remote executors and discover the
  equivalent directories for local environments.
- Preserve the cached directories across inherited environment selection and
  include them in `FileSystemSandboxContext`.
- Add `FileSystemSandboxPolicyContext` and a context accessor so filesystem
  policy entries can be resolved with the executor-owned current directory,
  workspace roots, and temporary directories.

## Testing

Extend environment-selection tests to cover local, remote, and inherited
temporary-directory policy context.

GitOrigin-RevId: 36335af3465c529f024bf69293af288803dd582d
2026-08-25 18:04:01 +00:00
Adam Perry @ OpenAI
2f4b105514 Prevent telemetry exporters from feeding back into themselves (#40658)
## Why

Telemetry transport and storage can emit their own diagnostics, causing exports
or SQLite writes to recursively generate more telemetry.

## What changed

- Exclude `h2` spans from trace export so OTLP transport activity cannot trigger
  additional OTLP exports.
- Exclude all `sqlx`, `sqlx_core`, and `sqlx_sqlite` diagnostics from the SQLite
  log sink, including when no external subscriber filter is installed.
- Keep similarly named targets such as `sqlx_application` eligible for storage.

## Testing

- Extend the SQLite log-filter test to cover the broader SQLx exclusion and the
  unrelated-target case.

GitOrigin-RevId: 13a832e1f228e9564a31cc08f00add286342bac1
2026-08-25 17:59:32 +00:00
joeflorencio-openai
9695e71519 Add turn-scoped settings updates to the app server (#40656)
## What changed

- Add the experimental `turn/settings/update` method for changing `model`,
  `effort`, `summary`, and `serviceTier` on a specific live turn without
  changing future turns.
- Report whether the update was applied or the target turn was unavailable,
  and reject unsupported fields, disabled feature use, unsafe model changes,
  and direct updates to parent-owned subagents.
- Document the method's feature requirements, null handling, and limits.

## Testing

- Cover current-turn and future-turn isolation, rejected and unavailable
  targets, feature and capability gates, saved threads, and subagent ownership.

GitOrigin-RevId: 18440f6d7ee5fcd06ae23bd41b22c492b62bb2b5
2026-08-25 17:55:50 +00:00
joeflorencio-openai
a10c8127f7 Add live turn settings updates (#40653)
## What changed

- Add a feature-gated `TurnSettings` operation that can update the model,
  reasoning effort, reasoning summary, and service tier for subsequent steps of
  a named running turn without changing future thread settings.
- Report whether an update was applied, rejected, or lost its live target.
- Revalidate managed constraints and preserve the turn's admitted approval and
  Guardian safety properties before publishing an updated settings snapshot.

## Testing

- Cover sparse updates, step capture and ordering, target replacement, managed
  policy changes, model metadata safety, and separation from future settings.

GitOrigin-RevId: ecaaaa95b4fd4ec9d62265bef551582dddb36d78
2026-08-25 17:44:50 +00:00
joeflorencio-openai
68301fa45f Snapshot resolved settings for each model step (#40651)
## Why

Thread settings can change while a turn is running, and delegated review or
compaction steps can select a different model. Each request needs a consistent
set of settings resolved against the model that will execute it.

## What changed

- Capture immutable resolved settings for each model step, including model
  metadata, reasoning options, service tier, approvals, and personality.
- Keep in-flight steps on their captured settings while applying thread updates
  to subsequent work.
- Resolve inherited reasoning summaries and filter service tiers against the
  selected model and feature configuration for review and compaction steps.

## Testing

Added coverage for settings updates during paused turns, model changes,
previous-model compaction, review-model defaults, and service-tier filtering.

GitOrigin-RevId: fca4b3b305379f1bf26a5cac75ee0dd1747ac1f6
2026-08-25 17:41:22 +00:00
joeflorencio-openai
ba6cf9c692 Make automatic turn admission atomic with settings updates (#40648)
## Why

Turn settings can change after an input request previews its overrides. Automatic idle work could therefore make a Plan-mode admission decision from stale settings or apply a sparse override built from an outdated collaboration mode.

## What changed

- Evaluate automatic turn admission against both the current and proposed configuration under the settings publication lock.
- Reject automatic work that would enter or leave Plan mode without committing settings or triggering runtime configuration effects.
- Keep model and reasoning-effort overrides sparse until they are merged with the configuration being committed.
- Continue allowing explicit user and recovery turns to make valid mode transitions.

## Testing

Add coverage for concurrent settings changes, sparse model and effort updates, commit-time constraint validation, atomic Plan-mode rejection, and subsequent explicit user submission.

GitOrigin-RevId: 234f06de116bdce7c3a3fb5cac3d15583304a253
2026-08-25 17:30:45 +00:00
joeflorencio-openai
1d64085e67 Validate step settings against proposed permissions (#40647)
## Why

Model requirements must be evaluated against the permissions that will apply
after a settings update. Validating against the current profile can reject a
valid model-and-permission update or allow a later permission-only update to
invalidate the selected model.

## What changed

- Group model, reasoning, service-tier, personality, and approval inputs into
  `StepSettings`, with a single apply-and-validate path.
- Apply permission and environment changes before validating step settings, so
  auto-review requirements use the proposed effective permissions.
- Revalidate existing step settings when permission or environment changes alter
  their constraints, and commit the update only when the complete candidate is
  valid.

## Testing

Added unit and integration coverage for atomic model/permission updates,
permission-only revalidation, environment-derived constraints, and both
standalone and turn-start settings operations.

GitOrigin-RevId: f50dfbd300484a09acc51ee4607278f300ca1cd9
2026-08-25 17:27:04 +00:00
joeflorencio-openai
4e883ce36e Keep settings operations bound to their committed snapshot (#40645)
## Why

Post-commit work can overlap with another settings write. Reading the session
again afterward could make a settings operation report or use the later state
instead of the state that it committed.

## What changed

- Return the committed configuration and `ThreadSettingsSnapshot` from session
  settings updates.
- Use that commit result when creating a turn and emitting
  `ThreadSettingsApplied`, while retaining current-state snapshots for
  synthesized fork history.
- Route turn-start updates through the shared settings update path.

## Testing

Add coverage for standalone and turn-start updates that pause after committing,
restore different settings concurrently, and verify that each operation keeps
its original configuration and notification snapshot.

GitOrigin-RevId: cee5be9536d2840170893e6eb0c64cd039fb0a96
2026-08-25 17:20:37 +00:00
Tamir Duberstein
a95391160a Drive TUI stream animation from the foreground loop (#40644)
## Why

Stream animation ticks generated on a background thread can accumulate while the
TUI is busy, causing stale ticks to run after the animation stops or the chat
widget is replaced.

## What changed

- Replace the animation thread and `CommitTick` app event with a Tokio interval
  owned by the foreground event loop.
- Delay missed ticks instead of replaying a burst, and let pending app events run
  before animation work.
- Drop the interval when animation stops or the chat widget is replaced, while
  preserving `CommitTick` session-log entries.

## Testing

Add a paused-time test covering stable pacing, missed ticks, restart behavior,
and chat-widget replacement.

GitOrigin-RevId: d0561d3f8962b5e05a728463e76aa8ec83cd5a31
2026-08-25 17:17:01 +00:00
stefanstokic-oai
a9e447a69d Migrate Claude commands without frontmatter (#40643)
## What changed

- Import supported Claude commands that lack a usable frontmatter description by deriving the skill description from the source command name.
- Preserve commands with explicit descriptions when multiple source paths normalize to the same skill name, and skip ambiguous fallback-only collisions.
- Apply the expanded detection and import behavior to both user-level and repository-level command directories.

## Testing

- Add service tests for commands without frontmatter, normalized-name collisions, unsupported templates, and post-import detection.

GitOrigin-RevId: 53691193128a6b1be192c4f83bdf563980a0e55d
2026-08-25 17:13:50 +00:00
Won Park
da4cf1cdea Preserve Windows proxy settings in Guardian sessions (#40641)
## Why

Guardian sessions can run alongside another Windows sandbox launch and should not reconcile the persistent proxy settings established by that launch.

## What changed

- Start internal Guardian sessions with `WindowsSandboxProxySettingsMode::Preserve`.
- Continue using `Reconcile` for other sessions.

## Testing

Added a thread manager test that verifies a parent session reconciles proxy settings while its internal Guardian session preserves them.

GitOrigin-RevId: c6a31637ecdf828548cfd7153da7e9405abe34fa
2026-08-25 16:53:47 +00:00
hefuc-oai
5ce04789fb Honor managed plugin disablement for executor capabilities (#40640)
## Why

Selected executor plugin roots could still expose capabilities when managed
requirements disabled the `plugins` feature.

## What changed

- Suppress MCP servers, skills, apps, and connectors from selected executor
  plugins when `plugins` is disabled, while preserving the selected-root
  identity used to filter those capabilities.
- Apply the policy consistently to direct selected-root discovery and batched
  executor capability discovery.

## Testing

- Add contributor-level and app-server coverage that verifies disabled plugin
  capabilities are absent and their MCP servers never start.

GitOrigin-RevId: e30bd8a936c4b0e083908b89a65f4d02e01747de
2026-08-25 16:47:13 +00:00
Abhinav
e44bd9b64d Retry timed-out cloud config loads in the background (#40637)
## Why

A startup timeout leaves the cloud config loader with a cached error, while the
normal background refresh interval delays recovery for 15 minutes.

## What changed

- Retry timed-out cloud config bundle loads after 5 seconds through the existing
  background worker.
- Keep serving the cached snapshot to concurrent readers instead of triggering
  additional fetches.
- Restore the normal 15-minute refresh interval after a successful retry or a
  non-timeout error.

## Testing

Added paused-time tests covering repeated startup timeouts, successful recovery,
application of the recovered bundle to later config loads, and restoration of
the normal refresh interval after both success and validation failure.

GitOrigin-RevId: da62abbae9be7f40af61f4c4adaf4ea5c337ec88
2026-08-25 16:38:46 +00:00
Tamir Duberstein
20c3f9733f Restart pending MCP connections when startup timeout changes (#40636)
## Why

Reusing an MCP connection that is still starting after its
`startup_timeout_sec` changes leaves the old startup budget in effect.

## What changed

- Track the effective startup timeout on each MCP connection.
- Reuse a pending startup only when its timeout still matches the current
  configuration.
- Continue reusing ready connections when only the startup timeout changes.

## Testing

Added integration coverage that refreshes the timeout while one server is
still initializing and another is ready, verifying that only the pending
startup is replaced.

GitOrigin-RevId: 5ed71a57d3bf0dd6e227aacd16acd3a35bc37ecf
2026-08-25 16:20:38 +00:00
Tamir Duberstein
f5853cbe90 Reconnect MCP servers when authentication mode changes (#40634)
## What changed

- Include the configured authentication mode in the MCP connection identity so
  runtime reconciliation replaces connections instead of reusing them after an
  authentication-mode change.
- Add a regression test covering a switch from OAuth to ChatGPT authentication
  for an executor-owned MCP server.

GitOrigin-RevId: 18cd9df62a9a5ee44594dcde6a844ad7d5e67ee2
2026-08-25 16:14:26 +00:00
Alex Zamoshchin
304c8de4c6 Allow extensions to skip host skill discovery (#40631)
## What changed

- Add the under-development `skip_host_skill_discovery` feature to bypass host
  skill snapshots during session warmup and turn setup.
- Let skill invocation contributors declare whether they require host-owned
  skills. Preserve host discovery when no contributors are registered or any
  contributor requires it.
- Keep executor and orchestrator skill catalogs and instruction loading
  available when host discovery is skipped.

## Testing

- Cover executor-only, orchestrator, mixed-contributor, and legacy host-skill
  behavior.

GitOrigin-RevId: 48169403090b234e1a304c6523633fd867df454a
2026-08-25 16:00:02 +00:00
Eric Traut
a63cb33e8d Show reconnect guidance when disconnecting from tasks (#40629)
## Why

Exiting a TUI connected to a persistent app server can leave work running, so
the existing session-exit summary does not explain how to reconnect or stop the
active turn.

## What changed

- Distinguish disconnects, interrupted turns, and removed threads when building
  exit summaries.
- For daemon and remote sessions, report whether work may still be running and
  print commands to reconnect or stop the current turn.
- Sanitize remote WebSocket addresses in displayed commands and preserve the
  configured remote authentication environment-variable option.
- Keep the existing token-usage and resume summary for embedded sessions.

## Testing

Add coverage for daemon, remote, interrupted, embedded, archived, and deleted
session exits, including credential sanitization.

GitOrigin-RevId: 9cbbf9c7dd36423a5ed99909a2b4cb32e3e87712
2026-08-25 15:55:35 +00:00
Eric Traut
0cdb1f1c83 Harden goal continuation and remove duplicate prompt helpers (#40628)
## What changed

- Teach goal continuations to distinguish concrete progress, verified waits on live handles, and turns that made no progress.
- Re-poll live work after observation timeouts instead of treating the work as terminal or restarting it, and carry equivalent blockers through the existing blocked audit.
- Remove the duplicate goal prompt renderers and templates from `codex-prompts`; goal steering remains owned by the goal extension.

GitOrigin-RevId: 4ec64721164743e879ae946a2dd024bba5869fbe
2026-08-25 15:50:19 +00:00
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