Commit Graph
11831 Commits
Author SHA1 Message Date
Tamir Duberstein b06b7d2f77 Upgrade Windows bindings to windows-sys 0.61.2 (#50058)
## What changed

- Centralize `windows-sys` at version `0.61.2` in the workspace and migrate dependent crates to it.
- Adapt Windows API calls to the updated handle, boolean, and type definitions. Replace custom handle owners with `OwnedHandle` and use `BorrowedHandle` where ownership stays with the caller.
- Add explicit wrappers for non-owning Windows handles passed between threads.

## Testing

Enable the MCP refresh cleanup test on Windows. Retain process handles to verify that a superseded MCP server stays alive during an in-flight call, exits after cancellation, and leaves the replacement running until shutdown.

GitOrigin-RevId: 86f53d9b300d13edff7154f4a7c32e34dacd2919
2026-10-01 18:05:05 +00:00
Tamir Duberstein d9cf203890 Check token estimate filtering directly on the tracing subscriber (#50054)
## What changed

Update `post_sampling_token_estimate_is_disabled_by_always_on_sinks` to register explicit event metadata with the subscriber and assert that its interest is `never`. This replaces the scoped default subscriber and global interest-cache rebuild with a direct check of the configured logging layers.

GitOrigin-RevId: 7c4ecd9c4adef148fd222394ad1ad326e8033d95
2026-10-01 18:02:44 +00:00
Ian MacLeod 57a38c1beb Preserve question context in recovered TUI answer drafts (#50052)
## Why

When a turn ends, unsent question answers are recovered into the main composer. Recovering only the answers loses which question each answer belongs to.

## What changed

Prepend each recovered answer with its question title as a Markdown blockquote. Separate questions, answers, and existing composer text with blank lines.

Sanitize question titles and limit them to 512 bytes at a UTF-8 character boundary, adding an ellipsis when truncated. Keep answer text untruncated.

## Testing

Add coverage for bounded titles, multibyte characters, control characters, and multiline question-and-answer submission. Update recovery assertions and snapshots for turn completion, failure, interruption, large pastes, and Vim undo.

GitOrigin-RevId: 141dacfb64bcad5fcabc5be217d2340ef7de1eb5
2026-10-01 17:52:19 +00:00
sayan-oai 9561a34531 Keep plugin and skill snapshots scoped to each step (#50050)
## Why

Environment changes and overlapping catalog refreshes can cause a step to use another step's selected plugins or executor skills. Model context and skill tools need to agree on the capabilities captured for that step.

## What changed

- Resolve selected plugins from each step's ready capability roots, honoring disabled plugins, and retain the snapshot with the step's extension data.
- Use that snapshot for skill attribution in World State and the first step's active-plugin telemetry.
- Return executor skill catalogs directly from refresh so overlapping requests render their own results while retaining thread caches.

## Testing

Add regression coverage for overlapping executor catalogs and environment changes during step preparation. Verify that `skills.list` retains the original step's skills, the next step advertises the new skills, and disabled executor and plugin skills remain absent from model context.

GitOrigin-RevId: 37d3cbe8c7e062fd06290aa985ada4d3b3462d43
2026-10-01 17:44:52 +00:00
Adam Perry @ OpenAI 5fa5aaf0ff Stabilize Windows voice build cache keys across tool reinstalls (#50046)
## Why

Cygwin records installation timestamps in an unused Java truststore, changing Bazel action cache keys when the same tools are reinstalled.

## What changed

Exclude `cygwin/etc/pki/ca-trust/extracted/java/cacerts` from the generated `cygwin` filegroup in `.github/scripts/voice_windows_tools.py`.

GitOrigin-RevId: 8fdd910fadba7d977b45718546232652d073cdc8
2026-10-01 17:27:30 +00:00
Felipe Coury 1cc9917508 Keep transcript Find expansion scoped to the current match (#50045)
## Why

Starting Find expanded the entire transcript into detailed mode. Searching hidden content should preserve the compact view and manually expanded activities.

## What changed

- Search full transcript content, including hidden live output, and temporarily expand only the current matching entry.
- Preserve manual disclosure state and retained text revisions while reading or selecting a match. Allow activity controls while reading results.
- Use `Enter` or `Ctrl+P` for older matches and `Ctrl+N` for newer matches, with matching footer hints.

## Testing

Add regression tests and snapshots for selective expansion, manual disclosures, hidden live matches, retained selections across updates and resizing, and Find in compact transcript overlays.

GitOrigin-RevId: 618ee47ba6c3f3a5138c9e3fe0961e7faa3383da
2026-10-01 17:27:03 +00:00
Felipe Coury a97fb78085 Keep transcript Find results readable after closing the query (#50039)
## Why

Closing Find previously restored the pre-search view, making it difficult to read a match and its surrounding transcript context.

## What changed

- Make `Esc` with a nonempty query close query editing while preserving the query, highlighted match, and expanded output. A second `Esc` returns to the latest output; `Ctrl+C` cancels Find and restores the pre-search presentation.
- Allow paging through surrounding context and loading older history without losing the query. Keep `Ctrl+N` and `Ctrl+P` available for match navigation, and reopen Find to edit the retained query.
- Show context above matches when space permits, preserve match layouts across resizing, and display navigation and history status while reading results.

## Testing

Add regression tests and snapshots for retained results, surrounding context, resizing, paging around live output, older-history loading, and footer status. Update interaction tests for the additional `Esc` transition.

GitOrigin-RevId: d822956d3c6ffab88fc1665ebdf0c86ccf110899
2026-10-01 17:22:19 +00:00
jif cc31e374fc Follow MCP tool pagination in legacy protocol mode (#50035)
## Why

Legacy MCP tool discovery discarded pagination cursors, leaving tools on later pages unavailable.

## What changed

Pass `tools/list` pagination cursors to the existing collector in both legacy and modern protocol modes. Legacy discovery now follows subsequent pages and applies the same pagination limits and cursor validation as modern discovery.

## Testing

Extend integration coverage to both protocol modes, checking that tools from later pages reach the model and can be called successfully, while catalogs with oversized cursors are rejected. Update the legacy discovery test to expect an error for a repeated cursor.

GitOrigin-RevId: a6daa8034d2a403c1f2a5846e385789d8a620af7
2026-10-01 17:10:03 +00:00
jif 2685e3a4ce Preserve user restrictions in Guardian handoff context (#50026)
## Why

A user restriction such as “Cancel the deployment” can fall outside the recent-message window after unrelated status questions. Guardian reviews need that restriction when assessing delegated actions.

## What changed

- Preserve root user messages during handoff relevance filtering, subject to the existing shared message cap.
- Apply handoff filtering during heartbeats while retaining saved heartbeat instructions and the active turn's trusted skills.
- Mark assistant context as incomplete when handoff filtering omits it, so ordinary user replies are not interpreted without their missing context.

## Testing

Add regression coverage for restrictions followed by status questions, bounded user history, omitted assistant questions, and trusted skills across first and repeated heartbeats. Update the delegation request-history snapshot.

GitOrigin-RevId: 67f77313572dc54225713cd7cdb90f06b0fbe030
2026-10-01 16:14:27 +00:00
swastik-oai 9552906b2b Protect the guardian decisions API key from environment forwarding (#50019)
## What changed

Add `CODEX_GUARDIAN_DECISIONS_API_KEY` to the non-inheritable environment variables and the HTTP header environment denylist. Case-insensitive filtering removes it from child process environments, including explicit shell policy and command overrides, and rejects its use through `http/request` header `value_env_var`.

## Testing

Extend regression coverage for inherited and overridden variables, mixed-case names, and HTTP header rejection before any network request is sent.

GitOrigin-RevId: 1adeef814fdccb2d6c77dd68f7a5dfcec0b41cc6
2026-10-01 15:57:53 +00:00
jif 595534314f Use descriptor-safe helpers for executable test fixtures (#50018)
## Why

Concurrent Linux test spawns can inherit writable descriptors for executable fixtures, preventing those fixtures from being executed even after the writing test closes its descriptor.

## What changed

Replace direct executable fixture writes and copies across the Rust tests with `codex_utils_cargo_bin::write_executable` and `copy_executable`. These existing helpers complete writes and copies in separate processes on Linux.

Remove the empty temporary inode before creating fake bubblewrap executables, and stage tampered bubblewrap bytes in a separate data file before copying them into the executable fixture. Add the required test dependencies.

GitOrigin-RevId: c875c83088731a4933ef1574e8d79d8cecc12f54
2026-10-01 15:57:03 +00:00
Eric Traut b527ce4734 Honor server model defaults when starting fresh TUI threads (#50013)
## Why

Fresh TUI threads should use the app server's model settings unless the launch explicitly overrides them. Sending resolved configuration values in `thread/start` turns defaults into explicit overrides.

## What changed

- Track explicit launch choices for `model`, `model_provider`, and `model_reasoning_effort`, and omit unselected settings from the initial `thread/start` request.
- Preserve accepted model migrations as explicit model and reasoning-effort choices.
- Keep explicit profile launches on the existing resolved-configuration path.

## Testing

Update startup request tests to cover omitted defaults, CLI model and provider overrides, repeated model overrides, reasoning-effort overrides, accepted migrations, and explicit profiles.

GitOrigin-RevId: 4e2661ba42322a80e2b769a55c62f61a576762b0
2026-10-01 15:47:07 +00:00
felixxia-oai 57ac6f5163 Preserve the async Guardian history prefix as retained context changes (#49993)
## Why

The rolling retained-context window can change as assistant messages are added or evicted. Placing it before the transcript invalidates the reusable history prefix.

## What changed

Move retained user instructions and context after the transcript and action-specific attestations, immediately before the planned action in asynchronous Guardian requests. Keep synchronous section ordering unchanged.

## Testing

Extend the cache-prefix regression test to cover retained assistant message growth and eviction alongside changing attestations. Update app-server and async scorer assertions to verify the new request ordering.

GitOrigin-RevId: 59953d582d4b174ce3e083606626c7532ce0776d
2026-10-01 14:48:02 +00:00
Nick Steele ecc78e4cf5 Add renewable EMA HTTP authentication and credential versioning (#49987)
## What changed

- Add `EmaAuthenticatedHttpClient` to cache and renew resource bearers, serialize concurrent renewals, and include authentication time in the request deadline. Confine bearers to the configured MCP endpoint and reject redirects.
- Return authentication-required errors for `401` responses without replaying MCP operations. Preserve a newer cached bearer when a delayed response rejects an older one.
- Add revocable request authority that cancels pending requests and ends response streams.
- Pin enterprise credentials to a persistent version advanced on save or deletion. Use short credential locks and invalidate rejected grants only when their record and version are still current, preserving newer logins.
- Hide keyring account identifiers from enterprise credential errors and traces while preserving authentication failure classification.

## Testing

Add tests for token expiry and renewal, endpoint confinement, redirects, request deadlines, revocation during renewal and streaming, delayed `401` responses, credential replacement and logout races, and credential error privacy.

GitOrigin-RevId: ee3e5cf7ecbba3d09e1ab29ed4fbb2a35eacc60d
2026-10-01 13:57:48 +00:00
jif a933dd77db Share byte buffers across exec-server output chunks (#49972)
## Why

Retaining process output, publishing events, and serving reads cloned the underlying byte buffers. Sharing those buffers avoids copying output bytes when chunks are cloned.

## What changed

Store `ByteChunk` bytes in `Arc<Vec<u8>>` and retain `ProcessOutputChunk` values directly. Add borrowed byte access for the MCP process transport while preserving base64 serialization and owned byte extraction through `into_inner()`.

## Testing

Add a unit test covering base64 serialization, deserialization, and independent owned bytes extracted from shared chunks.

GitOrigin-RevId: 6bba114af48424aa844487aa75163cfc604e0575
2026-10-01 12:41:39 +00:00
jif d6c3b448a4 Test session index thread-name append and removal (#49959)
## What changed

Add a test that appends an original and updated name for one thread alongside another thread's entry. Verify that lookup returns the updated name and that removing the first thread's name entries leaves only the other thread's entry.

GitOrigin-RevId: cedf260a639f0c0e76aeda0d446559c3821bd911
2026-10-01 11:09:12 +00:00
jif 8a400e7812 Cache the placeholder regex for MCP hook argument expansion (#49956)
Use `LazyLock` to compile the placeholder regex once and reuse it across
argument strings, avoiding repeated compilation during template expansion.
Preserve regex error propagation and placeholder substitution behavior.

GitOrigin-RevId: 2ac8aec86de3430335c068e47d09422dcd276f7c
2026-10-01 11:01:37 +00:00
jif f70810bcd2 Include preceding assistant context in Guardian sender reviews (#49951)
## Why

Short sender replies such as `👍` need preceding assistant context to be understood during a delegation review. User messages alone omit that context.

## What changed

- Capture preceding assistant context alongside up to three recent sender user messages at delivery, for Guardian only. Label assistant messages as untrusted context rather than authorization or verified questions.
- Share the existing 900-byte budget per exchange, prioritize user evidence, and report unavailable assistant context.
- Recognize `cloud_threads.send_message` deliveries and accept both compact and indented delegation envelopes.

## Testing

Expand integration coverage for app, TUI, and cloud-thread deliveries, contextual replies, and budget-driven omissions. Assert that sender user and assistant context stays out of the delegated agent's prompt.

GitOrigin-RevId: 4eca369cbb30241635273f729dec81b78ea57faf
2026-10-01 10:47:18 +00:00
jif dd90f160ed Prevent stale file search results from being labeled with a new query (#49946)
## Why

The asynchronous matcher can return results for the previous query while a new query is still running. Labeling those results with the latest query produces a mismatched search snapshot.

## What changed

Only report a file search snapshot when its pattern atoms match the currently requested pattern. Extract snapshot conversion into `snapshot::for_query`, which skips pending results from an older pattern.

## Testing

Add a regression test that changes the query from empty to `bet`, verifies that the old snapshot is withheld, and checks that the completed snapshot contains `beta.txt` with the expected match indices and counts.

GitOrigin-RevId: 01b62b822db69e15480d3233b66ec55c45646fad
2026-10-01 09:52:54 +00:00
mldangelo-oai 6b4daafdb4 Add per-turn Cyber access program selection to exec and the SDK (#49939)
## Why

`codex exec` and the TypeScript SDK need a way to request a Cyber access program for an individual turn. Resuming with an API key can also leave compaction using a saved program that the current credentials cannot access.

## What changed

- Add `--cyber-access-program` with `standard`, `daybreak_blue`, and `daybreak_red`, and expose the equivalent `cyberAccessProgram` turn option and `CyberAccessProgram` type in the TypeScript SDK.
- Apply explicit selections to new, resumed, and prompted fork turns. Override automatic Daybreak selection for that turn without changing the saved choice. Reject the flag for review and forks without a prompt.
- Filter Cyber programs by the built-in OpenAI provider when starting turns and restoring previous-turn settings for compaction.
- Allow previous-model compaction fallback with API-key authentication, comparing both model and program so a program change can trigger a retry with the current pair even when the model is unchanged.

## Testing

Add CLI help, argument parsing, exec, and SDK coverage for per-turn selection and unsupported commands. Extend core tests for API-key compaction retries, denied explicit selections, custom-provider filtering, remote compaction, and WebSocket response reuse.

GitOrigin-RevId: 586f25b621924f3bc509c9a39b39fe2020ff9cd2
2026-10-01 08:57:53 +00:00
Eric Traut 444da310e1 Respect approval policies in temporary structured threads (#49912)
## Why

Forcing `approval_policy` to `never` on temporary structured threads can trigger configuration warnings when managed requirements allow only `on-request`. These hidden threads also need to reject unexpected interaction requests without prompting the user.

## What changed

Inherit the app server's approval policy when starting temporary structured threads. Reject their server requests before dynamic tool handling or interactive TUI routing.

## Testing

Extend regression tests to verify inherited `on-request` approval without approval-policy warnings, and error responses for recap-thread approval and user-input requests even when the thread is marked active and primary.

GitOrigin-RevId: 2d0a071d3687742c83ba933a7ef1357feea53403
2026-10-01 07:08:19 +00:00
Eric Traut 819efd7273 Preserve validation errors for invalid TUI keybindings (#49910)
## Why

Deserializing keybindings through an untagged enum hides the specific validation error, making invalid `tui.keymap` settings harder to diagnose.

## What changed

Deserialize single keybinding strings and lists by value type so validation errors reach the user. Errors now retain the reason a binding is invalid and the affected configuration key, including when loading configuration for `codex mcp list`.

## Testing

Add TOML regression tests for unknown keys, invalid chord strokes, and overly long chords in both string and list forms. Add a CLI snapshot test verifying that `codex mcp list` reports the invalid keybinding reason and configuration key.

GitOrigin-RevId: 26e3dea93fc43db21e993ea5cf93df53ce93a43e
2026-10-01 06:59:13 +00:00
Adam Perry @ OpenAI da2e174a66 Scope extension filesystem access to callback permissions (#49898)
## Why

Executor skill reads need to use the environments and permissions captured for the current step, including newly approved grants. Cached continuation pages must remain bound to the filesystem and permissions that produced them.

## What changed

- Supply borrowed `EnvironmentAccess` to turn-input contributors and extension tools, with session and originating-turn grants already applied.
- Require executor skill reads to use filesystem access from an environment available to the callback, and replace separate optional read contexts with `SkillReadContext`.
- Bind skill pagination snapshots to `EnvironmentAccessKey`, which identifies the source filesystem and callback permissions.
- Route image-generation filesystem operations through the same accessor.

## Testing

Extend skill-read integration coverage to verify that a denied reference becomes readable after a turn-scoped grant is captured by the next model step. Update Windows coverage to verify that restricted reads fail when the executor cannot enforce a sandbox, and add a test requiring turn environment selection before exposing capability roots.

GitOrigin-RevId: 825b49302319965835d61c77fc5bcdb951e10543
2026-10-01 06:29:03 +00:00
pakrym-oai 08a7031b6a Return world-state snapshots and context updates together (#49894)
## What changed

Replace the separate `WorldStateSection::snapshot` method with a typed `SectionTransition` returned by `render_diff`. Snapshot updates and model-context fragments are independently optional; omitting a snapshot preserves the stored comparison state.

Update all section implementations to use this contract, skip snapshot updates for unchanged sections where applicable, and cache the multi-agent usage-hint fingerprint.

## Testing

Adapt world-state and context-history tests to the combined return value, including an assertion that unchanged permissions return neither a snapshot nor a context fragment.

GitOrigin-RevId: 79c1977a87481009ff193ea4cce4546be87458fe
2026-10-01 06:11:42 +00:00
Adam Perry @ OpenAI 1f52d40704 Bind permission grants to the originating turn (#49880)
## Why

Background code-mode cells can continue running after a new turn starts. Looking up grants and strict review requirements through the active turn can make those cells lose their approved access or use another turn's permissions.

## What changed

- Keep turn-scoped grants and strict review state in `TurnContext`, retained by captured steps and background cells.
- Record permission responses against the requesting turn, including requests made after a later turn starts.
- Share live session-scoped grants across turns while keeping turn-scoped grants isolated.
- Use the originating turn's permissions and review requirements for tool execution, patches, MCP calls, file uploads, and terminal input.

## Testing

Add regression coverage for background cells retaining grants across turn changes, turn versus session scope, permission requests after the next turn starts, and strict review enabled while `write_stdin` is queued.

GitOrigin-RevId: 641502fbfd43553c2c42424d4aaa53ae8020c850
2026-10-01 05:33:36 +00:00
Eric Traut d2b254fd17 Remove personality plumbing from the TUI (#49876)
## What changed

Remove personality from TUI turn commands and cached thread session state, and stop applying personality from thread settings notifications. Send no personality override in `turn/start` requests.

Forward `personality` through session configuration only when explicitly supplied as a CLI override, rather than deriving it from the effective local configuration.

## Testing

Extend configuration override coverage to verify that `personality = "none"` is forwarded only when supplied through CLI overrides.

GitOrigin-RevId: bd3c3bacc90e0561016c0cac557eb1b0e50d32c0
2026-10-01 05:25:31 +00:00
Eric Traut 7b88d09d61 Decouple TUI startup presentation from execution configuration (#49875)
## Why

Startup presentation needs client preferences before thread initialization establishes effective execution permissions. The startup header should not infer permission state from local configuration.

## What changed

- Load `LocalSettings` directly from bootstrap TOML, preserving preference defaults and overrides, accessibility settings, and audio settings that exclude project layers.
- Use those settings for first-frame presentation and pass `LocalSettings` plus the working directory to the startup draft instead of a full `Config`.
- Stop showing the YOLO indicator in the startup header while execution permissions are unknown.

## Testing

Update tests to compare bootstrap settings with resolved configuration, verify first-frame keybindings and paste preferences with an unresolved permission-profile parent, and snapshot the configured startup header. Adapt startup editor tests to the settings-based interface.

GitOrigin-RevId: f33cf8f42c53a9ddcbe0273491b5a849da9e6808
2026-10-01 05:18:04 +00:00
Eric Traut bdfbab9f4f Point usage and credit links to ChatGPT settings (#49874)
## What changed

Replace `https://chatgpt.com/codex/settings/usage` with
`https://chatgpt.com/settings/usage` in usage-limit errors, the `/status`
card, and backend banner actions. Credit purchase actions retain
`?credits_modal=true`.

## Testing

Update error-message assertions, banner action tests, status hyperlink
assertions, and TUI snapshots to expect the new URL.

GitOrigin-RevId: 1e1db971284a25a781120da30a6dea5ff9c3d957
2026-10-01 05:16:40 +00:00
Eric Traut 90d7f2715a Update elevated-launch warning snapshot to use ⌃o for copy (#49867)
GitOrigin-RevId: e9fd778114ba5ae958a1864f99621267e33ef6ba
2026-10-01 04:48:43 +00:00
Eric Traut 8ea2428c38 Add Daybreak state to the status line and terminal title (#49861)
## What changed

Add a selectable `daybreak` item to the status line and terminal title, including setup previews and terminal-title validation. Display `Daybreak on` when enabled for the thread and `Daybreak off` otherwise, including during side conversations.

## Testing

Add coverage for on/off rendering and side conversations, update setup preview snapshots, and verify that terminal-title diagnostics accept `daybreak`.

GitOrigin-RevId: b0b7a6f0ee0a107ba4ee2d56113a5b9b6ebd1d41
2026-10-01 04:25:23 +00:00
Eric Traut cd4a9cbd25 Honor Daybreak settings in TUI continuations and background tasks (#49859)
## Why

Cyber-policy refusal guidance did not distinguish whether Daybreak was on or off, and policy continuations and background task turns omitted `cyberAccessProgram`.

## What changed

- Show refusal guidance for the current Daybreak setting and offer eligible users an “Enable Daybreak” picker for their next request. Persist the selection without automatically retrying the refused request, and suppress the picker during history replay and when viewing parent-owned threads.
- Select and validate the cyber access program for policy continuations and background task turns using account eligibility, model support, and the thread's Daybreak setting.
- Resolve new background threads' Daybreak defaults from effective configuration unless launch flags or a selected profile explicitly override them. Use the target thread's saved setting for follow-up messages.

## Testing

Add unit, snapshot, and request-recording coverage for refusal guidance, picker behavior, continuation access programs, and background tasks retaining Daybreak after configuration changes.

GitOrigin-RevId: 94dee39c067e8eea5791cb31d5fe65fc600e5a18
2026-10-01 04:24:20 +00:00
Eric Traut e1522188e9 Add a persistent /daybreak toggle to the TUI (#49858)
## What changed

- Add `/daybreak` with account-aware help and availability messages for broader access for cybersecurity work.
- Save the selection in thread metadata and the `daybreak` default for new threads, restore it on resume, and confirm that it applies to new turns.
- Select `cyberAccessProgram` from the connected server's model catalog. Require a signed-in ChatGPT account, the OpenAI provider, and confirmed model support when Daybreak is enabled, including for faster-model retries. Keep Daybreak disabled for side conversations.

## Testing

Add tests for toggle persistence, turn access-program selection, unsupported-model rejection, side-conversation behavior, command help, and the resumed-thread banner.

GitOrigin-RevId: e3c028b0a6a8e0a862c16fdc766f374aae618ef1
2026-10-01 04:17:31 +00:00
Eric Traut f58ed54a9d Use the model catalog to select TUI cyber refusal guidance (#49857)
## What changed

Select cyber refusal notices from the current model's `available_access_programs` for ChatGPT accounts using the OpenAI provider. Show Astra-specific guidance only when an Astra model offers standard cyber access without Daybreak access, and use the limited notice when Daybreak access is available. Otherwise, show application guidance.

Remove the separate account eligibility request, background prefetching, and notice cache.

## Testing

Update tests to cover catalog-based notice selection, missing model metadata, isolation from other models' access programs, and rendering the application notice for a cyber policy error.

GitOrigin-RevId: 88e9522bd6ece2d2b9caa6cff01a4178768babb7
2026-10-01 04:17:07 +00:00
Eric Traut c41a72cd3f Support Daybreak selection in codex exec (#49856)
## What changed

- Add the `daybreak` configuration key, defaulting to `false`, with per-invocation overrides such as `-c daybreak=true`.
- Resolve access programs from the model catalog, preferring `daybreak_blue` over `daybreak_red` when enabled and selecting advertised `standard` access when disabled for signed-in ChatGPT accounts. Require the OpenAI provider, a signed-in ChatGPT account, and a compatible model to enable Daybreak.
- Save the choice for new persistent threads and inherit it on resume and fork, including ephemeral forks. Explicit CLI overrides apply only to the current invocation.

## Testing

Add protocol tests for advertised-program selection and exec integration tests for account and provider restrictions, saved choices, ephemeral forks, and invocation-only overrides.

GitOrigin-RevId: ac955f08b5a891e720cfc5f67fabb7b0f6d32bb8
2026-10-01 04:16:43 +00:00
Eric Traut bc197b77bc Use embedded mode for elevated Windows TUI sessions (#49855)
## Why

The Windows shared daemon rejects elevated launches so shared clients cannot inherit administrator privileges. Local TUI sessions launched as administrator should still be able to start.

## What changed

Select embedded mode before daemon discovery or startup for elevated local Windows sessions. Show a startup warning explaining that the shared background server is disabled and that restarting Codex in a non-elevated terminal enables it. Record `elevated_windows` as the server selection reason.

## Testing

Add Windows integration coverage for elevated normal, `resume`, and `fork` launches without creating daemon directories, and verify that explicit daemon `start` and `restart` still reject elevation. Add a snapshot test for the startup warning in the warning center.

GitOrigin-RevId: 89594e86d6ee19b080dfb11553cee8676395f188
2026-10-01 04:15:13 +00:00
Dmitriy Kovalenko 236be1ad9f Improve diagnostics for report attachment failures (#49852)
## Why

Skipped report attachments lacked diagnostic logs, and upload failures logged only the HTTP status. Transport error strings can also contain credential-bearing URLs.

## What changed

- Log why attachments are skipped, including missing rollout files, non-regular files, size limits, rate limits, and upload deadlines.
- Log attachment failures at error level with the error chain and available HTTP status.
- Replace `RouteAwareRequestError` details with the failure class and timeout, connection, request, and body flags before logging, avoiding credential-bearing transport URLs.

GitOrigin-RevId: 1bfd1cc74137ea83d05098e9dbf58ed7b62385cc
2026-10-01 04:04:44 +00:00
Eric Traut e2a7d53c9c Launch Windows daemon children in a dedicated working directory (#49850)
## Why

Windows processes hold their working directory open for their lifetime, and sandbox setup may broaden its ACL. Managed children should avoid pinning the launching project's directory or changing permissions on the private daemon state directory.

## What changed

Create a `workdir` subdirectory alongside the PID files and use it as the working directory for both the managed app-server and updater on Windows.

## Testing

Add a Windows regression test covering both managed children. It verifies that relative files land in `workdir`, the state directory still passes private-directory validation, and stopping each child removes its PID file.

GitOrigin-RevId: 12ca95463ff3c80899a5b1a8800fead849f48017
2026-10-01 03:56:53 +00:00
pakrym-oai b44ca872b1 Persist world-state snapshots alongside rendered context (#49847)
## What changed

Return snapshots and model-visible fragments together from world-state rendering, and use those snapshots for history baselines, step updates, compaction, and new context windows.

Update `WorldStateSectionContribution` so its renderer returns an optional replacement snapshot and an optional fragment. A missing snapshot preserves stored section state, even when retained history requires a fresh render; a null snapshot removes the section. Derive step patches from the history baseline rather than a separately captured live world state.

Adapt skills and Git attribution contributors to the new contract.

## Testing

Add coverage for skipped snapshot updates, explicit section removal, changed-state patch replay, unchanged-state deduplication, and matching live and persisted checkpoints when starting a new context window.

GitOrigin-RevId: af71606a278358ae937853cb76e8a019a501408e
2026-10-01 03:38:50 +00:00
sayan-oai 408f48ce0c Capture host-supplied extension data for each turn (#49846)
## What changed

Add `turn_extension_init` to thread startup and settings, and expose `WithTurnExtensionData` for turn input, recovery, and settings requests. Accept or reject data updates together with the request that supplies them.

Each new turn captures the configured data, including automatically started turns. Accepted steering updates the data for future turns while preserving the running turn's capture. Plain requests preserve the configured data; an empty initializer clears it. The data is not persisted and must be supplied again on cold resume.

Expose `current_turn_extension_data` to retrieve typed data only when the requested turn is still running and has not been cancelled.

## Testing

Add an integration test covering initial capture, accepted and rejected steering, inheritance by an automatic turn, clearing future data without changing the active capture, and rejection of lookups for an earlier turn.

GitOrigin-RevId: dd81eda3e32c7b62d783c772221858f4c0e68264
2026-10-01 03:31:48 +00:00
Eric Traut 08b07eef12 Preserve daemon diagnostics and include updater logs in reports (#49843)
## Why

Detached launches truncate stderr logs, losing details from previous failures. Updater handoffs can also leave existing writers with stale offsets after truncation.

## What changed

- Record daemon lifecycle and update stages with timings, outcomes, and typed OS errors, omitting error messages and context.
- Preserve the last 256 KiB of nonempty stderr logs before truncation and use append handles to prevent gaps during handoff. Preservation failures do not block launch.
- Attach current and previous updater log tails when log inclusion is enabled for a report, with a 512 KiB total limit and legacy filename fallback. Skip missing, empty, and nonregular files.

## Testing

Add regression coverage for diagnostic error redaction, bounded log preservation, append behavior during handoff, attachment selection, and updater logs in captured report uploads.

GitOrigin-RevId: 918317022ab9dcfd1b13d676872706c77e9ffbb2
2026-10-01 03:24:18 +00:00
Benjamin Carlsson e53e932dc8 Allow microphone channel selection for voice conversations (#49836)
## Why

Mixing every input on a multichannel audio device can include playback channels in microphone capture. Selecting only microphone inputs keeps those playback channels out of the captured audio.

## What changed

- Add `audio.microphone_channel` with one-based channel numbers, accepting a single value or an array such as `[1, 2]`. Leaving it unset preserves mixing of all inputs.
- Add an input-channel picker for the selected microphone when it has at least three channels. Require a nonempty selection and save it locally for the next voice conversation.
- Average only the selected channels, deduplicate selections, and reject empty or unavailable selections without falling back to other inputs.
- Clear saved channel selections when saving an input device and report configuration overrides that prevent the reset from taking effect.

## Testing

Add regression coverage for excluding playback channels, sample conversion, subset mixing, invalid selections, configuration loading, local persistence and overrides, and picker selection and cancellation. Update UI snapshots and verify channel selections are passed to the voice helper.

GitOrigin-RevId: 99960dcfa7b10cf38270768a90bb84a4be95a406
2026-10-01 02:59:26 +00:00
Eric Traut 08e2b58b07 Clarify service tier default save errors in the TUI (#49835)
## Why

When saving the default service tier fails, users need the underlying configuration error and guidance on how to retry without interrupting their task.

## What changed

Format the error with `format_config_error` and explain that the task can continue. Tell users to resolve the error, then switch to a different tier and back to the desired tier to retry saving the default.

## Testing

Add a snapshot assertion for a rejected service tier save caused by malformed configuration, covering the detailed error and recovery guidance.

GitOrigin-RevId: d666f7915f185d219396d24034412b175c49173e
2026-10-01 02:59:05 +00:00
sayan-oai 799324821d Box the resume future in the agents overview permissions test (#49822)
GitOrigin-RevId: c56597b54aee83d07a05f94258b420e81a859229
2026-10-01 02:16:27 +00:00
Eric Traut cda82a2c68 Recover daemon startup and updater re-exec after cwd deletion (#49819)
## Why

Managed daemons and updaters can outlive their launching directory. Restarts and updater replacement need to keep working after that directory is removed.

## What changed

- Share working-directory preparation between background launches and Unix updater re-execution. Fall back to the daemon state directory when the Unix working directory is missing, while retaining usable working directories and the existing Windows state-directory behavior.
- Preserve configured `CODEX_HOME` paths and valid symlink aliases, and make certificate and AWS environment paths absolute before launching children. Handle both `npm_config_cafile` and `NPM_CONFIG_CAFILE`, preserving supported home-relative values.
- Log warnings when scheduled daemon updates fail.

## Testing

Add Unix regression coverage for restarting the daemon and updater from a deleted working directory, and for updater re-execution with preserved environment paths, `CODEX_HOME` symlink aliases, and a Linux non-Unicode home path.

GitOrigin-RevId: f45aefd8ff060adc6e025badf0bb8c81f842bf88
2026-10-01 02:06:50 +00:00
Adam Perry @ OpenAI a73898c249 Use dedicated parameters for sandboxed file opens (#49818)
## What changed

Add `FsHelperOpenParams` with only a `path` field and use it for the exec-server filesystem helper's `fs/open` requests. Replace reuse of `FsReadFileParams`, removing unused read-file options from the open request type.

GitOrigin-RevId: ca84447d06fbf391cc5ad189ac6c46e6aeaa1f63
2026-10-01 02:06:27 +00:00
alexsong-oai a5eac80150 Add an advisory Bedrock GovCloud requirements check (#49817)
## What changed

Add the experimental `account/bedrock/checkGovCloudRequirements` RPC so clients can check the active Bedrock configuration after login or setup. It returns `isGovCloud` and `shouldWarn`, warning for GovCloud when managed requirements lack API-only login or enabled application network restrictions with an explicit allow entry for the active endpoint domain.

Reload configuration and requirements on each check while preserving the current session's authentication. Official Bedrock endpoint hostnames determine the region; otherwise, resolve it using the current authentication state. Non-Bedrock providers and commercial regions return both fields as `false`; configuration and region resolution failures return RPC errors. The check is advisory and does not block login or certify the entire network configuration.

## Testing

Add integration coverage for configuration and requirements updates without a restart, login changes, unreadable saved credentials, Mantle and Runtime endpoints, custom proxies, official endpoint region precedence, and invalid requirements.

GitOrigin-RevId: 24bfa91326cf5c73ada176c47351445de91b60a0
2026-10-01 02:06:05 +00:00
Benjamin Carlsson 1182834d13 Remove browser-open success messages from the TUI (#49816)
Stop adding an informational message to chat history when `open_url_in_browser` succeeds. Continue displaying an error when opening the browser fails.

GitOrigin-RevId: 28d33917c1a2e354017470e785e44aa0032c3b46
2026-10-01 02:05:43 +00:00
Owen Lin 8e44ad94b0 Add coordinated shutdown for local agent trees (#49814)
## What changed

Expose `ThreadManager::request_agent_tree_shutdown` and an `AgentTreeShutdown::wait` handle. Requests reject new starts in the shared runtime, cancel pending startup, and signal every session in that tree, including delegates outside the thread registry. Waiting covers admitted operations and session teardown, and reports cleanup or persistence writer failures. Other root trees remain unaffected; registry removal and persistence handoff remain caller responsibilities.

Retain tree membership through startup, cancelled spawn cleanup, residency eviction, and completion watchers. Release persistence resources before returning startup failures, and stop completion watchers during tree shutdown without reporting shutdown as a child result.

## Testing

Add coverage for tree isolation, children removed from the registry, delegate teardown, cancellation during required MCP initialization, aborted teardown, persistence writer failures, and successful retry after a failed resume releases its writer.

GitOrigin-RevId: a109e25adf23d20baf7595891099947050c6b6b5
2026-10-01 01:57:56 +00:00
alexsong-oai d4a475adda Support AWS GovCloud regions for Amazon Bedrock Mantle (#49813)
## Why

Codex rejected `us-gov-east-1` and `us-gov-west-1` as unsupported Amazon Bedrock regions.

## What changed

Accept both GovCloud regions and construct their regional Bedrock Mantle endpoint URLs.

## Testing

Extend the endpoint URL unit test to cover both GovCloud regions alongside the existing `ap-northeast-1` case.

GitOrigin-RevId: ef9ca83fa7b73af1df100fcae722e24edac38643
2026-10-01 01:56:24 +00:00
vkg-oai 0f8df3d214 Move shadow skill ranking off the turn preparation path (#49812)
## Why

Shadow skill selection runs synchronously during turn input construction, making turn preparation wait for experimental rankings.

## What changed

Run ranking on background blocking workers with a process-wide limit of two concurrent rankings. Wait for capacity in the background and hold each slot until its blocking worker finishes, even if the async evaluation is cancelled.

Freeze catalog, query, and relevance history at turn start. Record eligible invocations immediately for future turns, then score queued observations against the frozen rankings once they are ready, including observations queued before the turn state is dropped.

## Testing

Add tests for turn preparation and history updates while ranking is blocked, deferred invocation scoring against each turn's history, and shared ranking capacity that remains occupied until cancelled workers finish. Update existing metric assertions to collect asynchronous observations across snapshots.

GitOrigin-RevId: f7776e9aaeb45d3a792de167abbe35f7ec5a513e
2026-10-01 01:49:59 +00:00