Commit Graph

8133 Commits

Author SHA1 Message Date
Tamir Duberstein
3fe19fcd81 Resolve subagent analytics connections lazily (#38165)
## Why

Subagent-start facts can arrive before their parent's connection context is
recorded, leaving later analytics events without client metadata.

## What changed

- Resolve a thread's connection by walking its parent-thread chain when the
  connection was not captured directly.
- Use the resolved connection for subagent setup, tool-call analytics, and
  completed turn events.

## Testing

Extend the subagent analytics test to start the child before the parent context
arrives and verify both command-execution and dynamic-tool-call events.

GitOrigin-RevId: c4d74a22de34abd6c6c5df1717a49ae0e1a9445d
2026-08-12 10:24:34 +00:00
Owen Lin
4ef836f883 Distinguish rollout IDs from thread IDs (#38127)
## Why

`thread/revert` preserves a thread ID while creating a new immutable rollout. Rollout persistence and filesystem fallback therefore need to distinguish the logical thread from each physical history file.

## What changed

- Add a `RolloutId` alias and canonical filename parsing for both ordinary rollouts and reverted rollouts with a distinct rollout ID.
- Allow the recorder to create a replacement rollout without changing the thread ID, and add lookup by either the stable thread ID or an exact rollout ID.
- Index history references and compression safety checks by rollout ID so multiple rollouts for one thread remain distinct.
- Preserve the rollout path selected in SQLite when filesystem repair encounters another rollout for the same thread.

## Testing

Add coverage for filename round trips, replacement rollout metadata, thread and rollout lookup, reference indexing, compression, and database path preservation.

GitOrigin-RevId: 14b1d0b4a9432b341a1307afc0abadd507e7ae7d
2026-08-12 05:20:32 +00:00
Dylan Hurd
2230d64464 Route MCP tool calls through shared approval handling (#38108)
## What changed

- Represent MCP tool calls as approval actions and route them through the
  session-level approval flow for permission hooks, reviewer selection,
  rejection handling, and resolution telemetry.
- Preserve MCP-specific user prompts, session and persistent approval choices,
  and the approval policy and reviewer captured for the tool call.

## Testing

- Add coverage for permission hooks resolving MCP calls before user or
  automatic review, persistence choices, captured policy routing, and MCP turn
  metadata with strict automatic review enabled.

GitOrigin-RevId: 8e134b3d17a19dc62b3b56076d2cd05a54c9f638
2026-08-12 03:00:47 +00:00
Charlie Marsh
eb9dceba1a Avoid cloning MCP invocations in TUI history (#38103)
## What changed

Update MCP invocation formatting to borrow the invocation and its server and
tool names instead of cloning them when rendering TUI history cells.

GitOrigin-RevId: ac824d86d445215d6b730c6a28b4ec4dfc4f5b8c
2026-08-12 01:54:13 +00:00
wencongli-oai
c909d1bc04 Attach hosted app context to file uploads (#38101)
## What changed

- Include the connector ID, action name, and model in file creation requests for hosted app tool calls.
- Use the file size returned by upload finalization when available, while falling back to the local size for older server responses.
- Keep upload finalization requests empty for compatibility with older servers.

## Testing

- Cover hosted app upload metadata and legacy finalization responses.

GitOrigin-RevId: 1bc834736db4fe3515f8224965cde0e5d6955ca3
2026-08-12 01:45:20 +00:00
Dylan Hurd
ca4d532b2a Test Guardian context for code mode commands (#38094)
## What changed

Add integration coverage verifying that Guardian receives both the user prompt
and the outer code mode `exec` source when reviewing a nested escalated
`exec_command` call.

GitOrigin-RevId: e78e9d4d69e7ebccc935c548565a07600659f65a
2026-08-12 00:46:11 +00:00
Owen Lin
da2803c73c Simplify queued user message admission (#38092)
## What changed

- Resolve user message admission when Core accepts the input as a new turn or a steer, without waiting for rollout persistence.
- Remove persistence- and hook-specific admission errors and task bookkeeping.
- Delete queued messages after Core accepts them for turn processing, including messages subsequently stopped by a prompt hook.

## Testing

- Update concurrent admission and queue service tests for acceptance-based admission.

GitOrigin-RevId: 7dcc311cfecd3d710733b420f2add546edb86153
2026-08-12 00:41:53 +00:00
stevenlee-oai
4c89139da9 Add CIMD support to MCP OAuth registration (#38089)
## What changed

- Make automatic MCP OAuth registration prefer Client ID Metadata Documents
  (CIMD) when the authorization server advertises support for public clients and
  Codex is using its native loopback callback. Fall back to advertised Dynamic
  Client Registration (DCR) otherwise.
- Add explicit `cimd` and `dcr` registration overrides to the CLI and app-server
  OAuth login API. Validate CIMD metadata and callback URLs before starting the
  authorization flow.
- Use a callback-specific Codex client metadata URL for CIMD and retain the
  exact redirect URI through authorization and token exchange.

## Testing

- Cover automatic and forced CIMD selection, DCR fallback, invalid metadata and
  redirects, token refresh, authenticated MCP requests, and conformance
  regression checks.

GitOrigin-RevId: 4238372ca53b0f38e781e141ab5da97e0a6ddf45
2026-08-12 00:01:01 +00:00
Channing Conger
85f331772f Route gRPC code-mode sessions through the shared HTTP client (#38087)
## What changed

- Build URL-based gRPC code-mode connections with `HttpClientFactory` so they support the application's outbound proxy and custom CA configuration.
- Accept `http` and `https` origins while rejecting endpoints with unsupported schemes, paths, queries, or fragments.
- Preserve custom tonic channel injection and gRPC frame-size limits through the new transport adapter.

GitOrigin-RevId: 142f0b572b3ab0154e8fe860cb304752a9af5784
2026-08-11 23:40:07 +00:00
sayan-oai
f4936d7aba Support execution-host context when resolving cloud config (#38086)
## What changed

- Add a scoped `AbsolutePathBufGuard::with_home_directory` override so `~`
  paths can resolve against an explicitly supplied home directory while
  preserving the existing base-directory behavior. Nested overrides restore
  the previous home directory.
- Expose `compose_requirements_for_hostname` so callers can evaluate
  `remote_sandbox_config` for a supplied execution-host hostname.
- Cover cloud bundle conversion with execution-host path expansion and
  hostname-specific sandbox requirements.

GitOrigin-RevId: 6fd486992b45ff92e22bb4073b888252b544f285
2026-08-11 23:31:26 +00:00
Rasmus Rygaard
52d9218424 Allow empty input to start a turn (#38084)
## What changed

- Permit immediate user-message admission to start a turn when `Op::UserInput`
  has no items. The turn can proceed with its generated environment context and
  does not emit a user-message item.
- Continue rejecting empty input for persisted admission, where there is no
  user message to persist.

## Testing

- Cover successful empty-input turn admission and completion.
- Cover prompt rejection of empty persisted admission.

GitOrigin-RevId: d534cf0e228e3bc77f45fe6d9bd25c9073216fbd
2026-08-11 23:01:56 +00:00
mchen-oai
d7f4324492 Remove standard form input from app-server docs (#38083)
## What changed

Remove `openai/standard-form-input` from the documented app-server capability
extensions and initialization example. Continue to document `openai/form` for
extended form support.

GitOrigin-RevId: e1f313bec99a7fdc3462c8002181a8cdc48ad558
2026-08-11 22:44:07 +00:00
Dylan Hurd
67afc79674 Use ReviewDecision for MCP tool approvals (#38081)
## What changed

- Add `ApprovedMcpPolicyAmendment` to represent MCP approvals that persist across sessions.
- Route MCP approval responses directly through the shared `ReviewDecision` type while preserving session-only approvals, rejection reasons, timeouts, and cancellations.
- Reject the MCP-only policy decision if it reaches command, shell, network, or other tool approval paths.

## Testing

- Update MCP approval parsing, normalization, hook, and Guardian tests for the shared decisions.
- Verify generic tool approvals reject MCP policy amendments.

GitOrigin-RevId: b8cc931dc61d4c794915145273ede82b9eb30fc8
2026-08-11 22:25:14 +00:00
iceweasel-oai
7c47952f7c Allow nested Git repositories in the Windows sandbox (#38080)
## Why

Git rejects repositories owned by the primary user when commands run as the
sandbox user. Trusting only the enclosing worktree leaves nested repositories
unavailable.

## What changed

Add both the worktree root and its `/*` wildcard to Git's `safe.directory`
environment configuration. Update the directory and gitfile unit tests to
expect both entries.

GitOrigin-RevId: 4b8e2bc8cc52cff580451ffbd17eb71325957404
2026-08-11 22:22:18 +00:00
Tamir Duberstein
f317dc8a17 Reduce cloning in world-state patch handling (#38078)
## What changed

- Deserialize typed section snapshots directly from borrowed JSON values.
- Build and apply world-state merge patches in place instead of cloning and converting entire snapshots.
- Preserve the existing snapshot when a top-level patch has an invalid shape.

## Testing

- Extend the world-state merge-patch test to cover invalid top-level patches and verify that they leave the snapshot unchanged.

GitOrigin-RevId: 6c2212587b025a8dc3878008a0466d4526eee204
2026-08-11 21:28:35 +00:00
Tamir Duberstein
33aaf91366 Respect rendered width when adding TUI history (#38075)
## What changed

- Initialize new chat widgets with the current terminal width.
- Determine whether an added history cell is visible using the active history
  render mode and the width available after ambient-pet reservations.
- Saturate diff-summary width calculations so extremely narrow terminals remain
  renderable.

## Testing

- Cover width-sensitive history insertion with an ambient pet, raw-output mode,
  and a diff summary narrower than its indentation.

GitOrigin-RevId: 82d20900e0637431be7646b4f4aba61810ff74c1
2026-08-11 21:12:23 +00:00
rphilizaire-openai
a817d9424d Track implicit executor skill invocations (#38074)
## What changed

- Detect executor-owned skill document reads and script executions across native and URI-based working directories.
- Match skills only within the active execution environment while preserving host skill detection for local commands.
- Emit resource-backed implicit invocation events and deduplicate repeated accesses within a turn.

## Testing

- Add unit coverage for document reads, script executions, and environment-scoped matching.
- Add an integration test for environment selection, resource-backed analytics, and repeated-access deduplication.

GitOrigin-RevId: f78a48c3a4766fe8775bd88926b45a76761f6af8
2026-08-11 21:09:29 +00:00
Channing Conger
ba2fb48319 Forward gRPC code-mode callbacks to session delegates (#38072)
## What changed

- Subscribe each gRPC code-mode session to nested tool calls and forward tool and notification callbacks to its delegate.
- Complete tool calls through the host while bounding oversized results and errors.
- Track callback ownership and cancellation so completed cells drain notifications, terminated cells cancel them, and shutdown revokes outstanding work.
- Validate callback identifiers, cell ownership, enabled tools, and pending callback limits without serializing independent callbacks or sessions.

## Testing

- Add integration and state tests for callback forwarding, completion ordering, cancellation, malformed callbacks, delegate panics, oversized results, and concurrent work.

GitOrigin-RevId: 005afbb90eea0eb77d746b930a1a96ca6dfcd4e7
2026-08-11 20:40:26 +00:00
sayan-oai
b43de77679 Scope environment readiness config to thread attachments (#38067)
## Why

Threads that share an executor environment can require different capability roots and login-shell policies. Treating readiness configuration as executor-wide can expose one thread's settings to another.

## What changed

- Add `CodexThread::environment_ready` and `EnvironmentConfig` so hosts can install capability roots and login-shell policy for an exact thread, environment, and working-directory attachment.
- Validate attachment readiness updates, merge ready attachment roots with persisted thread roots, and refresh MCP capabilities when those roots change.
- Preserve installed environment policy across thread settings updates and child-thread inheritance while resetting it when the selected working directory changes.

## Testing

- Cover attachment config inheritance and reset behavior.
- Verify that threads sharing an executor retain independent model-visible capability roots and login-shell tool schemas across updates.

GitOrigin-RevId: 60e7a296b3e41b835b0413aa2837451e8a55c230
2026-08-11 19:58:10 +00:00
rphilizaire-openai
c8f673fddc Track resource-backed skill invocations (#38066)
## What changed

- Emit skill invocation analytics when a resource-backed skill is explicitly selected or its main resource is successfully read from the first page.
- Preserve provider-supplied skill IDs and user scope when available, and derive a stable ID from the main resource otherwise.
- Deduplicate repeated implicit reads of the same main resource within a turn.

## Testing

- Extend the orchestrator skill integration test to cover explicit and implicit invocation events, stable fallback IDs, failed reads, and repeated-read deduplication.

GitOrigin-RevId: 7d8453b31b5a2205847e65cda2c46183d6c97b45
2026-08-11 19:52:54 +00:00
zm-oai
104e25ac5a Grant Windows sandbox access to the Codex app root (#38064)
## What changed

- Apply the sandbox read/execute ACL to the local Codex application root so it
  inherits across its contents, while continuing to handle the managed runtime
  cache separately.
- Skip missing paths, non-directories, and directory reparse points before
  inspecting or updating ACLs.
- Update the runtime path test to expect the application root.

GitOrigin-RevId: 34f2946d2140f8ea2b76c449b0e5542b99cb6f70
2026-08-11 19:48:38 +00:00
iceweasel-oai
853d98b6b0 Preserve proxy settings for Windows sandbox debug sessions (#38061)
## What changed

Run Windows `codex sandbox` debug commands without reconciling persistent proxy settings established by another sandbox launch.

GitOrigin-RevId: d939c18f4f8d3daa69938136ba79c60c7f4afee2
2026-08-11 19:41:23 +00:00
Eric Traut
46c3268542 Disable storage for Azure Responses requests (#38060)
## What changed

- Set `store` to `false` for every Responses request, including requests sent
  through Azure providers.
- Remove the provider-specific storage check and simplify request construction.
- Update the Azure request test to verify that storage is disabled while
  prefixed item IDs remain unchanged.

GitOrigin-RevId: 1c71cb80880058cb26789112f03269b73f0645b9
2026-08-11 19:35:05 +00:00
rka-oai
3a6f747d77 Preserve harness metadata across conversation history (#38058)
## What changed

- Wrap response items with optional harness-owned metadata while keeping the persisted response payload shape backward compatible.
- Store compacted-history metadata in an aligned sidecar and reject malformed sidecars.
- Carry metadata through history normalization, compaction, resume, fork, truncation, migration, and rollout recording without sending it to model providers.

## Testing

- Cover legacy rollout compatibility, metadata serialization and validation, compaction retention, and resume/fork reconstruction.

GitOrigin-RevId: 17a6127c9048ff984cb4df4d97c0751a38c29f5f
2026-08-11 19:30:12 +00:00
edwardysun3
44d992c14e Track artifact operations from trusted plugin markers (#38057)
## What changed

- Recognize validated create and edit marker commands from the trusted presentations, documents, spreadsheets, and PDF plugins.
- Emit a `codex_artifact_operation` analytics event plus started-count and expected-output-count metrics when a recognized marker starts through unified exec.
- Attribute remote executor commands only when their plugin cache path and script contents match a trusted local plugin, including primary-runtime plugins.

## Testing

- Cover supported marker combinations and reject mismatched plugins, paths, arguments, counts, and output formats.
- Cover local, relocated remote, and Windows-style plugin attribution, including rejection of modified remote scripts.

GitOrigin-RevId: 475cc1689aa7f371a24dec0a8bdb6f7fd5a2e922
2026-08-11 19:26:41 +00:00
stevenlee-oai
285abc0368 Configure PSP routing through the feature system (#38056)
## What changed

- Add the under-development `psp` feature and expose it in the config schema.
- Use the feature to attach the PSP cookie to first-party ChatGPT clients.
- Remove the hidden `--psp` flag and its process-scoped configuration plumbing.
- Preserve configured ChatGPT cookies when creating the PSP client used for GET and POST requests.

## Testing

- Update the config manager service test to verify that enabling `features.psp` retains the setting in the effective config and configures the expected ChatGPT cookie.

GitOrigin-RevId: 53acb5495d2ff71e4ed25f674a0cff787aea474a
2026-08-11 19:16:15 +00:00
cooper-oai
b28aa476f4 Add configuration-backed external authentication (#38054)
## What changed

- Add a host-owned external auth source that runtime account APIs cannot replace,
  clear, or log out, and keep its credentials process-local instead of writing
  them to auth storage.
- Let configured providers classify refresh failures. Preserve cached credentials
  after permanent reload failures while retaining transient behavior for runtime
  providers.
- Compare external ChatGPT token data when detecting auth changes so a refreshed
  access token is applied to a retried request.

## Testing

- Cover configured-auth immutability, process-local storage, permanent reload
  failures, runtime error classification, and refreshed headers after a `401`.

GitOrigin-RevId: c6d70a39325c8ba6ca65ae68e12b55609f00a876
2026-08-11 19:04:07 +00:00
stevenlee-oai
6dc3ac8721 Add per-login MCP OAuth client registration selection (#38052)
## What changed

- Add `--oauth-client-registration` with `auto` and `dcr` choices to `codex mcp add` and `codex mcp login`.
- Add the equivalent optional `clientRegistration` field to `mcpServer/oauth/login` and the generated protocol schemas.
- Keep automatic dynamic client registration as the default, prefer a configured OAuth client ID when present, and apply the selection only to the current login without persisting it in MCP configuration.

## Testing

- Cover dynamic registration and configured-client OAuth flows through the app server.
- Verify the CLI does not persist the per-login registration choice.

GitOrigin-RevId: 653a4a1054ff43c2c5d52ae863b6a96d21692a53
2026-08-11 18:35:03 +00:00
Winston Howes
eea28321ad Harden network proxy credential brokerage (#38049)
## What changed

- Bind OpenAI credentials to `api.openai.com` and trusted HTTPS hosts derived from local configuration or `OPENAI_BASE_URL`.
- Support GitHub credentials for `uploads.github.com` and translate Bearer, token, and Basic authorization forms while preserving their schemes.
- Apply credential broker configuration changes without restarting the proxy, including clearing affected credential mappings when trusted OpenAI hosts change.
- Restore brokered credentials in environments and command arguments that intentionally leave managed networking, while preserving user overrides and handling Windows environment keys case-insensitively.
- Keep local credential brokerage out of remote proxy launch configuration and avoid launching a remote proxy when brokerage alone enabled the local proxy.

## Testing

Added coverage for trusted host binding, authorization translation, live reconfiguration, credential restoration, managed-disabled behavior, remote launch configuration, and Windows environment key matching.

GitOrigin-RevId: 8d8bd3aaf6e581849cb622b2faec62cee4e13e52
2026-08-11 18:21:34 +00:00
Bryan Ashley
d6ca19d99b Add turn-aware response item injection (#38047)
## What changed

- Add `inject_response_items_for_turn` for callers that inject Responses API
  items immediately before admitting user input. It defers the rollout flush so
  the injected items and user input are persisted together by turn admission.
- Keep `inject_response_items` behavior unchanged by flushing after it delegates
  to the new helper.
- Update the turn-start persistence test to exercise the turn-aware path.

GitOrigin-RevId: 8349b65f937af2b2a95d36b3fd73d862d38e5fd9
2026-08-11 18:14:09 +00:00
sayan-oai
f2a6f2585c Include auto-review state in turn metadata (#38046)
## What changed

- Add `auto_review_enabled` to serialized turn metadata for regular and review turns.
- Derive the value from approval-policy routing and reserve the metadata key so client-provided metadata cannot override it.

## Testing

- Cover enabled metadata, reserved-key handling, Guardian review requests, and updated compaction request snapshots.

GitOrigin-RevId: 52773e2bf7d4be251f8466332de9f9c9869dd084
2026-08-11 18:06:05 +00:00
rka-oai
99915080b6 Store model history in response item envelopes (#38045)
## What changed

- Add `ResponseItemEnvelope` as the history-owned wrapper for a `ResponseItem`.
- Store envelopes in `ContextManager` while keeping raw-item iteration and consuming APIs for existing callers.
- Preserve envelopes when compaction and history normalization rewrite retained items, and wrap newly synthesized items.

## Testing

- Cover envelope access, mutation, and conversion back to raw response items.
- Cover annotated history replacement and annotated user-message collection for compaction.

GitOrigin-RevId: 3fa2e7bdd981b08cc7aec410c80deccaecdabab4
2026-08-11 17:58:11 +00:00
Eric Traut
be751dd1df Compact code mode tool calls in TUI history (#38044)
## What changed

- Render `node_repl.js` calls in conversation history with their title and the meaningful output from successful executions.
- Keep the full invocation and raw result available in the `Ctrl+T` transcript, including failure details.

## Testing

- Add snapshots covering successful and failed code mode calls in both history and transcript views.

GitOrigin-RevId: c8e24c2eae5e60020e9e8136f386590ca7c42367
2026-08-11 17:52:09 +00:00
iceweasel-oai
34db7e5563 Sandbox remote apply_patch operations (#38043)
## Why

Cross-platform remote `apply_patch` calls were rejected when filesystem writes
were restricted because patch verification and writes could not be safely
performed against executor files.

## What changed

- Route intercepted and direct remote patches through the executor-managed
  filesystem sandbox, including the configured workspace roots.
- Select the restricted-token sandbox for Windows executor paths when no
  Windows sandbox level was configured.
- Fail closed when an executor cannot enforce the requested sandbox, and treat
  executor-managed access failures as sandbox denials so approval can retry the
  patch without sandboxing.

## Testing

- Cover sandboxed remote patches, denied writes, approval retries, Windows
  sandbox selection, and executor filesystem enforcement.

GitOrigin-RevId: caddeed0b266c456a689080a14a3a58e2bd7887c
2026-08-11 17:47:22 +00:00
Channing Conger
1e557a554e Add gRPC-backed code-mode sessions (#38041)
## What changed

- Add `GrpcCodeModeSessionProvider` for opening code-mode sessions over HTTP/2 or an existing `tonic` channel.
- Support execution, waiting, termination, per-session limits, cell-closure callbacks, and graceful shutdown over the gRPC protocol.
- Bound transport waits and error messages, validate host identifiers and responses, and clean up abandoned executions and observers.

## Testing

- Add end-to-end TCP tests covering session persistence, cancellation, concurrent waits, shutdown, cell cleanup, and independent yield limits.
- Add unit coverage for protocol conversion, deadlines, and session lifecycle state.

GitOrigin-RevId: d4729ce608ad4b42a99744b07e1f230e46cb24ec
2026-08-11 17:31:11 +00:00
Eric Traut
b2543af02b Propagate custom CA settings to local MCP servers (#38040)
## Why

Local stdio MCP servers may start in a different working directory from Codex,
so inherited relative CA bundle paths can otherwise resolve to the wrong file.

## What changed

- Forward the supported custom CA environment variables to local stdio MCP
  servers, convert inherited non-empty paths to absolute paths, and let explicit
  MCP environment overrides take precedence.
- Match CA variable names and `PATH` case-insensitively where required, avoiding
  duplicate environment entries and preserving executable discovery on Windows.

## Testing

- Add an end-to-end stdio MCP test covering relative inherited CA paths, empty
  values, explicit overrides, alternate key casing, and a different server
  working directory.
- Exercise executable resolution with Windows-style `Path` casing.

GitOrigin-RevId: ea1bc0ae63bc0dc780acb8363b2ed102120f282e
2026-08-11 17:24:04 +00:00
Tamir Duberstein
dad1db87bb Limit TUI streaming traces in SQLite logs (#38036)
## Why

Per-chunk streaming traces can flood the bounded SQLite log queue.

## What changed

- Persist `codex_tui::streaming::controller` and
  `codex_tui::streaming::table_holdback` events at `DEBUG` and above.
- Keep `TRACE` events enabled for other TUI streaming targets.

## Testing

Extended the SQLite log filter test to cover dropped streaming traces, retained
debug diagnostics, and unaffected streaming targets.

GitOrigin-RevId: e7eb999a0770eba6cce5f389005896e64928f02b
2026-08-11 17:07:24 +00:00
Tamir Duberstein
e20616d265 Propagate MCP elicitation event delivery failures (#38035)
## Why

When the event receiver is closed, an MCP elicitation request cannot reach its
consumer. Ignoring that delivery failure leaves the request and its lifecycle
registration pending while waiting for a response that cannot arrive.

## What changed

Return a contextual error when an MCP elicitation event cannot be delivered.
This drops the pending-request guard immediately, removing the responder from
the router and releasing its lifecycle registration.

## Testing

Add a regression test that closes the event channel and verifies the request
fails immediately, the router is empty, and the lifecycle registration is
released.

GitOrigin-RevId: 1067f35a5775d61c5bcd07b4b190d3907d8f219a
2026-08-11 16:31:30 +00:00
Tamir Duberstein
ed390a5dc4 Filter live rollout items in place (#38034)
## What changed

Retain persistable items directly in the owned append buffer instead of cloning
them into a second vector. Preserve the existing history-mode filtering and
empty-append behavior.

GitOrigin-RevId: 5300312545492bef28f63521427048a27d46a9d1
2026-08-11 16:27:58 +00:00
Tamir Duberstein
4496ba3fd5 Use session metadata to validate thread history paths (#38033)
## What changed

Validate a SQLite thread's rollout path by reading its `SessionMetaLine` and
comparing the recorded thread ID directly. This avoids constructing a
`StoredThread` solely to decide whether the path can supply the requested
history.

GitOrigin-RevId: 8eb1e329514cefc056e44ab4a76d58ff50314a97
2026-08-11 16:20:12 +00:00
Eric Traut
8f4a2c99dd Hide approved Guardian assessments from TUI history (#38032)
## What changed

- Silently complete approved Guardian assessments after clearing their live
  review status, instead of adding an approval entry to conversation history.
- Continue rendering denied and timed-out assessments in history.

## Testing

- Update TUI snapshots to verify that approved command and permission-request
  assessments add no history entry and that the status returns to `Working`.

GitOrigin-RevId: 32df1f2e3d4e23f0b792dcfdfcf7fbe95f33c703
2026-08-11 16:16:43 +00:00
jif
1dac3d9ca0 Fail closed on unsafe Linux unreadable globs (#38026)
## Why

Linux sandbox unreadable globs without a non-root directory prefix cannot be safely expanded because they would require scanning from `/`. Silently skipping these patterns leaves the requested deny-read rule unenforced.

## What changed

Return a fatal sandbox construction error when an unreadable glob cannot be split into a safe ripgrep search root. The error directs callers to use a pattern with a non-root directory prefix.

## Testing

Add a regression test confirming that `/**/*.env` rejects Bubblewrap command construction.

GitOrigin-RevId: 2f3cb398d39a9bc077d3a1b74e08dc506d239e60
2026-08-11 15:52:59 +00:00
arun eswara
edcec13372 Expose image generation usage-limit failures (#38024)
## What changed

- Add structured `usageLimitExceeded` metadata to failed image-generation
  items, including the image limit ID and optional reset timestamp.
- Preserve the failure metadata in completion events, app-server thread
  history, thread reads and resumes, and migrated legacy rollouts.
- Export the new failure type in the generated JSON and TypeScript schemas.

## Testing

- Cover usage-limit responses through item completion, persistence, and thread
  resume.
- Verify legacy rollout migration retains image-generation failure metadata.

GitOrigin-RevId: 91c31a2a47456b6b916ee03002ff314b05946dd4
2026-08-11 15:40:52 +00:00
richardopenai
4c5fc230a9 Retry transient exec-server startup failures (#38020)
## Why

A retryable failure during the initial remote exec-server connection left the
environment disconnected on subsequent readiness checks.

## What changed

Route retryable startup errors through the existing reconnect path. This lets
later `get()` and `wait_until_ready()` calls establish a replacement client,
while concurrent callers share the same reconnect attempt.

## Testing

Add a WebSocket test that fails the initial handshake, then verifies that later
readiness and client requests share a successful replacement connection.

GitOrigin-RevId: 82d425af0a73331884439b4350a7a1052d4ae865
2026-08-11 15:33:52 +00:00
jif
279b93242c Remove config lockfile support (#38011)
## What changed

- Remove effective-config lockfile export, replay, and validation from session startup.
- Remove the `debug.config_lockfile` settings and generated schema entries.
- Remove feature-config materialization helpers that were only used to create lockfiles.

GitOrigin-RevId: a8c07c1c06325b3ec3dae9a97c36c2488d37df25
2026-08-11 13:52:48 +00:00
felixxia-oai
3d4d253f8f Stop re-exporting skill APIs from codex-core (#37984)
## What changed

- Import skill metadata and mention helpers directly from `codex-skills`.
- Import host skill loading types directly from `codex-skills-extension`.
- Make the remaining `codex-core` skills module private and remove its skill API re-exports, including the `HostSkillsService` re-export from `codex-core-api`.

GitOrigin-RevId: 26bf8fffd980df9c4d0c308d7e983ceab9a5df82
2026-08-11 10:43:11 +00:00
felixxia-oai
7d486ffa94 Honor per-directory bundled skill settings in skills/list (#37979)
## Why

`skills/list` can load multiple working directories in one request, but bundled
skill discovery did not account for different effective configurations across
those directories.

## What changed

- Resolve `skills.bundled.enabled` from each load input's effective config layer
  stack inside the host skills service.
- Include or exclude system-scoped skills for each working directory based on
  that resolved setting.
- Keep bundled skills enabled by default when the setting is absent or invalid.

## Testing

- Add a multi-directory `skills/list` test with bundled skills disabled in one
  project and enabled in another.
- Add config-layer tests for defaults, overrides, and malformed bundled-skill
  configuration.

GitOrigin-RevId: e4e97dc7d0a374ac71d0aa11e55a9e337f661717
2026-08-11 10:20:54 +00:00
jif
0ca439900e Cache tool catalogs for streamable HTTP MCP servers (#37970)
## Why

Subagents should be able to use known HTTP MCP tool definitions without opening a connection until a tool is actually called.

## What changed

- Add streamable HTTP configurations to the process-scoped MCP tool catalog cache when their authentication identity can be derived safely.
- Fingerprint transport settings, relevant environment variables, protocol mode, plugin status, and client capabilities so catalogs are reused only across equivalent connections.
- Keep OAuth and other dynamically resolved credential configurations out of the shared cache.

## Testing

- Add an integration test proving that a subagent receives cached HTTP tools without reinitializing the server, then starts its own connection when it calls one.

GitOrigin-RevId: bb2787e29e9b71993def31aafd1f0d8f1b728d26
2026-08-11 09:22:50 +00:00
rka-oai
41ece455b7 Validate images before returning view_image output (#37939)
## What changed

- Reject invalid or unsupported image data before producing tool output, so
  non-image file contents are not exposed through code mode.
- Preserve valid image bytes and metadata while leaving image preparation and
  resizing to the history insertion path.

## Testing

- Cover invalid images in both code mode and standard `view_image` calls.
- Verify that code mode preserves PNG bytes, dimensions, EXIF orientation, and
  metadata.

GitOrigin-RevId: 07343ed10b781d0ce0ffb5b24432658be4c046e3
2026-08-11 05:32:28 +00:00
Adam Perry @ OpenAI
2cc9dbb984 Add shared runtime build information (#37929)
## What changed

- Add `codex-build-info` to resolve a packaged runtime's semantic version from `codex-package.json` while preserving the commit stamped into the executable.
- Represent source builds as version `0.0.0` and expose helpers for display, serialization, and source-build detection.
- Stamp `STABLE_GIT_COMMIT` into final Bazel Rust binaries so Git changes do not invalidate the shared library graph.

## Testing

- Cover packaged, source, legacy, and invalid-version resolution, plus serialization round trips.

GitOrigin-RevId: 669b02449644c738ba2946a1b7aafe4ec31a9edb
2026-08-11 03:39:02 +00:00