Commit Graph

1947 Commits

Author SHA1 Message Date
Shijie Rao
230791fd1f Persist active permission profiles in turn context (#39145)
## What changed

- Add the optional `active_permission_profile` field to `TurnContextItem` to record the built-in or named profile that produced the effective permission profile.
- Populate the field when serializing a turn context while preserving compatibility with records where it is absent.

## Testing

- Add coverage verifying that turn-context serialization stores the active permission profile.

GitOrigin-RevId: d69142ab1b26595ab406235f89818ef41370e963
2026-08-18 05:46:08 +00:00
Matthew Zeng
de7bbb0481 Hydrate recommended plugin metadata on selection (#39143)
## What changed

- Fetch recommendations from the Codex-specific `/ps/plugins/suggested/codex` endpoint and parse its compact response shape.
- Fetch the selected plugin's details before presenting an install request, using them to verify availability and populate connector metadata.
- Skip install elicitation when the selected recommendation is no longer available, and return a retryable response when its metadata cannot be verified.

## Testing

- Cover the new recommendation route and response shape.
- Cover metadata hydration for available plugins and rejection of unavailable plugins.

GitOrigin-RevId: 2b0e2d70572aae2b7cd8e458b42e9dd14be3dbaf
2026-08-18 05:42:39 +00:00
Charlie Marsh
f97e775693 Fail closed on deeply nested command wrappers (#39122)
## Why

Dangerous-command inspection has a bounded wrapper depth. Returning no match
after that limit could let a nested dangerous payload escape policy detection.

## What changed

- Classify commands beyond the wrapper-depth limit as dangerous.
- Cover the boundary and overflow cases in the command-safety unit tests.
- Verify that exec policy rejects a deeply `env`-wrapped forced `rm` before it
  can delete a sentinel file when approvals are disabled.

GitOrigin-RevId: a6cdbbb7bdc6274a62745f668189fabaaf46745f
2026-08-18 02:23:57 +00:00
willwang-openai
fc6268ad38 Read plugin authentication state from AuthManager (#39087)
## What changed

- Give `PluginsManager` a shared `AuthManager` instead of a separately mutable authentication-mode snapshot.
- Read the current authentication mode and credentials from that shared manager for plugin discovery, startup tasks, CLI commands, MCP setup, and external-agent migration.
- Update test helpers and coverage to exercise plugin projections and curated marketplace selection as authentication changes.

GitOrigin-RevId: 600c94de5130eda2da5727e1a0b4d39083fefc56
2026-08-17 22:26:27 +00:00
iceweasel-oai
2013e04354 Preserve filesystem permission path conventions (#39084)
## Why

Filesystem permission paths can use a convention that differs from the host
running Codex. Converting them immediately to native absolute paths can change
the meaning of ambiguous paths such as `/C:/secret` or Windows UNC paths.

## What changed

- Store literal filesystem permission paths as `PathUri` values through the
  runtime policy and execution protocol.
- Keep legacy string-based serialization at explicit protocol boundaries and
  reject conversions that cannot be represented losslessly.
- Encode native paths as opaque URIs when a normal file URI would imply the
  wrong path convention.

## Testing

Added coverage for cross-platform and ambiguous path round trips, UNC path
variants, permission-profile serialization, and deny-policy enforcement.

GitOrigin-RevId: 5247713796d1f2bb4e02f94eb9fc82d4698060f0
2026-08-17 21:49:30 +00:00
Andrew Wilkes
682f57254f Persist generated images through turn executors (#39072)
## Why

Image generation did not save its result when the extension host did not provide a host-local save root.

## What changed

- Save generated images under the turn environment's `generated_images` directory through its sandboxed filesystem executor when no host save root is configured.
- Limit executor-written images to 32 MiB, reject symlinked output directories and existing destinations, and continue returning the image if persistence fails.
- Include the saved workspace path in the tool output hint while preserving host-managed persistence when a save root is available.

## Testing

- Extend the granted-turn-permissions integration test to verify the image and path hint are written to the turn workspace without creating a host-local artifact.

GitOrigin-RevId: 3d24381a75fe4595641b5250e19fac8ed473b2cd
2026-08-17 20:32:41 +00:00
sayan-oai
4a7b51c560 Add network policy metadata to environment configuration (#39055)
## What changed

- Add `EnvironmentNetworkPolicy` as a serializable view of portable domain,
  Unix-socket, upstream-proxy, and local-binding restrictions without exposing
  controller-owned proxy runtime settings.
- Add an optional `network_policy` field to `EnvironmentConfig` and re-export
  the policy and related permission types through the core APIs.
- Reject owner-provided network policies during environment preview and
  readiness until runtime enforcement is implemented, while preserving the
  existing controller policy when the field is absent.

## Testing

- Cover rejection through both environment preview and readiness, including
  preservation of the existing environment selection.

GitOrigin-RevId: 80ad4cf4d4a45632daa7a823e6cf568eb0e8bb80
2026-08-17 19:22:45 +00:00
iceweasel-oai
d0fd4e830a Preserve foreign paths in managed network approvals (#39040)
## Why

Unified exec could drop network approval registration when a selected environment used a Windows working directory on a non-Windows host because the trigger path could not be converted to a host absolute path.

## What changed

- Keep network approval trigger working directories as `PathUri` values and render them with their inferred native path syntax for Guardian requests.
- Fall back to the selected turn environment only when a trigger path can be converted to a host absolute path.
- Reject selected environment working directories larger than 8 KiB at the thread-manager validation boundary.

## Testing

- Cover managed-network approval registration for a foreign Windows working directory.
- Verify that oversized working directories are rejected as invalid `thread/start` requests.

GitOrigin-RevId: 646fbf12115a35a7e5cb04b511464797bee6647b
2026-08-17 18:15:56 +00:00
felixxia-oai
02e9bfaac7 Disable Guardian V2 for managed automatic reviewers (#39005)
## Why

Guardian V2 should not override a managed approval-reviewer policy that excludes
the user reviewer.

## What changed

- Force `features.guardianv2` off when `allowed_approvals_reviewers` does not
  include `user`, for both local requirements and cloud config bundles.
- Preserve Guardian V2 when the user reviewer remains allowed or when only
  legacy Guardian feature settings are present.
- Return the effective disabled value through `config/read`.

## Testing

Added coverage for cloud requirements and the app-server config RPC.

GitOrigin-RevId: 82b6d0aaf47fbaa58ae349d4e56777cd442f5807
2026-08-17 13:16:05 +00:00
felixxia-oai
8bf50439f2 Source Guardian v2 defaults from the model catalog (#38990)
## What changed

- Add optional `guardian_v2` model-message defaults for classifier instructions,
  review thresholds, reasoning effort, transcript selection and limits, and
  action and compaction token limits.
- Apply those defaults when Guardian v2 samples a tool call, while preserving
  explicit `[features.guardianv2]` settings over catalog values.
- Preserve the new catalog configuration when applying model overrides.

## Testing

- Cover model-catalog serialization and model override behavior.
- Verify that sampling uses catalog defaults while retaining local overrides.

GitOrigin-RevId: 4ae9ec235c647acbca05a20b7c4b87a4e1331161
2026-08-17 11:44:56 +00:00
jif
632e35ce8d Add a configurable skill catalog token budget (#38978)
## What changed

- Add `[skills].max_context_tokens` to override the token budget used to render the available-skills catalog.
- Require a positive value and cap configured budgets at 10,000 tokens.
- Preserve the existing default of 2% of the model context window when the option is unset.

## Testing

- Cover configuration parsing, override behavior, the 10,000-token cap, and catalog rendering within the configured budget.

GitOrigin-RevId: f29ddcb57fc2d800c0006d03e1c33cbe3ab6272d
2026-08-17 10:01:59 +00:00
sayan-oai
e38290846c Enforce environment-specific command policies (#38942)
## What changed

- Add an optional restrictive execution policy to `EnvironmentConfig` and merge it over the active command policy for shell execution and approval decisions.
- Reject environment policies that contain allow rules, so environment configuration can only tighten command access.
- Include the environment policy fingerprint in cached approval keys so policy changes require fresh session approvals.

## Testing

- Cover restrictions overriding saved prefix approvals, policy changes invalidating session approvals, and environment overlays remaining effective when model-specific prefix filtering is active.

GitOrigin-RevId: e94f877549ed5e0f577b8cb52f3c1872c58f029d
2026-08-17 04:37:50 +00:00
Anton Panasenko
89e297729e Prevent Noise auth tokens from reaching child processes (#38941)
## Why

`CODEX_EXEC_SERVER_NOISE_AUTH_TOKEN` is an execution-server credential and
must not be exposed to model-reachable commands or command hooks, including
when shell environment policy explicitly sets a case variant of the name.

## What changed

- Add `CODEX_EXEC_SERVER_NOISE_AUTH_TOKEN` to the shared list of
  non-inheritable environment variables.
- Keep the environment variable constant in `codex-protocol` so the exec
  server and environment scrubber use the same definition.
- Verify case-insensitive removal after policy overrides for shell commands
  and command hooks.

GitOrigin-RevId: 759b224b6a7fb4f56f7b1a6d94ffbb0b188c658f
2026-08-17 04:17:45 +00:00
Anton Panasenko
3b4569a920 Add experimental app-server project APIs (#38940)
## What changed

- Add SQLite-backed `project/list`, `project/read`, `project/create`,
  `project/import`, `project/update`, `project/move`, and `project/delete`
  endpoints with ordered roots, metadata, manual positioning, pagination, and
  idempotent creation.
- Add project assignment to thread start, metadata updates, list filtering,
  and fork inheritance. Project deletion clears assignments without deleting
  threads.
- Emit `project/changed` and `thread/project/updated` notifications after
  committed changes, and export the new protocol schemas and TypeScript types.

## Testing

- Cover project lifecycle and ordering, idempotency, atomic imports, cursor and
  filter validation, thread assignment, deletion, and fork inheritance.

GitOrigin-RevId: 47ae621be01ab8ef70a74a629fb29a5c5709ea33
2026-08-17 04:01:37 +00:00
sayan-oai
6c108912ee Honor per-environment shell variable policies (#38902)
## What changed

- Carry `ShellEnvironmentPolicy` in each resolved `EnvironmentConfig` and use
  the selected turn environment's policy for shell commands, user shell tasks,
  and unified exec.
- Infer the policy from the thread configuration when an environment does not
  provide its own resolved configuration.
- Redact the policy from `EnvironmentConfig` debug output because it can contain
  explicit environment variable values.

## Testing

- Verify shell handlers and unified exec filter inherited variables according
  to the selected environment while preserving its explicit overrides.

GitOrigin-RevId: 9f6a52aa4af60e5f17251a0e1b11e1926b779055
2026-08-16 20:35:05 +00:00
Anton Panasenko
fcdae21073 Support metadata staging for reserved thread IDs (#38819)
## Why

Callers need to associate host-owned state with a thread before Core starts it.

## What changed

- Add `ThreadManager::reserve_thread_id` and allow new threads to start with the reserved ID. Reject reserved IDs when resuming an existing thread.
- Let thread stores stage metadata for a reserved ID. The local store merges staged values into the first successful metadata update and then removes them.
- Clear staged metadata when an unmaterialized thread shuts down or is discarded, and require the state database for staging.

## Testing

- Cover reserved ID generation and resume validation.
- Cover metadata persistence, merging, rollout-compatible updates, cleanup, and invalid staging requests.

GitOrigin-RevId: 3f9bc48f0f7764011cc90ea01349e497dda0a9e3
2026-08-16 00:57:28 +00:00
joeflorencio-openai
00f6a8a60e Keep active-turn model settings stable across updates (#38785)
## Why

Thread settings can change while a turn is still active, including between sampling requests. Those updates should apply to the next turn instead of changing the model configuration partway through the current turn.

## What changed

- Snapshot the model, reasoning settings, service tier, approval settings, and model-attributed telemetry in `StepContext`.
- Build prompts, model requests, world state, tracing, and startup prewarms from that step-scoped snapshot.
- Share immutable model metadata between turn and step contexts.

## Testing

Added an integration test that pauses an active turn, updates its thread settings, and verifies that all requests in the active turn retain the original settings while the next turn uses the updates.

GitOrigin-RevId: c51352218e463dcc9b7338566d16742292c49fbf
2026-08-15 16:58:08 +00:00
Dylan Hurd
53f3fa7496 Route permission requests through shared Guardian approvals (#38701)
## What changed

- Represent `request_permissions` calls as shared approval actions and convert them into Guardian permission requests through the common approval path.
- Preserve turn cancellation while an automatic permission review is pending.
- Cover Guardian allow and deny decisions, cancellation without a user-approval fallback, and clean follow-up turns.

GitOrigin-RevId: 95d0df0288e232f32b162756aa7d64a30df7efa5
2026-08-15 05:09:19 +00:00
sayan-oai
2ca575026c Support pending environment attachment configuration (#38684)
## Why

An environment connection can be available before its owner has supplied the
configuration for a particular thread attachment. Threads need to start without
blocking while ensuring turns do not use that attachment prematurely.

## What changed

- Accept `Pending` environment configuration and resolve each attachment only
  after both its shared executor connection and owner configuration are ready.
- Add a `Failed` configuration state and `environment_failed` callback so an
  owner can fail one thread's attachment without affecting other threads.
- Keep pending and failed attachments out of capability-root inspection and turn
  environments, and allow failed attachments to recover through a ready update.
- Apply owner configuration before waking a waiting turn so its permission
  profile, login-shell policy, capability roots, and tools are immediately
  consistent.

## Testing

Add an integration test covering non-blocking thread startup, independent ready
and failed callbacks, waiting-turn resumption, installed capability and tool
configuration, and recovery from failure.

GitOrigin-RevId: d587e2025d584c867d782d470b18bf5a1a27b76c
2026-08-15 01:39:04 +00:00
Dylan Hurd
4e9a1a9073 Preserve HTTP fallback for delegated sessions (#38681)
## Why

Responses WebSocket fallback is session-scoped. A delegated session created
after its parent switched to HTTP could otherwise make another WebSocket
connection attempt.

## What changed

Disable WebSocket support for a delegated session when the parent session has
already fallen back to HTTP.

## Testing

Add a guardian review regression test that verifies only the parent's initial
WebSocket attempt occurs and the guardian request uses the HTTP response path.

GitOrigin-RevId: 1345f8fe739f55975aef432045348eae5a9278d6
2026-08-15 01:24:46 +00:00
sayan-oai
22bf16a37e Preserve environment configuration ownership (#38678)
## Why

Environment attachments can either inherit configuration from their thread or
provide their own. Later thread setting updates must refresh inherited
configuration without overwriting attachment-owned permissions and capability
roots.

## What changed

- Resolve each attachment's configuration when it is selected and retain
  whether it came from the thread or the attachment owner.
- Apply subsequent thread configuration updates only to thread-owned
  attachments, while preserving ownership across snapshots and child threads.
- Keep the resolved configuration with the environment selection so runtime
  consumers use a single canonical value.

## Testing

- Extend remote-environment coverage to verify that thread-owned permissions
  follow thread updates while owner-provided read-only permissions remain in
  effect.
- Cover configuration inheritance, attachment replacement, and owner-configured
  capability roots.

GitOrigin-RevId: fe70c4be5f151432b69bf4b141e316faa89036ae
2026-08-15 00:43:44 +00:00
sayan-oai
1873e947f8 Honor per-environment permission profiles (#38673)
## What changed

- Add a resolved `permission_profile` to each `EnvironmentConfig` and use the
  complete attachment config for execution and capability-root selection.
- Let `Ready` environment configurations override thread permissions while
  `FromThread` selections continue to inherit them.
- Restrict inherited Guardian environment profiles to read-only permissions.

## Testing

- Add coverage proving that a read-only environment blocks writes even when
  the thread permits workspace writes.
- Update environment inheritance, Guardian review, and capability-root tests
  for the resolved attachment configuration.

GitOrigin-RevId: 1a313b9e4892b1a579a0e880e322a782b4f6c0a7
2026-08-15 00:24:25 +00:00
aphonpra-oai
a186f5484d Resolve local JSON Schema refs in Code Mode types (#38664)
## Why

Code Mode rendered document-local `$ref` values as `unknown`, hiding referenced
input and structured-output shapes from generated TypeScript declarations.

## What changed

- Resolve fragment-only JSON Pointer references against the root schema,
  including escaped and percent-encoded pointer segments.
- Preserve `$ref` siblings as intersections and parenthesize unions used in
  `allOf` intersections.
- Bound recursive and repeated expansion, intermediate rendering work, and
  final output size, falling back to `unknown` when a limit is reached or a
  reference cannot be resolved safely.

## Testing

Add unit coverage for recursive, escaped, nested-resource, dangling, and
oversized references, plus integration coverage for generated Code Mode tool
descriptions and MCP structured output types.

GitOrigin-RevId: 95c6aa32e25325b5be9359dfac3b3328e5e7a499
2026-08-14 22:40:19 +00:00
johnl-oai
848cbad7f4 Enforce managed deny-read rules in the Windows sandbox (#38660)
## Why

Windows sandbox requests must preserve managed filesystem deny rules across every execution path and setup refresh. Unsupported policies should fail closed instead of allowing a command to run without the requested protection.

## What changed

- Resolve Windows filesystem overrides while constructing each sandbox execution request so both `shell_command` and `exec_command` enforce exact-path and glob deny-read entries.
- Carry resolved deny-read paths into Windows sandbox setup refreshes, including workspace-relative entries.
- Reject unelevated restricted-token requests that cannot enforce deny-read rules.
- Reject recursive globs rooted at a filesystem root unless `glob_scan_max_depth` bounds their expansion.

## Testing

Added coverage for deny-read enforcement through both command runtimes, setup refresh resolution, restricted-token failure, and bounded root-level glob scans.

GitOrigin-RevId: 33dfa4d1a45b14850cbf58f9173717e3e707d9bf
2026-08-14 22:28:33 +00:00
iceweasel-oai
d8d7ca73f8 Enable unified exec by default on Windows (#38625)
## What changed

- Enable the stable `unified_exec` feature by default on every platform.
- Update cross-platform integration test expectations so `exec_command` and
  `write_stdin` are exposed on Windows instead of `shell_command`.

GitOrigin-RevId: e5c864bacbde7eab109e7a0e399b8f7b843b384c
2026-08-14 19:07:15 +00:00
jif
42b5f05cef Preserve MCP namespace descriptions in the tool catalog cache (#38623)
## What changed

Keep MCP namespace descriptions when publishing tool definitions to the
process-scoped catalog cache. Cached definitions now expose the server
instructions to the model before a lazily started MCP connection finishes
initializing.

## Testing

Update the cached MCP startup integration test to verify that cached namespace
descriptions retain the originating server instructions.

GitOrigin-RevId: d1b73381852fd43c6b54a7c22a599474c774dc20
2026-08-14 18:35:13 +00:00
rhan-oai
395723b238 Source multi-agent instructions from the model catalog (#38619)
## What changed

- Add model-catalog messages for root and subagent roles, explicit delegation, and delegation hints.
- Resolve role instructions in config, catalog, then bundled-default order, while preserving empty values as an explicit way to suppress fallback text.
- Refresh catalog-provided role and mode instructions when the model changes, and give full-history forks the selected child model's subagent role without retaining the parent's role guidance.
- Keep existing config overrides and reasoning-effort behavior, including proactive delegation for ultra reasoning effort.

## Testing

- Cover message deserialization and preservation through model overrides.
- Cover precedence, empty overrides, model switches, resumed sessions, and full-history subagent forks.

GitOrigin-RevId: 4625cf7c6a5490176adddfaa0fb99100707daea9
2026-08-14 18:26:20 +00:00
Dylan Hurd
588ee89324 Isolate Guardian reviewer sessions from parent extensions (#38602)
## What changed

- Start Guardian reviewer delegates with an empty extension registry while preserving extension inheritance for other delegates.
- Disable `GuardianV2` in the reviewer session configuration so reviews do not trigger nested Guardian processing.
- Cover both the reviewer isolation and continued delivery of parent-session tool lifecycle events.

GitOrigin-RevId: 858b3e23d1c06177e443fb0779fcf06cc5294fc2
2026-08-14 16:28:42 +00:00
jif
23094236ac Let extensions resolve approval reviews before Guardian (#38592)
## What changed

- Give approval review contributors the first opportunity to resolve an action when automatic review is not required for the model.
- Return an extension's decision directly and fall back to Guardian when no extension claims the review.
- Update Guardian V2 to approve actions below its risk threshold through the review contributor API, and remove the extension approval-policy API.

## Testing

- Verify that an extension approval bypasses both the Guardian model call and the user approval prompt.
- Cover Guardian V2 review decisions for low-risk, high-risk, and disabled threads.

GitOrigin-RevId: 5be56941143aff6f358b75b5f8101b7c047147ae
2026-08-14 15:24:10 +00:00
jif
1c4f42863c Require automatic review for high-risk Guardian v2 actions (#38569)
## What changed

- Add a thread-scoped extension API for requesting automatic review, resolving
  multiple contributors to the strongest requirement.
- Have Guardian v2 request automatic review when it is enabled and the latest
  `action_risk` score is at least `0.8`.
- Honor extension review requirements across tool approvals, MCP elicitation,
  and remote execution while preserving host configuration and managed-policy
  constraints.

## Testing

- Cover contributor registration and requirement resolution.
- Verify Guardian v2 requests review at the threshold, returns to the default
  below it, and does not affect threads where the extension is disabled.
- Exercise extension-requested strict review with a remote model override.

GitOrigin-RevId: 6329fc23585d5cc7173c39bb9952c3109ec3884b
2026-08-14 12:37:13 +00:00
felixxia-oai
d40dfcc3c7 Run tool start callbacks after pre-tool hooks (#38568)
## What changed

- Invoke `ToolLifecycleContributor::on_tool_start` only after pre-tool hooks
  have finalized the invocation.
- Pass hook-rewritten arguments and the post-hook conversation snapshot to the
  callback.
- Skip the start callback when a hook denies execution or supplies input that
  cannot be applied.

## Testing

Add lifecycle tests covering rewritten input, hook-added context, denied tool
calls, and invalid rewritten input.

GitOrigin-RevId: 936efaf4a8c35321f9982ff2a33bb8bece1ebf39
2026-08-14 12:21:08 +00:00
sayan-oai
fdbab67c66 Carry environment config in turn selections (#38521)
## What changed

- Add `EnvironmentConfigState` to `TurnEnvironmentSelection` so each environment attachment can inherit thread configuration or carry ready configuration for its login-shell policy and selected capability roots.
- Apply ready configuration during thread creation and thread-settings updates while reusing the existing environment connection.
- Validate selection configuration before applying settings, rejecting unsupported pending state and invalid capability roots.

## Testing

- Cover attachment-scoped capability roots, ready configuration at thread startup and turn updates, and rejection of invalid selections without changing existing settings.

GitOrigin-RevId: 86cf8f2148fdaa746ea0dd12890ab7b1577d7587
2026-08-14 07:52:38 +00:00
rka-oai
86b1123ff6 Enable parallel tool calls for all model prompts (#38499)
## What changed

- Set `parallel_tool_calls` for regular and remote compaction prompts without consulting model metadata.
- Remove `supports_parallel_tool_calls` from `ModelInfo`, the bundled model catalog, and related fixtures.
- Preserve the existing Responses Lite behavior that disables parallel tool calls at request construction.

GitOrigin-RevId: 49552bdf97e71fa57325abb49f8adc0c88f1401a
2026-08-14 05:49:33 +00:00
Matthew Zeng
45c9c74e29 Reuse pending MCP startups during reconciliation (#38493)
## Why

MCP runtime reconciliation can occur while an unchanged server is still
starting, such as when capability roots become available. Reconciliation
should neither wait for that startup nor initialize the same server again.

## What changed

- Reuse an active, uncancelled pending MCP connection when its identity,
  catalog limit, and protocol mode still match.
- Publish the shared startup result through the reconciled server view while
  applying its updated tool filter.
- Preserve cancellation when a reused pending server is subsequently removed.

## Testing

Added coverage for filtered-tool publication, disabling a reused pending
server, and capability-root reconciliation during Codex Apps startup.

GitOrigin-RevId: 690cf8695e75b341d097d7d22b5da6993b24e787
2026-08-14 04:49:14 +00:00
Dylan Hurd
4e5a08feb6 Enforce strict auto-review for MCP tool calls (#38492)
## What changed

- Route MCP tool calls through the automatic reviewer when strict auto-review is enabled, even when the approval policy, tool annotations, or a remembered session decision would otherwise skip review.
- Pass the strict auto-review flag into the MCP approval request so reviewer selection follows the turn setting.
- Update MCP approval and turn-metadata tests to cover the forced review path and confirm that it does not request user input.

GitOrigin-RevId: 2c0b5f4dc1a15cb2fb827e4b21e69167fdcf3e56
2026-08-14 04:46:04 +00:00
dozaki-openai
cbe85e117b Search selected plugin apps before falling back (#38484)
## What changed

- When an explicitly selected plugin has apps available, instruct the model to use `tool_search` to discover relevant tools before falling back to unrelated or built-in tools.
- Scope the guidance to the request that selected the plugin and omit it for plugins without available apps.

## Testing

- Cover app-specific rendering, non-app plugins, bounded instruction output, and app enablement in dual-surface plugin requests.

GitOrigin-RevId: 1b9501cc403d2817334a9307e683e99c140a794a
2026-08-14 02:54:38 +00:00
pmccrary-oai
9d012ca4f5 Include agent names in turn metadata (#38483)
## What changed

- Add the canonical agent path as `agent_name` in Responses API turn metadata.
- Fall back to `/root` when a session has no canonical agent path.
- Reserve `agent_name` from client metadata overrides and omit it from MCP request metadata.

## Testing

- Cover root, named subagent, legacy subagent, MCP, and client metadata merge cases.

GitOrigin-RevId: a9adcc079a51beae7d621aba24bcd759ceaa408e
2026-08-14 02:32:05 +00:00
Celia Chen
d5e256ceb2 Add an Amazon Bedrock Runtime provider (#38470)
## What changed

- Add the built-in `amazon-bedrock-runtime` provider for regional
  `bedrock-runtime` OpenAI-compatible endpoints.
- Use endpoint-specific SigV4 service configuration while preserving bearer
  token auth and per-provider AWS profile, region, and transport overrides.
- Provide global and US cross-region GPT-5.6 model variants, prefer global
  routing for fallback and background tasks, and disable unsupported web search.

## Testing

- Cover provider configuration and capabilities, endpoint and auth selection,
  runtime catalog ordering, model fallback, and web search omission.

GitOrigin-RevId: d158ab74a5768e1b4c61063365a0c06735313322
2026-08-14 01:23:59 +00:00
Ankush Gupta
4d9f3021c8 Include node_repl images in Guardian review evidence (#38454)
## What changed

- Preserve valid image content from completed `node_repl` Code Mode responses alongside text evidence for Guardian reviews.
- Enable multimodal evidence for models that require automatic `node_repl` review, or when both `guardian_enhanced_node_repl_transcripts` and `guardian_node_repl_transcript_images` are enabled.
- Bound retained and rendered evidence, deduplicate images already present in review history, and fall back to text-only evidence when the reviewer lacks image support or prompt capacity.
- Keep review evidence out of the parent turn input.

## Testing

- Cover feature gating, mixed text and image ordering, truncation and eviction, unsupported reviewers, prompt pressure, image detail normalization, and reused review sessions.

GitOrigin-RevId: a3e482402f7b3484401b231dadc662e6e3504fdf
2026-08-13 23:29:52 +00:00
Adam Perry @ OpenAI
1b4ea8b3be Add structured telemetry for response retries (#38452)
## What changed

- Emit trace-safe `codex.retry` events immediately before retry delays, including the attempt number, selected delay, retry layer, and operation.
- Cover HTTP requests, sampling streams, remote compaction, and sampling connection recovery. Track connection-recovery attempts separately from the stream retry budget.
- Add integration coverage for retry timing and terminal behavior across HTTP, SSE, WebSocket, and remote-compaction paths, including rate limits, overloads, connection failures, and `Retry-After` inputs.

GitOrigin-RevId: dae38900a0579cf8ba062c3f3d90ee61851c1c99
2026-08-13 23:13:37 +00:00
willwang-openai
1da59ad257 Support per-server MCP OAuth callback ports (#38448)
## What changed

- Add `oauth.callback_port` to MCP server configuration and preserve it when
  serializing configuration edits.
- Accept `oauth.callbackPort` from plugin MCP declarations and skill dependency
  metadata.
- Prefer the server-specific callback port over `mcp_oauth_callback_port` for
  CLI login, app-server, plugin installation, executor, and skill dependency
  OAuth flows.

## Testing

- Cover configuration parsing, serialization, and fallback behavior.
- Verify plugin, executor, and skill OAuth registrations use their configured
  callback ports instead of the global port.

GitOrigin-RevId: 7f65e5e7869358307e49779f1b75e8672b607736
2026-08-13 22:42:12 +00:00
rka-oai
6344a655a5 Refresh current-time reminders for full-history subagents (#38446)
## What changed

- Exclude current-time reminder developer messages when copying parent history into a full-history subagent.
- Keep the child's newly generated reminder, preventing inherited reminders from accumulating while preserving the rest of the forked context.

## Testing

- Extend the full-history V2 spawn test to verify that two reminders in the parent become one fresh reminder in the child request.

GitOrigin-RevId: fb61c72f7f0d61d1068f2c599a8b8caf1788b7e2
2026-08-13 22:30:59 +00:00
rka-oai
bff03ecce5 Retain client developer messages across context compaction (#38445)
## Why

Client-authored developer instructions should remain available after a context
window is compacted when `retain_client_developer_messages` is enabled.

## What changed

- Preserve annotated client-authored developer messages during remote compaction
  v2 and local token-budget context resets.
- Apply the existing retained-message token budget when carrying those messages
  into the new context window.

## Testing

- Cover enabled and disabled retention for remote compaction v2, manual
  token-budget compaction, and mid-turn automatic compaction.

GitOrigin-RevId: 4cb3782cb86ef46458413a17a3255d0016fd675f
2026-08-13 22:21:18 +00:00
rka-oai
3ba52d6075 Tag current time reminders in model context (#38443)
## What changed

- Wrap injected current time reminders in `<current_time_reminder>` tags.
- Keep direct `clock.curr_time` tool output and log previews as plain text.

## Testing

- Update core and app-server coverage for tagged reminders and untagged tool output.

GitOrigin-RevId: ad27f1fa10cca7f83d1ac731e01255320bb60f47
2026-08-13 21:53:52 +00:00
felixxia-oai
53eaa297e5 Give Guardian V2 full tool action context (#38441)
## Why

Guardian V2 needs the requested action and its conversation context to assess
risk; a tool name and call ID alone do not describe what the tool will do.

## What changed

- Expose the original, pre-hook `ToolPayload` to tool lifecycle contributors.
- Build Guardian V2 classifier input from the bounded conversation transcript
  and a structured planned-action object containing the tool name and arguments.
- Warn and skip classification if the planned action cannot be serialized.

## Testing

- Verify lifecycle contributors receive tool arguments.
- Verify Guardian V2 sends transcript history and planned-action JSON to the
  classifier.

GitOrigin-RevId: 28266ef7c1d2267ba705fcfbd9be4ef48e64e104
2026-08-13 21:49:32 +00:00
willwang-openai
f898ebcafd Route curated plugin catalogs by authentication mode (#38429)
## Why

The model provider does not reliably identify which curated plugin catalog is
available. ChatGPT authentication can be used with a custom provider, while an
unauthenticated session should use the API-compatible catalog regardless of its
provider.

## What changed

- Select the ChatGPT curated catalog only for authentication modes that use the
  Codex backend; use the API curated catalog for API-key and unauthenticated
  sessions.
- Initialize standalone plugin managers with the current authentication mode
  across CLI, app-server, MCP, and external-agent migration paths.
- Preserve authentication mode while detecting and importing migrated plugins.

## Testing

- Cover catalog and skill routing across ChatGPT, API-key, unauthenticated,
  Bedrock, and custom-provider configurations.
- Verify authenticated plugin migration uses the ChatGPT curated marketplace.

GitOrigin-RevId: 660a339ee8891c33aad961078d3a979242a6a166
2026-08-13 20:20:01 +00:00
sayan-oai
781445f7c6 Centralize thread environment selection state (#38423)
## What changed

- Make `ThreadEnvironments` the source of truth for live environment selections and use it when building configuration snapshots, permission profiles, per-turn configuration, and MCP refresh inputs.
- Keep settings previews side-effect free while applying accepted environment updates consistently to subsequent turns.
- Move `EnvironmentConfig` into `codex-protocol` so environment ownership no longer depends on a core-only type.

## Testing

- Cover environment previews and snapshots, accepted and rejected steer updates, and active-turn environment stability.

GitOrigin-RevId: 7bcf8fb5df1215f720e4e9c419541a51a871aa5e
2026-08-13 19:25:05 +00:00
Eric Traut
f8a3db0b99 Clarify MCP OAuth reauthentication errors (#38418)
## Why

When an MCP server rejects existing OAuth credentials, reporting that the server
is merely not logged in obscures that the user needs to authenticate again.

## What changed

Pass the MCP startup failure reason into error formatting and report that the
server requires OAuth reauthentication when appropriate. Preserve the existing
recovery hint for either `codex mcp login` or the client's OAuth sign-in flow.

## Testing

Cover the reauthentication message for both login flows and verify it in the
streamable HTTP OAuth round-trip test.

GitOrigin-RevId: 6f6d5fe7519b1a476f8b70d976223b2ea1ec938e
2026-08-13 18:45:13 +00:00
jif
4f7032173e Honor filesystem permissions for app file uploads (#38416)
## Why

App tool file arguments could read and upload files without applying the active
filesystem sandbox policy.

## What changed

- Apply the effective filesystem policy, including session and turn grants, when
  reading metadata and streaming files for upload.
- Reject uploads before contacting the files endpoint when the selected path is
  denied.
- Report an error when the executor cannot provide sandboxed file streaming for
  a restricted policy.

## Testing

Added integration coverage showing that restricted policies allow permitted
files and reject denied files before upload.

GitOrigin-RevId: 63b239c5066dcb9d18b5050089c659fb2a784909
2026-08-13 18:36:12 +00:00
iceweasel-oai
2aba3219e6 Recognize PowerShell Get-Content file reads (#38415)
## What changed

- Classify simple PowerShell `Get-Content` commands, including `gc` and `type` aliases, as file reads while preserving Windows paths.
- Reuse the shared classification for implicit skill invocation detection on Windows and render recognized commands as `Read <file>` in the TUI.
- Leave commands with unsupported flags, multiple operands, wildcards, or expressions unclassified.

## Testing

- Cover supported and rejected PowerShell forms, Windows executor skill detection, and the TUI read summary.

GitOrigin-RevId: 4e8f5470f2ae31c08d74091f9634c2926e516ccf
2026-08-13 18:30:51 +00:00