Commit Graph
11566 Commits
Author SHA1 Message Date
Eric Traut c248f6d48b Fix model provider lookup for TUI history (#49171)
Read `model_provider` from the effective configuration's nested `config`
field in `history_model_provider`, retaining the `openai` fallback.

GitOrigin-RevId: 06a8b3da1b499e673f80b8827951020c469c3970
2026-09-29 05:10:13 +00:00
Eric Traut fbc169827e Suppress Windows console windows for background subprocesses (#49164)
## Why

Background helpers launched from a detached Windows process can allocate console windows. Job Object launches and containment fallbacks need to preserve console suppression as well.

## What changed

- Add `codex_utils_process::background_command` to set `CREATE_NO_WINDOW` on Windows, and use it across background subprocess launches, including Git, plugins, authentication, diagnostics, and sandbox helpers.
- Centralize console suppression in Job Object launches. Keep `CREATE_NO_WINDOW` when retrying without containment, and clear `CREATE_SUSPENDED` so the fallback child can run.
- Preserve console inheritance for interactive shell launches and interactive AWS authentication refreshes.

## Testing

Add Windows regression tests covering console-free launches from detached parents through standard and Tokio commands, stdout/stderr capture, successful containment, Job Object creation and assignment failures, and sandbox setup refresh helpers.

GitOrigin-RevId: b2c238fa7d4f9fbd868e5adf7d4be9958ff01e6c
2026-09-29 04:38:37 +00:00
Eric Traut 3226512d47 Honor app-server provider defaults in the TUI (#49161)
## Why

Client provider defaults can override the app server's configured provider and hide its sessions from resume and fork history.

## What changed

- Omit implicit provider overrides from thread start, resume, and fork requests so the server can resolve its defaults.
- Use the server's effective provider for named history lookup, `--last`, and resume and fork pickers, while honoring explicit CLI and selected-profile choices.
- Respect managed provider requirements when resolving history filters and preserve the active session's provider when forking it.

## Testing

Add app-server regression tests for provider defaults, explicit choices, configuration changes, selected profiles, and managed requirements. Add CLI coverage for resume and fork pickers and `--last` with local daemon and embedded servers, plus a picker rendering snapshot.

GitOrigin-RevId: a077758b13a5e55552b52e5532ad4bebe86dce7e
2026-09-29 04:17:32 +00:00
Eric Traut 0d7b8117d3 Support projectless TUI sessions with workspace defaults (#49160)
## What changed

- Skip folder trust prompts for locally discovered projectless directories without a saved trust decision. Apply workspace-write permissions and granular approval defaults only when local execution, configuration, and managed policy allow them.
- Prompt for Windows sandbox setup when needed before enabling implicit workspace-write permissions.
- Restore saved task permissions on resume unless explicitly overridden, and keep ordinary turns from overwriting the server's saved permission profile. Track explicit approval reviewer choices separately from restored permissions.
- Let `/cd` request folder trust with a “Keep current directory” option. Recheck task activity and background terminals before switching, and enforce destination permission requirements.

## Testing

Add regression coverage for projectless defaults and session transitions, explicit permission overrides, saved profile preservation, trust discovery, destination policy conflicts, and the directory consent and Windows sandbox prompts.

GitOrigin-RevId: cf74f5a90245f2aee96caa80d76de64da6ec1ebd
2026-09-29 04:13:14 +00:00
Benjamin Carlsson c6c7c8d270 Omit blockquote markers when copying quoted selections in the TUI (#49153)
## Why

Copying text selected within a blockquote adds Markdown quote markers that are not part of the selected content.

## What changed

Return plain text for selections containing only quoted content, preserving literal `>` characters and selected whitespace. For quoted tables and task lists, remove quote prefixes while retaining table reconstruction and checkbox states. Selections spanning quoted and unquoted content continue to preserve Markdown structure.

Preserve the existing logical source when marking list separator lines as omitted from Markdown copying.

## Testing

Add coverage for partial and nested blockquote selections, quoted tables and task lists at narrow and wide widths and after rewrapping, and copying a mouse-selected blockquote.

GitOrigin-RevId: 5ac0c8c47a77937e5a35c376d8908065217ad2dc
2026-09-29 03:49:47 +00:00
akira-oai 3a16c0b707 Simplify cloud task base URL normalization (#49147)
Replace the trailing-slash removal loop in `normalize_base_url` with
`trim_end_matches('/')`, preserving existing behavior.

Add regression coverage for unchanged URLs, single and repeated trailing
slashes, empty and slash-only inputs, and ChatGPT URLs with and without
`/backend-api`.

GitOrigin-RevId: db71e80c4dcaac33b308a45684b14e7edbd71528
2026-09-29 03:32:19 +00:00
Eric Traut 8d48f71922 Hide reasoning summary settings in /status for server connections (#49145)
## What changed

Omit the reasoning summaries setting from the model details when connected to a remote server or local background server. Continue displaying it when no server connection is present.

## Testing

Expand status snapshots to cover no server connection, a remote server, and a local background server, including the reasoning summary setting visibility in each case.

GitOrigin-RevId: f7213e7ad7439107705461ccf4e070501729113b
2026-09-29 03:24:14 +00:00
Eric Traut ff3c82c8a9 Preserve server reasoning summary and verbosity settings in the TUI (#49144)
## Why

Forwarding local defaults as request overrides can replace server defaults or saved thread settings for reasoning summaries and verbosity.

## What changed

Only forward `model_reasoning_summary` and `model_verbosity` as shared thread request overrides when their winning configuration layer is a session flag or an explicitly selected user profile. Use the effective values from that layer, and omit values whose winning source is ordinary user or project configuration. Preserve the existing reasoning-summary defaults for new embedded threads.

## Testing

Add coverage for profile, project, and CLI precedence. Extend outbound model request tests to verify that remote-mode thread start and resume preserve server reasoning summary and verbosity settings despite conflicting local values.

GitOrigin-RevId: 5e14254a51ed7506118a46847bb7466ab58908ef
2026-09-29 03:23:49 +00:00
Bryan Ashley f53f5a6fed Expose original error details to turn lifecycle contributors (#49138)
## Why

Turn error hooks receive only a `CodexErrorInfo` category, which omits backend metadata such as usage-limit reset times and rate-limit snapshots.

## What changed

Add borrowed `CodexErrorDetails` to `TurnErrorInput` and pass the original details through turn and compaction error notifications, alongside the existing error category.

## Testing

Add coverage for usage-limit metadata during sampling, manual compaction, and post-turn compaction, including preservation of completed answers and existing error events. Extend lifecycle tests to verify that an `InvalidImageRequest` retains its details when surfaced as `BadRequest`.

GitOrigin-RevId: 6f2058992126da0f69508ef51998e7581557deea
2026-09-29 02:40:51 +00:00
Benjamin Carlsson d7f7fa4106 Remove the plus separator after Option symbols in TUI key hints (#49136)
## What changed

Render macOS Option shortcuts as `⌥t` and `ctrl+⌥t` instead of `⌥+t` and `ctrl+⌥+t`. Keep `+` separators after text modifier labels such as `ctrl`, `shift`, and `alt`.

## Testing

Update key-label and chord assertions and UI snapshots to expect the compact labels across shortcut help, navigation hints, and tooltips.

GitOrigin-RevId: 7d52088ebce3dfa3f8bdad65eb159ca0fead8a31
2026-09-29 02:37:23 +00:00
andrewgu-oai 458f7046a5 Treat explicit provider model catalogs as authoritative (#49135)
## Why

Providers with `model_catalog_url` could advertise bundled models absent from their catalog or reuse stale models after a failed refresh. Model metadata could also match by prefix or namespaced suffix instead of the provider's exact model ID.

## What changed

- Suppress bundled model fallback and merging for explicit provider catalogs, including when discovery is disabled.
- Require unique, non-empty catalog slugs and match metadata by exact model ID.
- Serialize explicit catalog refreshes and invalidate in-memory and persisted catalog entries after fetch failures, preventing stale cache reuse.
- Report a clear configuration error when startup has no available model, while allowing an explicitly configured `model`.

## Testing

Add regression coverage for exact model matching, hidden catalog entries, cache invalidation across restart and recovery, invalid slugs, and empty-catalog startup with and without an explicit model. Update app-server model-list expectations and verify the TUI configuration error.

GitOrigin-RevId: ac323a94178e3c48df8d4a159a86fdbac20b03a2
2026-09-29 02:33:55 +00:00
Won Park a9118edae8 Move content-filter guidance into the shared Responses retry handler (#49130)
## What changed

Move content-filter guidance recording from the sampling loop into
`handle_response_stream_error`. Pass `StepContext` so the handler can resolve
model-specific guidance and record it before retry decisions for sampling
requests. Keep remote compaction excluded from guidance recording and update
callers and the existing retry-deadline test to use the new signature.

GitOrigin-RevId: 030bde1d4f1597fc4f3971ad837478e5304c5aa9
2026-09-29 02:05:56 +00:00
Anthony Tafoya 13f580ef09 Deduplicate cloud and executor skill listings before budgeting (#49127)
## Why

Skills available from both cloud and executor providers consume duplicate catalog space, leaving less room for descriptions of unique skills.

## What changed

- Prefer model-visible cloud skills over executor listings with the same `plugin:skill` name before allocating the metadata budget.
- Preserve aliases from the full visible executor inventory so filtering duplicates does not renumber remaining packages. Continue choosing full locators when they fit the budget better.
- Keep executor packages available through `skills.list` and `skills.read`, and retain executor listings when cloud skills are disabled.

## Testing

Add regression tests and a model-request snapshot covering description retention, stable aliases across turns, executor availability changes, package reads, and full-locator selection after deduplication.

GitOrigin-RevId: 477e4cf16b8968dbe61438dd5af1eca9cbfa78c8
2026-09-29 01:57:57 +00:00
Won Park 8bd5a136ff Add recovery guidance to content-filter retries (#49119)
## Why

Responses stopped by `content_filter` previously followed generic stream-error retry handling without guidance about the block. Retried requests need instructions to explain the limitation and offer a permitted alternative.

## What changed

- Recognize content-filter failures as a distinct error while preserving retryability and the existing public error representation.
- Append developer guidance to the conversation after each sampling block, retaining delivered output and using the existing retry handling.
- Support a model catalog override through `model_messages.content_filter_guidance`. Missing, null, blank, or values exceeding 512 UTF-8 bytes fall back to bundled guidance.
- The bundled guidance tells the model to avoid reproducing or working around blocked content, briefly explain the limitation, offer a permitted alternative, and continue unrelated authorized work.

## Testing

Add a scenario and request-history snapshot covering repeated blocks, catalog guidance on each retry, retained partial output, and eventual completion. Add error-mapping assertions for retryability, public error classification, and error text.

GitOrigin-RevId: ba0c201b3a5a3acf5cfa971332027240e0690225
2026-09-29 01:14:41 +00:00
Celia Chen 6c49240565 Correct provider authentication storage documentation (#49118)
Clarify in the `requires_openai_auth` field documentation and configuration schema that credentials use the backend selected by `cli_auth_credentials_store`, rather than always being stored in `auth.json`. Also clarify that `env_key` specifies the environment variable containing the API key.

GitOrigin-RevId: e65753a72258e43b24c4e40b51ff26830c5b3756
2026-09-29 01:01:34 +00:00
papayo-oai 2e6cc4ed8d Attribute analytics requests to each thread's product SKU (#49117)
## Why

Sessions can share an analytics client while using different product SKUs. Analytics requests need per-thread attribution to reflect each session's configuration.

## What changed

- Register each thread's `apps_mcp_product_sku` and send `X-OpenAI-Product-Sku` on analytics requests grouped by product, without changing authentication.
- Send product groups concurrently while preserving event order within each group.
- Flush buffered tool events before changing or evicting their product attribution, and clear attribution when a session disables analytics.
- Bound retained thread registrations and concurrent product groups. Drop attribution when registration cannot be queued or a batch exceeds the product-group limit.

## Testing

Add tests for shared-session attribution, clearing attribution on resume with analytics disabled, buffered events across product changes, queue overflow recovery, registry limits, and concurrent delivery with preserved event order.

GitOrigin-RevId: 25a98788cd44d4a85f97ee87aadf3a6909607f6a
2026-09-29 00:49:23 +00:00
oli-oai 69043f05c4 Point remote compaction tests at the mock ChatGPT server (#49114)
Set `chatgpt_base_url` to the supplied mock server URI in
`make_remote_compaction_session`.

GitOrigin-RevId: de5c6e208fd104cbe07a8873e7e33c108dac7a57
2026-09-29 00:43:03 +00:00
Felipe Coury 0196495288 Add X11 primary selection and middle-click paste support (#49112)
## What changed

- Publish released mouse selections from both transcript views to X11 `PRIMARY` as plain text, even when copy-on-select is disabled. Preserve configured `CLIPBOARD` copying when it is enabled.
- Paste `PRIMARY` into the editable fullscreen composer on middle-click, including while a transcript selection remains active.
- Limit support to local Linux X11 sessions, excluding Wayland, SSH, tmux, WSL, and VS Code terminals.
- Retain the latest deferred selection publication and order it before a pending `PRIMARY` read, while giving explicit copies priority. Cancel stale deferred work when its selection or paste target is invalidated.
- Clarify that scrollback mode uses native terminal copy, paste, and scrollback.

## Testing

Add regression tests for selection publication with copy-on-select enabled and disabled, publication-before-read ordering, explicit-copy priority, cancellation of deferred work, and middle-click paste invalidation.

GitOrigin-RevId: 6ba7bddffda60183b7f9ad5cd69a97da8a4a8dcd
2026-09-29 00:40:54 +00:00
Benjamin Carlsson 8f6517772b Add history pagination to the agent command center (#49106)
## Why

The command center seeded only ten recent sessions, with no way to browse older history from the task list.

## What changed

- Add a keyboard-selectable “Show more” row that discovers up to ten more tasks, with loading and retry states that remain accessible during search.
- Retain per-source cursors and buffered rows across requests, merging interactive and non-interactive history by recency without discarding existing tasks on failure.
- Refill vacancies after tasks are archived or deleted, and prevent stale refreshes from restoring removed tasks.
- Limit routine detail refreshes to recent and loaded tasks, plus explicitly targeted threads, as retained history grows.

## Testing

Add regression coverage for pagination across mixed sources, cursor retries without row loss, automatic refill, queued pagination, and “Show more” navigation, loading, search, and retry rendering.

GitOrigin-RevId: 0bfcc970c9adf0c8d509b275a92ecf01c29595ad
2026-09-29 00:18:20 +00:00
Eric Traut 136391a23e Resume unsent TUI input after reconnecting (#49105)
## Why

Reconnecting paused all recovered input, including queued messages that had never been sent. Those messages can resume automatically once any uncertain submissions are resolved.

## What changed

- Track unsent and unconfirmed messages separately. Reconcile submitted prompts and steers using exact client message IDs from restored history, buffered events, and later receipts.
- Remove confirmed submissions from the recovered queue and resume unsent input after replay. Keep uncertain submissions paused without resending them, and show a notice identifying the message whose delivery could not be confirmed.
- Preserve pauses for unavailable conversations, pending compact/review requests, and existing input recovery failures.
- Simplify reconnect status text and remove blanket disconnect/reconnect transcript notices.

## Testing

Update reconnect integration tests and snapshots for automatic queue resumption. Add coverage for matching and unrelated receipts, missing history, late confirmations across navigation, pending compaction, and preservation of image-failure recovery pauses.

GitOrigin-RevId: d0b9aa43c4019d472985d12bbce8ba9bbfb9253b
2026-09-29 00:17:56 +00:00
jgershen-oai 7e049b3eaa Balance Windows Bazel test shards using duration estimates (#49103)
## Why

Hash-based sharding does not account for differences in test duration. Use estimated test time to balance the Windows Bazel workload across shards.

## What changed

- Add checked-in duration weights and a deterministic selector that assigns the longest targets first to the least-loaded shard.
- Assign every queried target exactly once, default missing weights to one second, and ignore stale weights.
- Run queries and selection in the foreground so failures stop the job before tests run with a partial target list.
- Emit LF-delimited target labels for Git Bash and report estimated shard loads on stderr.

## Testing

Add seven passing selector tests covering deterministic coverage and balancing, missing and stale weights, invalid inputs, duration-file overrides, and CLI output. Run them on the first Windows CI shard.

GitOrigin-RevId: d415ae093bfe57794ee53a2eb9d712022202dad8
2026-09-28 23:52:19 +00:00
Benjamin Carlsson c2d2f422e6 Preserve SQLite vacuum modes and surface pool initialization errors (#49102)
## Why

Changing an existing database from `FULL` to `INCREMENTAL` auto-vacuum requires a writer lock and can block pool initialization. SQLx also retries connection initialization failures, masking the original error as `PoolTimedOut`.

## What changed

Preserve existing auto-vacuum modes when opening writable pools, while continuing to initialize empty databases with incremental auto-vacuum. Return the first connection initialization error directly to the caller, retaining SQLx's normal error handling for later lazy connections.

## Testing

Add regression tests for fresh database settings, opening an existing `FULL` auto-vacuum database under a write lock, and preserving the WAL conversion lock error while allowing a subsequent open to succeed after the lock is released.

GitOrigin-RevId: b586c68e43a5a0d3b47268378716919d01b749cf
2026-09-28 23:44:39 +00:00
Dmitriy Kovalenko bfdb157178 Reuse the HTTP connection pool for remote plugin requests (#49100)
## Why

Each call to `PluginsConfigInput::remote_plugin_service_config` created a new HTTP client pool, preventing connection reuse across service configurations.

## What changed

Share one lazily initialized, route-aware pool across a `PluginsConfigInput` and its clones. Newly constructed inputs retain separate pools, while service configurations continue to use the current endpoint and product SKU and requests use the supplied authentication.

## Testing

Add tests for lazy initialization, pool sharing across repeated calls and early clones, isolation between new inputs, and requests using updated endpoints, product SKUs, and authentication with the shared pool.

GitOrigin-RevId: 3e929c34052798779a4f153e4db03b3f75b6f87d
2026-09-28 23:33:10 +00:00
Dmitriy Kovalenko 1260716393 Cache parsed plugin manifests across plugin workflows (#49099)
## Why

Repeated plugin discovery and loading reparse unchanged manifests and repeat warnings for invalid fields.

## What changed

- Share a manifest cache through `PluginStore` across marketplace listing, plugin loading, capability inspection, and tool suggestion metadata.
- Reuse successful parses by plugin root, manifest path, and content digests, including the Codex overlay. Reread files on each load so manifest edits and overlay changes or removal remain visible.
- Bound the cache to 128 entries and bypass caching for inputs larger than 64 KiB. Retry failed parses and share entries across store clones while keeping independent stores isolated.
- Reuse loaded manifest data when loading apps and MCP metadata.

## Testing

Add unit coverage for parse reuse, warning deduplication, revision invalidation, repair after parse failures, equivalent Windows paths, store isolation, and oversized inputs. Add an app-server regression test that verifies repeated `plugin/list` requests observe manifest and overlay revisions in one running server.

GitOrigin-RevId: ed082cd7d198015cd8ed35db7f2af74e13f49915
2026-09-28 23:32:45 +00:00
zm-oai f5430515a8 Resolve Windows sandbox PowerShell fallbacks on the exec server (#49098)
## Why

Remote controllers cannot resolve a sandbox-compatible PowerShell executable on the execution host.

## What changed

Apply the existing PowerShell fallback during exec-server request preparation for the `Elevated` and `Mxc` Windows sandbox backends. Match `pwsh` and `powershell` executable names case-insensitively and replace inaccessible Store PowerShell paths when a compatible executable is available.

## Testing

Add Windows RPC regression tests for lowercase and mixed-case PowerShell aliases with a restricted server `PATH`, verifying successful command execution in the `Mxc` sandbox.

GitOrigin-RevId: 365541af2f026a662b1988429f5d182c98e4a236
2026-09-28 23:21:26 +00:00
xli-oai 9563713df2 Notify lifecycle extensions of compaction usage limits (#49097)
## Why

Usage-limit failures during manual or post-turn compaction did not notify turn lifecycle extensions, leaving them unable to react to these errors.

## What changed

Emit the turn error lifecycle notification for `UsageLimitExceeded` in both compaction paths. Preserve the completed answer after post-turn compaction fails, and avoid duplicating the error already emitted by manual compaction.

GitOrigin-RevId: f31155e5991d762a0779030921aedbd1f818cfbb
2026-09-28 23:00:28 +00:00
cassirer-openai 2ce64843be Update h2 from 0.4.16 to 0.4.19 in Cargo and Bazel lockfiles (#49096)
GitOrigin-RevId: d38aedc1363465faf4aa5d8c61d10f4d32c8e1bf
2026-09-28 22:55:43 +00:00
Eric Traut 19892aee0c Simplify startup promotions to platform-specific desktop app tips (#49093)
## What changed

- Replace plan-specific and Fast-mode promotions with the desktop app tip for the current platform, while preserving announcement priority and random-tip fallback.
- Share desktop app tips between the preferred slot and random tip pool, including Windows. Keep Linux app tips limited to graphical sessions outside WSL.
- Clarify installation and launch instructions for macOS, Windows, and Linux, and format launcher commands as code.
- Remove the Fast-mode status plumbing used by tooltip selection.

## Testing

Add snapshots for all three platform tips at a narrow terminal width. Update tests to cover plan-independent tip selection and platform availability.

GitOrigin-RevId: 34bbc95c47c83618f9ac1691a1b69ca4690b8665
2026-09-28 22:40:35 +00:00
Eric Traut 222e24b737 Render follow-up directive labels in the TUI and copied responses (#49089)
## Why

Follow-up directives contain display labels and prompt attributes. Show the labels without exposing directive syntax or prompt text in rendered responses and streaming previews.

## What changed

- Render `:codex-followup[label]{prompt="..."}` as its label, preserving inline Markdown styling and source offsets.
- Replace recognized follow-up directives with their labels when copying whole responses, while retaining the original source.
- Withhold unfinished directives in rich streaming previews and avoid cropping into prompt attributes when the preview window advances.
- Preserve literal code, escaped directives, and malformed source when rendering completed messages or copying responses.

## Testing

Add regression coverage for label formatting, nested brackets and backticks, literal and malformed directives, whole-response copying, and streaming holdback across long prompts and preview window boundaries.

GitOrigin-RevId: dce61d1164de0a576fe95fb2c67b177a1ed414e8
2026-09-28 22:20:29 +00:00
Tamir Duberstein 88e9a8329d Track app-server running turns incrementally (#49084)
## Why

Every thread state mutation scanned all tracked runtimes to recount running turns while holding the state lock. This count supports graceful restart draining introduced in https://github.com/openai/codex/pull/12517.

## What changed

Maintain `running_turn_count` in `ThreadWatchState`, adjusting it when a runtime's `running` flag changes or a running thread is removed. Publish the cached count while preserving notifications only when the count changes.

## Testing

Extend the running-turn watch test to cover duplicate starts, two simultaneous running threads, and removal of a running thread, with counts checked against the runtime map.

GitOrigin-RevId: e7d7ebb33b9ff4d24dc70d8f01ae981378fed5f8
2026-09-28 21:33:00 +00:00
jif 46d2585ea4 Skip remote Git discovery for Guardian diff paths (#49082)
## Why

An offline secondary executor can stall Guardian approval revalidation while diff display setup searches for Git roots, even when the review concerns another executor.

## What changed

Use each environment's working directory as the diff display root for Guardian sessions, regardless of `CwdRelativeTurnDiffs`, so this setup does not wait for remote Git discovery.

## Testing

Add a regression test that withdraws authorization during a pending approval and disconnects an unrelated secondary executor. Verify that Guardian retries with the updated authorization and denies the request.

GitOrigin-RevId: 3661759119935c68539e9eab8df2e862987d0d92
2026-09-28 21:18:17 +00:00
Eric Traut fe50d010e2 Update and centralize TUI subscription labels (#49079)
## What changed

Use a shared subscription label mapping for status and analytics views. Rename
`Pro Extra` to `Pro 200`, `Pro Standard` to `Pro 100`, and `Pro Max` to `Pro 500`,
while preserving the existing differences between status and analytics labels
for other plans.

## Testing

Update the status plan-label test expectations for the three Pro tiers.

GitOrigin-RevId: 47af1e7d56ef9f7701caff8af315f530087920b8
2026-09-28 20:59:25 +00:00
Tamir Duberstein 011f803f3c Avoid collecting unused Git metadata in skill analytics (#49076)
## Why

Skill invocation analytics only needs the repository's origin URL, but
`collect_git_info` also checks the repository and reads its commit and branch.

## What changed

Extract and export `get_git_origin_url` and use it directly in skill analytics
to skip the extra Git commands. Reuse the helper in `collect_git_info`,
preserving URL sanitization and command timeouts.

GitOrigin-RevId: f878936937d0ff8c6313bb8168448e0b25ba1a39
2026-09-28 20:45:16 +00:00
sayan-oai 3749d1eff7 Preserve pending environments when spawning subagents (#49075)
## Why

Spawning a subagent before an environment was ready dropped the starting environment from the child's selections. The child needs to retain that environment and receive its configuration or failure when preparation finishes.

## What changed

- Pass the spawning step's environment snapshot to children, preserving ready and starting environments and configuration ownership.
- Propagate the original owner's first configuration result through descendants, applying each session's validation and leaving independently configured children unchanged.
- Preserve pending configuration waits across executor retries. Later owner updates do not overwrite the child's inherited configuration.

## Testing

Add regression coverage for fresh and forked subagents, readiness through turn-settings updates, failure propagation to children and grandchildren, child configuration precedence, and executor retries. Add a request snapshot showing a child using `wait_for_environment` before execution tools become available.

GitOrigin-RevId: a2afed740391f88d195596cfe28e418332b60d43
2026-09-28 20:42:04 +00:00
Tamir Duberstein 22d1d9336f Propagate Cargo package versions to Bazel Rust targets (#49074)
## What changed

Expose resolved Cargo package versions in `rules_rs` workspace `DEP_DATA` and pass them through `codex_rust_crate` to build scripts, libraries, binaries, and tests. This replaces the hardcoded `0.0.0` build-script version and supplies explicit versions to the other Rust targets.

GitOrigin-RevId: a3555beec3c5ecfc38d69c352b43696986352c49
2026-09-28 20:34:59 +00:00
Eric Traut 15c08beee2 Surface realtime voice catalog failures in the TUI (#49073)
## Why

Failed `thread/realtime/listVoices` requests silently fell back to the built-in catalog, allowing voice selection and conversation startup to proceed without the server's voice catalog.

## What changed

- Propagate catalog errors and show an error instead of opening the voice picker or starting a realtime conversation.
- If the catalog lookup fails after saving a preference, report that the preference was saved but the effective voice could not be confirmed. Leave the in-memory voice settings unchanged.

## Testing

Extend remote voice tests and snapshots to cover catalog failures when opening the picker, saving a preference, and starting a conversation. Verify that the preference is persisted, in-memory settings stay unchanged, and failed startup clears realtime state without sending `thread/realtime/start`.

GitOrigin-RevId: ba40800d6f9002e02e2b33de8dc858188c3cddd7
2026-09-28 20:34:33 +00:00
Dmitriy Kovalenko 33a0f766a6 Reclaim unused SQLite log database pages in the background (#49069)
## Why

Deleting logs leaves free SQLite pages available for reuse without shrinking the database file. Reclaim excess free space while preserving a reserve for future writes.

## What changed

- Start a background incremental-vacuum worker with `StateRuntime`, enabling reclamation only for the logs database. Use a per-home file lock to select one worker and wait for it to finish during shutdown.
- Reclaim pages when at least 64 MiB and 25% of the database are free, preserving a reserve of at least 16 MiB or 10% of the database.
- Use short transactions with page and cooperative time budgets, defer work on contention, and reduce batch sizes with exponential backoff when interrupted passes make no progress.
- Record reclamation counts, durations, and reclaimed pages in telemetry.

## Testing

Add a regression test that interrupts a vacuum commit, verifies foreground writes can resume without data loss, then confirms a resumed pass shrinks the database and passes `PRAGMA integrity_check`.

GitOrigin-RevId: 8421f87b0aeef6540eda5690c84216906673c72e
2026-09-28 20:19:10 +00:00
zm-oai 5a5a4aa796 Keep configuration values out of Windows sandbox policy events (#49067)
## Why

Configuration parser errors can include entire configuration lines containing credentials. Persistent policy-rejection events must avoid recording those values.

## What changed

Replace free-form error text in Windows sandbox provisioning policy-rejection events with known stage labels and typed cloud, HTTP, I/O, and Win32 error codes. Use fixed fallback labels when the stage or cause is unrecognized.

## Testing

Add regression coverage using malformed requirements and cloud configuration fragments containing a synthetic secret. Verify that diagnostics exclude parser values while retaining safe error codes, and that unknown errors produce fixed fallback text.

GitOrigin-RevId: 4f2fa5f6f602c34451776ec31381a102213660b8
2026-09-28 19:56:33 +00:00
cassirer-openai a1f05faddb Update Guardian handoff snapshot for separate agent messages (#49065)
## What changed

Update the `guardian_handoff_delegation` snapshot to include three separate `agent_message` items interleaved with user transcript messages, with corresponding transcript numbering and message counts.

GitOrigin-RevId: cae688e00f96d9545eccd7891426cfb4948a6dbf
2026-09-28 19:48:54 +00:00
Dmitriy Kovalenko e07e58c842 Update Guardian messaging snapshots for native agent messages (#49060)
Refresh the Code Mode messaging snapshot to include a native `agent_message`
entry between transcript segments, with updated message and action numbering.
Adjust retained-instruction spacing in the encrypted parent reply snapshot and
refresh assertion-line metadata in both snapshots.

GitOrigin-RevId: 1ee003cfb9df89faabd2f35e9d656423f16e0501
2026-09-28 19:08:32 +00:00
Darius Karel df3e439c02 Fix Windows sandbox ACL repair for long runtime paths (#49058)
## Why

Runtime ACL repair needs to handle nested files and directories beyond the legacy Windows path limit.

## What changed

Use Rust's `OpenOptions` for ACL reads and handle-based `SetSecurityInfo` for updates to support extended-length paths. Request ACL-write access only when grants need updating, and share allocation cleanup across success and error paths.

## Testing

Add a regression test covering long directory and file paths alongside a short-path control. Verify repeated repairs grant read/execute access without granting write, delete, or ACL-management rights, and that already-correct grants remain no-ops.

GitOrigin-RevId: 325c17085fa4379eebe982d49175dd2151b0681e
2026-09-28 19:01:20 +00:00
jif 6288753b46 Add handoff-aware root context for Guardian reviews (#49057)
## What changed

Add the disabled-by-default `guardian_root_handoff_context` feature to select worker-specific root evidence for Guardian reviews. Use recorded `spawn_agent`, `send_message`, and `followup_task` calls targeting a worker or its ancestors to select the three preceding root messages per handoff, plus the three latest root messages so recent cancellations remain visible before another handoff.

Preserve verified tool answers and evidence without known ordering, and retain the existing shared message cap. Fall back to the existing root context when no usable handoff window remains or the latest authorization message is a heartbeat. Update the review context revision when the selection changes.

## Testing

Add a delegation scenario and Guardian request snapshot covering ancestor handoffs, separate worker branches, cancellation visibility, and fallback after compaction removes handoff calls. Extend heartbeat coverage to exercise the new feature and verify that the latest turn's trusted skills are retained.

GitOrigin-RevId: 87dc39158f78b2b7e9f4f2e4afc653257ea12025
2026-09-28 18:51:10 +00:00
Eric Traut 4f63088cce Update Pro plan display names in the TUI (#49043)
## What changed

Update plan labels in the analytics views and status display:

- `PlanType::Pro`: `Pro (More)` → `Pro Extra`
- `PlanType::ProLite`: `Pro` → `Pro Standard`
- `PlanType::ProMax`: `Pro (Max)` → `Pro Max`

## Testing

Update the status display-name test expectations for all three Pro tiers.

GitOrigin-RevId: 9bd9f1cd8a701019fd40047cd8131e6193f66cb9
2026-09-28 17:58:35 +00:00
Felipe Coury 3074be908a Copy selections within inline code as plain text (#49041)
## Why

Copying text selected entirely within inline code added Markdown backticks that were not part of the selected content.

## What changed

Return only the selected content as plain text when the selection is contained within one inline code span, including in a single table cell. Preserve Markdown formatting for selections that also include surrounding content, and continue filtering control characters from table copies.

## Testing

Add regression coverage for full and partial inline code selections, embedded backticks, Unicode, whitespace, wrapping and resizing, and table selections with mixed content or control characters.

GitOrigin-RevId: c63e13cb781f9fca28ae53500cb4f9ae08b72c96
2026-09-28 17:51:00 +00:00
felixxia-oai 368e5eae2f Preserve encrypted agent messages in Guardian reviews (#49038)
## Why

Guardian transcripts omitted encrypted agent messages, leaving reviews without evidence such as encrypted parent replies.

## What changed

- Carry encrypted `agent_message` items through synchronous reviews and asynchronous scoring, preserving their order, author, recipient, and ciphertext.
- Account for native messages in context budgets and omit them whole with an explicit notice when limits require it.
- Support mixed text and native messages during review admission while retaining user-content annotations.

## Testing

Add coverage for transcript ordering and budget eviction in both reviewer profiles, plus a mocked scenario verifying that an encrypted parent reply appears exactly once in each of two incremental Guardian reviews.

GitOrigin-RevId: abc2f1ce5accd83beb06f799ef9ed9d7fa2cd90a
2026-09-28 17:40:25 +00:00
Felipe Coury 64bf4e7e62 Show the Plan mode cycling hint in the fullscreen status line (#49037)
## Why

The fullscreen status line showed Plan mode without explaining how to leave it.

## What changed

Show `Plan mode (shift+tab to cycle)` when the composer is idle and accepts input, and the hint fits alongside the status text. Fall back to the mode label when space is limited, and hide the shortcut during tasks, popups, interactive footer use, or other non-composer modes.

## Testing

Add a rendering snapshot and regression assertions for wide and narrow layouts, running tasks, interactive search, empty status text, disabled input, and parent-owned threads.

GitOrigin-RevId: a1cf2762b33f5442ab0611a15205f2e36c84b075
2026-09-28 17:39:56 +00:00
felixxia-oai 41ed72c32b Add opt-in conversation history retrieval to Guardian reviews (#49036)
## Why

The transcript supplied to Guardian may omit earlier user instructions, restrictions, or revoked permissions. History retrieval lets the reviewer check relevant authorization before approving actions with side effects.

## What changed

- Add the disabled-by-default `guardian_conversation_history_tools` feature. With Apps enabled, expose `user_message.search_messages` and `user_message.read_messages` through the parent's live Apps connection and conversation identity.
- Recheck the parent's current app and tool policy on each call, rejecting disabled tools and calls requiring approval.
- Add retrieval instructions that distinguish user authorization from assistant context and account for later revocations and incomplete results. Allow overrides through `auto_review.experimental_conversation_history_prompt`.
- Limit history responses to an estimated 4,000 tokens by default, configurable through `auto_review.conversation_history_max_output_tokens`, while preserving stricter parent and reviewer limits.
- Allow explicit extension registries for isolated sessions and prevent those sessions from inheriting the implicit Apps connection.

## Testing

Add scenarios covering history tool exposure, parent connection and identity reuse, custom prompts, output truncation, stricter reviewer budgets, and live permission changes on a reused reviewer. Extend configuration coverage for blank prompt overrides.

GitOrigin-RevId: 055a69b113c8548bd58e7d5618ea026ba6d1ffb1
2026-09-28 17:29:52 +00:00
jif 46fdd5ef39 Avoid SQLite stalls from connection setup and stderr span logging (#49032)
## Why

Setting `auto_vacuum` on every connection can wait for a writer lock even when the mode is unchanged. Logging every span entry and exit can also block SQLx workers on undrained stderr while they hold a write transaction.

## What changed

- Set incremental vacuum only for empty databases or databases using full auto-vacuum, before enabling WAL. Preserve existing nonempty databases with auto-vacuum disabled.
- Emit span creation and closure events in app-server text and JSON stderr logs, preserving busy/idle timings and explicit events while omitting span entry and exit records.

## Testing

Add regression tests for opening and expanding writable pools while another connection holds a writer lock, and for transaction completion with undrained stderr in both log formats. Verify vacuum modes and retained log diagnostics.

GitOrigin-RevId: 40d4ef32c7efc49f4240b987277ba45551259335
2026-09-28 17:00:25 +00:00
Benjamin Carlsson d8fc718809 Clarify ChatGPT sign-in success copy (#49031)
Describe permissions and approvals explicitly in the Codex docs link text,
and clarify that the user's ChatGPT plan rate limits and training data
preferences apply. Remove the “Before you start” preamble to shorten the
success screen.

Update the rendering snapshot and hyperlink styling assertions for the
revised copy and layout.

GitOrigin-RevId: 5166ddade6a433191fa86c960899c4da5092b9f5
2026-09-28 16:52:39 +00:00
aionescu-oai f817e16905 Use the numeric ioctl value in the macOS sandbox policy (#49028)
Older macOS policy compilers do not define the `TIOCSTI` symbol. Generate the sandbox CLI's Seatbelt deny rule with the numeric value from `libc::TIOCSTI` so it remains compatible while blocking terminal input injection.

GitOrigin-RevId: de8113fbab92bb399f37b9a22762c5c649f25972
2026-09-28 16:45:54 +00:00