Commit Graph

8968 Commits

Author SHA1 Message Date
felixxia-oai
bfb6a6ea22 Support plugin roots in the host skill loader (#37267)
## What changed

- Carry plugin identity, namespace, root, and discovery mode through host skill loading.
- Apply the owning plugin namespace and IDs to loaded skill metadata.
- Respect direct-child discovery for Agent Plugins and reject skills that resolve outside the plugin root or are not regular files.
- Preserve recursive discovery and symlink behavior for legacy plugin roots, and allow the full 64-character namespace plus 64-character skill name.

## Testing

Add host-loader coverage for plugin metadata, namespace ownership, direct-child filtering, path containment, recursive symlinks, shared assets, and maximum-length qualified names.

GitOrigin-RevId: cdde821643ce39bd030d0c3753b3304b75161690
2026-08-06 12:44:36 +00:00
jif
1151b23f01 Start cached MCP servers lazily for subagents (#37261)
## Why

Subagents can reuse cached MCP tool definitions without starting every optional
server before any of its tools are used.

## What changed

- Defer startup for subagent-owned, optional MCP servers when their cache has at
  least one visible, allowed tool, and trigger startup on the first operation
  that needs the live client.
- Keep root sessions, required servers, selected plugin servers, and explicit
  reconnects eager.
- Exclude empty catalogs from cache eligibility and keep dormant servers out of
  the initial startup summary.

## Testing

- Extend MCP tool-cache coverage for eager root startup, unused and filtered
  subagent servers, deferred startup status events, and startup that survives an
  interrupted first tool call.

GitOrigin-RevId: e7528ff08312583a6747cbc6550ea5b6eabda9a6
2026-08-06 11:18:24 +00:00
jif
a17da5e6e4 Fix first-turn model switching and rollback (#37260)
## Why

A model switch on the first turn has no prior turn settings to compare, and rolling that turn back could leave its model instructions in history.

## What changed

- Track the model that supplied the session's base instructions so first-turn switches inject the target model's instructions, including the selected personality.
- Preserve inherited custom base instructions when starting from an empty fork.
- Remove first-turn model-switch developer content during rollback so retries and cold resumes do not retain or duplicate stale instructions.

## Testing

Add integration coverage for first-turn switches, personality changes, empty-prefix forks, rollback retries, and cold resume.

GitOrigin-RevId: 9df532e9e337521ad3b315b77f8c98e039fb384e
2026-08-06 11:03:31 +00:00
jif
82b17bc724 Allow agent roles on full-history forks (#37252)
## Why

Multi-agent v2 rejected `agent_type` when `fork_turns` was `all`, forcing callers to choose between a configured role and the parent's full conversation context.

## What changed

- Apply an explicitly selected role to full-history forks, including its model and developer instructions.
- Preserve the parent's developer instructions when the selected role does not define its own.
- Keep the inherited conversation history and model-switch context intact.
- Update the `spawn_agent` schema to clarify that roles apply independently of history inheritance.

## Testing

- Cover full-history role overrides and developer-instruction precedence in multi-agent v2 tests.

GitOrigin-RevId: cd4f35e31d75f56289760f245bff38dd0233abe6
2026-08-06 10:27:33 +00:00
jif
74b8f8db93 Cover remote MCP discovery timeout cleanup (#37248)
## What changed

Extend the executor-backed Streamable HTTP timeout test to cover both legacy
`initialize` and MCP 2026 `server/discover` requests. Verify that each stalled
handshake times out and releases the serial executor for subsequent requests.

GitOrigin-RevId: 3493904433c95265b9f645813723e890b7610abb
2026-08-06 09:46:04 +00:00
kevinlin-openai
7a0e974e08 Harden network proxy MITM authorization (#37211)
## Why

MITM hooks authorize requests before the upstream server parses them. Paths that
can be decoded or normalized to a different resource must not match an allowed
path, and hosts that require MITM inspection must not bypass it through the
plain HTTP proxy path.

## What changed

- Reject ambiguous hook paths, including traversal segments, backslashes,
  malformed percent encodings, and encoded separators or percent signs.
- Block plain HTTP proxy requests for hosts whose policy always requires MITM,
  recording the decision as `mitm_required`.

## Testing

- Cover safe and ambiguous path forms, encoded traversal through repository
  allowlists, and absolute-form HTTPS requests sent to the HTTP proxy.

GitOrigin-RevId: 8812a980ac64a97cbac3a237376d29be5ded9220
2026-08-06 03:57:10 +00:00
Matthew Zeng
1ae82ce6a5 Fetch remote installed plugins across all scopes (#37210)
## What changed

- Fetch the paginated installed-plugin snapshot without a `scope` query instead of issuing separate requests for global, user, and workspace plugins.
- Use the combined snapshot for installed-plugin caching and bundle synchronization while continuing to reconcile each scope's marketplace independently.

## Testing

- Cover pagination across mixed scopes, request query parameters, marketplace reconciliation, stale cache cleanup, and discoverable-plugin filtering.

GitOrigin-RevId: 7428a9db81d7ec04e65cc4b236b652278b200956
2026-08-06 03:53:05 +00:00
Curtis 'Fjord' Hawthorne
0a0ebb8535 Add a unified image budget (#37206)
## What changed

- Add the gated `unified_image_budget` feature for models that support original image detail or Responses Lite.
- Apply one 6,000-pixel, 10,000-patch preprocessing limit regardless of legacy image detail hints.
- Hide detail controls from `view_image` and code mode while continuing to accept existing hints for compatibility.
- Preserve detail-based resizing and tool contracts for unsupported models.

## Testing

- Cover unified resizing limits, Responses Lite, legacy detail hints, unsupported models, and `view_image` integration in code mode.

GitOrigin-RevId: cb07bff1669a96599fdfd076b3d9ec80f2b6fff7
2026-08-06 03:15:08 +00:00
efrazer-oai
bc8b25ea02 Add durable user-message queue dispatch (#37204)
## What changed

- Add a storage-neutral queue extension for listing, adding, editing, reordering, deleting, and explicitly starting queued user messages.
- Dispatch queued messages in FIFO order when a thread becomes idle after a completed turn, while leaving them queued after interruptions or failures.
- Wait for user input to be persisted before removing its queue item, and report hook rejection, task termination, and persistence failures distinctly.
- Snapshot local image and audio attachments into validated data URLs before storing them, enforce input limits, and emit `ThreadQueueChanged` events after mutations.

## Testing

- Cover queue mutations, automatic and explicit dispatch, interruption and failure behavior, hook rejection, invalid records, input limits, and local attachment snapshotting.

GitOrigin-RevId: 14f39d7c8cbaccb767a6da84b82cced0edfcb4b9
2026-08-06 03:11:42 +00:00
Eddie Chen
70b4653232 Track thread archive analytics (#37199)
## What changed

- Emit `codex_thread_archive_event` when a thread is successfully archived or
  unarchived, including the thread ID, action, and producer timestamp.
- Route archive notifications through the analytics client while preserving
  normal app-server notification delivery.

## Testing

- Extend app-server coverage for archive and unarchive analytics, including
  descendant archives and a repeated archive request that fails without
  producing another event.

GitOrigin-RevId: 0d973c232fd795b7cd6cddd47ecc9446234c44dd
2026-08-06 02:30:18 +00:00
Brent Traut
547080e4d6 Prefer persisted cwd when reading local threads (#37198)
## Why

The `cwd` recorded in a rollout can become stale after thread metadata is
updated, causing thread reads and lists to disagree with the persisted state.

## What changed

- Overlay a non-empty state database `cwd` when reading a thread by ID.
- Apply the same overlay when reading by rollout path, but only when the
  metadata points to the requested rollout.
- Recompute the permission profile against the selected `cwd` and continue to
  fall back to rollout metadata when the persisted `cwd` is empty or belongs to
  another rollout.

## Testing

- Cover stale, empty, and mismatched persisted `cwd` metadata.
- Verify that `thread/read`, state-only `thread/list`, and `thread/resume`
  report the persisted thread `cwd` while the resumed session uses its requested
  live `cwd`.

GitOrigin-RevId: 50a3f187618ee3cadbad95196ee2976e2d5e9a5a
2026-08-06 02:26:24 +00:00
Owen Lin
aac9f84247 Preserve legacy semantics during rollout migration (#37191)
## Why

Legacy rollouts can contain historical rollbacks, compaction checkpoints, and
subagent copies of parent history. Migrating those records verbatim can change
the visible conversation or the model context used when a thread resumes, and
can retain large amounts of duplicated subagent history.

## What changed

- Plan and replay historical rollbacks by logical turn, preserving surviving
  lifecycle events and the correct compaction anchor for future resumes.
- Migrate subagent rollouts from a safe bounded replay when possible and record
  the history boundary so copied parent context is not projected as child turns.
- Include archived and compressed rollouts while keeping their storage form and
  location intact.
- Tolerate malformed, partial, oversized, and empty JSONL records during the
  migration scan.

## Testing

Add coverage for rollback and compaction combinations, subagent replay bounds,
archived and compressed rollouts, recovery, concurrent maintenance, and damaged
JSONL input.

GitOrigin-RevId: 3948e16d43f75df8571b0a92af12a181d1d08fdf
2026-08-06 00:54:14 +00:00
andrewgu-oai
f141dc77f0 Interrupt cyber model turns after one Guardian denial (#37190)
## What changed

- Add a Guardian circuit-breaker policy for models whose catalog specialty is
  `cyber`.
- Interrupt those models after the first Guardian denial while retaining the
  existing denial thresholds for other models.
- Centralize the `cyber` model-specialty identifier for use across core,
  protocol, app-server, and TUI code.

## Testing

- Cover the cyber-specific threshold in the circuit-breaker unit tests.
- Verify end to end that a denied command is not executed and the turn is
  interrupted after one denial.

GitOrigin-RevId: fad24c9e7aa280432580db1f0e39d13535779710
2026-08-06 00:37:46 +00:00
Adam Perry @ OpenAI
92b83e226d Track multi-agent usage hints in world state (#37189)
## Why

Resumed sessions need the current multi-agent usage instructions when configuration changes or the saved history predates usage-hint tracking.

## What changed

- Store multi-agent usage hints in world state and refresh changed or previously untracked hints before re-emitting the active multi-agent mode.
- Present `wait_agent` polling guidance in the overridable developer instructions only when the tool is enabled, instead of embedding it in the tool schema.

## Testing

- Cover cold resumes, changes to `wait_agent` availability, custom usage hints, message ordering, and tool-schema behavior.

GitOrigin-RevId: a9c6798d5dc2dedc8dadc49e0a80ff50a757ab83
2026-08-06 00:22:06 +00:00
tongzhou wang
98da2c4499 Reserve the tool_search namespace for the search tool (#37188)
## What changed

- Remove namespace tools named `tool_search` before registering the built-in
  search tool, preventing them from sharing its model-visible surface.
- Record removed namespace tools as collisions so strict collision handling
  reports their qualified tool names.

## Testing

- Cover direct and deferred MCP tools that use the reserved namespace.
- Cover strict collision errors for both direct and deferred conflicts.

GitOrigin-RevId: 28fff918b4358a67b167467d92728fa545b951d7
2026-08-06 00:16:57 +00:00
jimxie-oai
928bda82cf Preserve image transparency metadata in app-server items (#37178)
## What changed

- Add `transparentBackground` to image-generation items and legacy completion events.
- Map Images API backgrounds to `true` for transparent, `false` for opaque, and `null` for automatic or unavailable values.
- Preserve the metadata in live notifications and persisted or resumed thread history while continuing to deserialize older items that omit it.

## Testing

- Cover transparent, opaque, and automatic backgrounds, including image edits and thread read/resume flows.
- Verify the stable JSON shape and optional TypeScript field.

GitOrigin-RevId: 08527f37f23431df45fab1ed34eb82b2139b49d7
2026-08-05 23:42:29 +00:00
felixxia-oai
a3ebd19fa4 Move explicit skill selection into the skills crate (#37177)
## What changed

- Add `ExplicitSkillLookup` to decouple explicit mention selection from the
  core skill-loading model.
- Export `collect_explicit_skill_mentions` from `codex-skills` and implement
  the lookup interface for `SkillLoadOutcome`.
- Move the selection tests into `codex-skills` while keeping the prompt-size
  boundary test with prompt injection.

GitOrigin-RevId: 21105af31c9b519c231c5ea02464da560705c293
2026-08-05 23:23:21 +00:00
Owen Lin
6bb6e9045f Add legacy rollout migration to paginated history (#37175)
## What changed

- Add `LocalThreadStore::migrate_rollouts` with dry-run and apply modes,
  optional thread selection, throughput limiting, and per-rollout outcomes.
- Canonicalize legacy JSONL records into paginated history while preserving
  model-visible conversation context, including compressed rollouts and copied
  fork history.
- Publish replacements atomically and journal migrations so interrupted SQLite
  projections can be recovered. Coordinate migration with rollout compression
  and skip rollouts with active writers.
- Make paginated history a one-way SQLite promotion so stale metadata cannot
  downgrade a migrated thread.

## Testing

- Cover legacy record normalization, dry runs, idempotency, malformed input,
  compressed rollouts, active writers, interrupted migration recovery, and a
  cold app-server resume after migration.

GitOrigin-RevId: b9991b659f28ebb52da39ce62e8b4e0bae2ba2bb
2026-08-05 22:57:27 +00:00
felixxia-oai
e3465b48ad Centralize skill invocation helpers in codex-skills (#37174)
## What changed

- Move tool mention parsing, skill-name counting, and implicit invocation detection into `codex-skills` and expose them through its public API.
- Decouple implicit invocation detection from `SkillLoadOutcome` with an `ImplicitSkillLookup` trait, while preserving the existing `core-skills` interface through re-exports.
- Cover remote plugin attribution for both implicit `SKILL.md` reads and skill script runs.

GitOrigin-RevId: f3da85c9821868638ccfd2fc2e01e0869d2fd437
2026-08-05 22:26:59 +00:00
felixxia-oai
f380b48733 Move plugin skill snapshot integration tests into core (#37169)
## What changed

- Move the integration test for reusing plugin-manager skill snapshots into
  `codex-core`, which owns both the plugin manager and host skills service
  integration.
- Keep the `codex-core-plugins` test focused on resolving local and remote
  plugin identities on effective skill roots, and remove its skills-extension
  dev dependency.
- Use the skills extension's `HostSkillsSnapshot` type in its world-state
  catalog implementation.

## Testing

- Verify the host skills service reuses the plugin manager's parsed snapshot
  after the underlying skill file changes, while preserving plugin identity
  metadata.

GitOrigin-RevId: afc8a0ebccb629360c59a4546bdb9a134c74da4f
2026-08-05 21:56:25 +00:00
jif
e244a9d94e Bound remote MCP handshake HTTP requests (#37168)
## Why

A streamable HTTP MCP handshake could time out while its executor-backed HTTP
request continued running, leaving the serial executor blocked for later
requests.

## What changed

- Track the remaining initialization deadline for streamable HTTP transports.
- Apply it to `initialize`, `notifications/initialized`, and discovery HTTP
  requests, then clear it when the handshake finishes.

## Testing

- Added a regression test that stalls the remote MCP endpoint, waits for the
  handshake timeout, and verifies that a subsequent executor request completes.

GitOrigin-RevId: d4980a332e898309c885cbaa4fdd598924b440e1
2026-08-05 21:52:09 +00:00
Rasmus Rygaard
15ea598c6e Expose session sources to MCP contributors (#37167)
## What changed

- Add `session_source()` to `McpServerContributionContext` for thread-scoped MCP resolution.
- Propagate each thread's `SessionSource` through initial setup, per-step resolution, and runtime refreshes.

## Testing

- Verify global contexts omit the source while thread-scoped contexts retain it.
- Verify MCP contributors observe distinct sources for a root thread and its spawned subagent.

GitOrigin-RevId: 23da1509858e023fbd9e2d179034ddc83553f17b
2026-08-05 21:45:33 +00:00
Charlie Marsh
ad6e48ddd3 Keep textarea cursors and rendering inside the viewport (#37166)
## What changed

- Reserve a continuation row for the insertion point when a logical line exactly fills the textarea width.
- Wrap overflowing spaces and keep cursor movement aligned with the resulting visual rows.
- Clip plain, masked, and styled text rendering to the textarea bounds, and return no cursor position for empty viewports.

## Testing

Add regression coverage for full lines, trailing spaces, scrolling, multi-width graphemes, empty areas, and styled overlays at textarea boundaries.

GitOrigin-RevId: 4147530b523cf4bc300e50221d25d22dbfdfbefe
2026-08-05 21:40:50 +00:00
felixxia-oai
bd36d69aae Load host skill roots through the skills extension (#37162)
## What changed

- Load ordinary recursive host skill roots with the skills extension's host loader.
- Keep plugin-specific roots on the existing loader so plugin snapshot caching and namespacing continue to work.
- Merge both kinds of root snapshots through the existing precedence and deduplication logic, including discovery paths and source filesystem mappings.
- Move `HostSkillsSnapshot` into the skills extension as the owner of host skill loading.

## Testing

- Cover merged host and plugin catalogs, precedence for symlinked roots, discovery paths, and end-to-end rendering and invocation of host, repository, and plugin skills.

GitOrigin-RevId: c18080afb917c33c57bc17e36b40dd0f3c72d1d7
2026-08-05 21:17:54 +00:00
Charlie Marsh
c38a60ded2 Harden named session lookup in the TUI (#37157)
## What changed

- Share exact-name candidate lookup between resume and archive commands.
- Prefer valid SQLite names for local sessions, then recover legacy index names without overriding newer metadata.
- Validate rollout identity, collection, source, and model provider before selecting a local session, and choose the most recently modified eligible legacy duplicate.
- Preserve server-side lookup behavior for remote workspaces.

## Testing

- Cover stale and duplicate SQLite entries, legacy-name recovery, source and provider filtering, paginated histories, and duplicate legacy names.

GitOrigin-RevId: c69f86d64ff556bc7b463d13522a9241591eb070
2026-08-05 20:44:03 +00:00
TAFOYA-OAI
b6cddbf6d5 Test remote environments reported ready before selection (#37156)
## What changed

- Add end-to-end coverage for a remote environment whose provisioning status is
  reported ready before it is selected for a turn.
- Verify that `wait_for_environment` makes remote execution tools and selected
  capability-root context available once the transport is ready.
- Update pending-environment and relay tests to cover separate materialization
  and readiness reporting, including deferred connection and reconnection.

GitOrigin-RevId: d86d66e8f722e9bafac88b93d93e7c5244a7156e
2026-08-05 20:39:11 +00:00
Eric Burke
0c07c7ee47 Use Azure Key Vault for macOS notarization (#37154)
## Why

Keep the App Store Connect private key in Azure Key Vault instead of exporting it to release runners as a base64-encoded `.p8` secret.

## What changed

- Add a notarization client that creates notary-scoped Apple JWTs with a pinned Azure Key Vault key, submits and streams artifacts to Apple's notarization service, polls for completion, and saves developer diagnostics.
- Update the binary and DMG release wrappers to use the new client while continuing to staple accepted DMGs with `rcodesign`.
- Configure release jobs with the notarization vault key name and version instead of private-key material.

## Testing

- Add unit coverage for key validation, JWT signing, uploads, polling, diagnostic logs, and the binary and DMG wrapper contracts.

GitOrigin-RevId: 8f526c5691d774964fd33f847f8420cac0840b05
2026-08-05 20:31:46 +00:00
Adam Hupp
b6c3b51533 Coalesce concurrent Git status scans (#37151)
## What changed

- Share an in-flight `git status --porcelain` invocation among concurrent workspace metadata requests for the same canonical repository root.
- Keep scans for different repositories independent, and start a fresh scan after an in-flight request completes or loses all consumers.
- Pass the known repository root into dirty-worktree detection so requests from sibling directories and symlink aliases use the same key.

## Testing

- Add coverage for request coalescing, repository and symlink keying, completed scans, and consumer cancellation.

GitOrigin-RevId: 4c197c1d5bb94ca83c02979be34b17f24aefde08
2026-08-05 20:23:35 +00:00
rphilizaire-openai
a1890b6998 Project orchestrator skills through world state (#37149)
## What changed

- Move the orchestrator skill catalog from thread context into its own
  `orchestrator_skills` world-state section so unchanged catalogs remain
  incremental across turns.
- Discover executor, orchestrator, and host catalogs together and render them
  against one context-window-aware metadata budget, preserving executor entries
  before orchestrator and host entries under pressure.
- Emit catalog metrics and budget warnings when each world-state section is
  rendered.

## Testing

- Cover incremental orchestrator catalogs across production turns, combined
  catalog budgeting, disabled and unavailable providers, caching, warnings, and
  metrics.

GitOrigin-RevId: a0fb25d39dcaf43c978aff9da7972a1206f736e4
2026-08-05 20:14:31 +00:00
TAFOYA-OAI
f5345f1ee8 Track provisioned environment state across registration (#37147)
## What changed

- Add pending, ready, and failed provisioning states for Noise environments.
- Preserve the same environment instance whether provisioning is reported before or after materialization, and reject conflicts with ordinary environments.
- Make readiness and failure reports idempotent while rejecting contradictory terminal transitions.
- Delay connection attempts until a provisioned environment is selected and provisioning succeeds.

## Testing

- Cover status reports before and after materialization, terminal failures, repeated and contradictory reports, and replacement between ordinary and deferred environments.

GitOrigin-RevId: 4360a8f2a80c1a99a1dc9257e5d77c07b72b8eb3
2026-08-05 20:08:41 +00:00
rhan-oai
2b915a2eed Gate Apps usage instructions by model capability (#37145)
## What changed

- Add `include_apps_usage_instructions` to model metadata, defaulting to true for compatibility with existing metadata.
- Emit generic Apps guidance only when apps are available and the selected model enables it.
- Enable the capability for interactive model presets while leaving `codex-auto-review` and local models opted out.

## Testing

- Verify that missing metadata defaults to enabled and an explicit opt-out survives serialization.

GitOrigin-RevId: 6a20573cddfd3b80083d2b4b015829b49e6cc283
2026-08-05 20:03:13 +00:00
xl-openai
72d937ed4d Preserve discovery paths for symlinked skills (#37144)
## Why

Symlinked skills have a canonical `SKILL.md` path that can differ from the path
under the configured skill root. A catalog entry that advertises the discovery
path must still select the canonical skill.

## What changed

- Track each loaded skill's discovery path alongside its canonical identity.
- Render discovery paths in the skill catalog and accept either form for
  structured selections and linked skill mentions.
- Preserve enabled-state checks, deduplication, and product filtering when
  resolving discovery paths.

## Testing

Added loader, catalog, mention-resolution, and end-to-end turn coverage for
skills discovered through directory symlinks.

GitOrigin-RevId: bae539b766cc3782c7c121a4276c337699cbb509
2026-08-05 19:51:51 +00:00
Curtis 'Fjord' Hawthorne
fa5d5ae047 Report prompt image resizing to the model (#37134)
## What changed

- Add the disabled-by-default `image_resize_notice` feature.
- When enabled, append a developer message after resized images from user
  messages or tool outputs. The notice identifies each image and reports its
  original and prepared dimensions.
- Persist notices with new history while avoiding backfilled notices for images
  processed when a session is resumed.

## Testing

- Cover notice placement, image numbering, failed images, user and tool image
  sources, and resumed-session replay.

GitOrigin-RevId: 11dd808b3ad47eac35e9e2f4a4370f85d0122770
2026-08-05 18:19:22 +00:00
Abhinav
2994f545a7 Enforce managed authentication requirements locally (#37132)
## Why

Authentication restrictions must apply before stored or environment-provided credentials can be used, including during bootstrap before cloud requirements are fetched.

## What changed

- Add local `requirements.toml` allowlists for login methods and ChatGPT workspaces. Ignore these fields in cloud-provided requirements.
- Combine managed workspace allowlists with existing workspace restrictions by intersection, and fail closed when the resulting policy permits no usable login method.
- Centralize policy checks in the authentication manager so CLI, TUI, app-server, external-auth, and credential-loading paths consistently reject disallowed authentication before token hydration or network requests.

## Testing

- Cover policy composition, workspace intersection, invalid stored and external credentials, bootstrap enforcement, and login endpoint restrictions.

GitOrigin-RevId: efef22b248f3c3333e9aa55423e539efa2d2dd48
2026-08-05 18:09:26 +00:00
iceweasel-oai
4cb8676d3a Make Windows path URI comparisons ASCII-case-insensitive (#37129)
## What changed

- Make `PathUri` equality and hashing ignore ASCII case for inferred Windows
  drive and UNC paths while preserving case-sensitive POSIX behavior.
- Apply the same convention-aware comparison to `starts_with` and
  `relative_path_from`, including equivalent percent-encoded path spellings.
- Continue to fail closed for encoded path separators, opaque fallback URIs,
  and non-ASCII case differences.

## Testing

- Add unit coverage for equality and hash consistency, Windows containment and
  relative paths, POSIX case sensitivity, encoded separators, and non-ASCII
  case differences.

GitOrigin-RevId: cd828874686a9cd242a36262ee3e7a9a172bd5b7
2026-08-05 17:55:57 +00:00
Dylan Hurd
778b869829 Centralize tool approval handling in Session (#37128)
## What changed

- Move permission hooks, reviewer routing, approval caching, and user approval requests into the session-level approval flow.
- Have shell, unified exec, and apply-patch runtimes describe requests as `ApprovalAction` values, which now provide their hook payloads and cache keys.
- Pass a shared `ApprovalContext` through initial and retry approvals so telemetry and approval reasons are handled consistently.

GitOrigin-RevId: 5bfa61daa97e4427f3a648f6cf9d1c27f1551942
2026-08-05 17:48:45 +00:00
Sean Huang
9d00bb01c0 Add per-session code-mode execution limits (#37114)
## What changed

- Add `create_session_with_limits` and session-scoped cell execution limits.
- Clamp execute and wait yield times to the session's `max_yield_time_ms`
  without terminating the running cell.
- Negotiate support with remote code-mode hosts and include non-default limits
  in `session/open`, while keeping unlimited sessions compatible with hosts and
  providers that do not support limits.

## Testing

- Cover yield-time clamping, zero-timeout behavior, and isolation between
  sessions.
- Cover wire serialization, capability negotiation, unsupported hosts, and
  shared process-host execution.

GitOrigin-RevId: 9517321cd605bb87f93eeaa6ba331cc2e346e582
2026-08-05 16:09:01 +00:00
Felipe Coury
2707dfc219 Bound interactive telemetry shutdown (#37109)
## Why

A stalled telemetry exporter can block shutdown indefinitely when the interactive TUI exits.

## What changed

- Add `OtelProvider::shutdown_with_timeout` to run exporter shutdown on a detached thread and report completion, worker failure, or timeout.
- Give interactive TUI telemetry shutdown a 500 ms time budget and warn if cleanup does not finish successfully.

## Testing

- Cover successful shutdown on current-thread and multi-thread Tokio runtimes, worker creation failure, and timeout behavior.
- Verify that OTLP HTTP shutdown returns on time when a collector stalls.

GitOrigin-RevId: 5b5f31a841fbc5788715cb3065d522c6dafa994f
2026-08-05 15:20:21 +00:00
Dylan Hurd
c4f42d161a Use Luna for API-key Guardian reviews (#37103)
## What changed

- Select `gpt-5.6-luna` for Guardian approval reviews authenticated with an API key, while retaining `codex-auto-review` for ChatGPT authentication.
- Exercise API-key reviews through Responses Lite and fall back to the bundled Guardian policy when the selected model has no catalog-provided review policy.
- Refine the bundled policy's handling of trusted authorization, sensitive-data egress, credential probing, destructive command targets, and post-denial approval.

## Testing

- Cover provider model selection for API-key and ChatGPT authentication.
- Verify Guardian prewarming and review reuse with both Responses Lite and standard Responses requests.

GitOrigin-RevId: e35c43e1692fd643ab8faad1444c0d6a869b3e0c
2026-08-05 14:20:59 +00:00
jif
952e87d3f2 Reuse stable MCP bindings across sampling steps (#37101)
## What changed

- Cache an `McpBinding` on each published MCP runtime once server startup has
  settled and the tool catalog revision is stable.
- Reuse the cached binding while the catalog revision remains unchanged, and
  rebuild it after a runtime publish or catalog change.
- Treat terminal failures from optional servers as stable, while continuing to
  wait for required servers and reconnecting Codex Apps servers.

## Testing

- Cover binding reuse within one published runtime and invalidation after a
  republish.
- Cover stability checks for pending, failed optional, required, and
  reconnected servers.

GitOrigin-RevId: 783a6b04897f6c484a6d56fd9cee542814041759
2026-08-05 14:04:39 +00:00
jif
5c44f11064 Consolidate unified exec output state (#37083)
## What changed

Store the output buffer, notifications, closed state, and cancellation token
together in `OutputHandles`. Pass that shared bundle through output collection
and local output tasks instead of cloning and forwarding each field separately.

GitOrigin-RevId: 2f0f66dd419778e0b17ff47323c795f5dc88fe33
2026-08-05 11:21:31 +00:00
Cam moten
f2d825533c Fall back to per-process MCP cleanup on macOS (#37068)
## Why

Signaling an MCP server's process group can fail with `EPERM` on macOS,
preventing owned descendants from being terminated.

## What changed

- When a group signal is denied, enumerate the group's processes and signal
  members that still belong to the expected process group.
- Apply the fallback to both `SIGTERM` and `SIGKILL` during MCP stdio server
  cleanup, while retaining the existing group signaling behavior elsewhere.
- Reject invalid process group IDs and avoid signaling processes that have
  moved to another group.

## Testing

Added macOS tests covering cleanup with a live or exited group leader,
`SIGTERM`-resistant descendants, escalation to `SIGKILL`, and unsafe group IDs.

GitOrigin-RevId: db722475b94dece74244ce8109b3e92f6cfb202a
2026-08-05 09:43:26 +00:00
jif
fcc4ca552f Preserve longer MCP source descriptions in tool search (#37066)
## Why

The 4 KiB aggregate limit can truncate source metadata before it reaches the
model through the tool search description.

## What changed

Raise the aggregate source-description limit to 512 KiB while retaining the
existing character-boundary-safe truncation and bounded output.

## Testing

Expand unit and RMCP round-trip coverage to verify that substantially longer
Unicode descriptions remain complete within the new limit.

GitOrigin-RevId: 002760cdd2e8741e531b45f75f8624ef84334d24
2026-08-05 09:39:05 +00:00
Won Park
757c151a0e Add safer TUI defaults for cyber models (#37055)
## What changed

- Propagate the optional `modelSpecialty` field through the model catalog and
  app-server `model/list` response.
- When a newly selected model has the `cyber` specialty, default an active TUI
  thread to workspace-write permissions with on-request approval. Use auto
  review when available, otherwise keep the user as reviewer, while respecting
  configured permission requirements.
- Show a notice when auto review is applied and strengthen the full-access
  warning for cyber models.
- Preserve explicitly selected permissions when only reasoning settings change.

## Testing

- Cover auto-review defaults, requirement-aware fallback behavior, permission
  preservation across reasoning changes, and the new warning notice.

GitOrigin-RevId: 8f25b0082d3051d9ff91f7355921236d0f82f758
2026-08-05 08:04:15 +00:00
rka-oai
3171166881 Reject conflicting namespace descriptions in strict tool mode (#37053)
## What changed

- Treat different non-empty descriptions for the same tool namespace as a
  collision when `error_on_tool_collisions` is enabled, including deferred
  tools.
- Continue allowing multiple tools to share a namespace when their descriptions
  match or are empty.
- Preserve the first non-empty namespace description when strict collision
  checking is disabled.

## Testing

- Cover strict collisions across direct and deferred tools, valid shared
  namespaces, relaxed description merging, and failure before model sampling.

GitOrigin-RevId: 788a2ae0eccb64c97995af7a208d9abb79edf2d0
2026-08-05 08:01:47 +00:00
sayan-oai
ed2f985a26 Use turn environment permissions for context and discovery (#37040)
## What changed

- Build filesystem and permission context from the primary turn environment's permission profile, working directory, and workspace roots, falling back to the thread context when no primary environment is available.
- Build capability-discovery sandbox contexts from each environment's permission profile and treat discovery as restricted when any selected environment has restricted filesystem access.

## Testing

- Add regression tests covering environment-specific capability discovery and permission context updates.

GitOrigin-RevId: 6bbbd9b88aafa5e6583971ce4e427fc7557f2d93
2026-08-05 06:43:23 +00:00
sayan-oai
bac3ef1d8e Use turn environment permissions for tool execution (#37038)
## What changed

- Derive sandboxing, approval, and permission-profile environment variables from the selected turn environment for shell, unified exec, `apply_patch`, image viewing, and network approval flows.
- Materialize project-root permissions against every workspace root in that environment, allowing `apply_patch` to write to secondary workspace roots while preserving protected paths.
- Carry the selected environment's permission profile into spawned or resumed agents and Guardian permission context.

## Testing

- Add an integration test covering `apply_patch` writes in a secondary workspace root.
- Extend tool, Guardian, and multi-agent tests to distinguish environment permissions from thread-level permissions.

GitOrigin-RevId: e22da8974bcd3de1e724978b1a7790307a51e4bc
2026-08-05 06:38:57 +00:00
sayan-oai
1fe6be9719 Align registry tests with canonical tool names (#37035)
## What changed

- Expect tool collisions to report names canonicalized into the default
  `functions` namespace.
- Remove the obsolete test that allowed an explicitly namespaced
  `functions.shell_command` external tool.

GitOrigin-RevId: 9a517f49c027ffe5b811f6668dca91246f4925a6
2026-08-05 06:07:53 +00:00
sayan-oai
30d99232f4 Apply permission profile updates to future turn environments (#37031)
## What changed

- Include the current permission profile in each turn environment's configuration.
- Refresh retained environment configurations when session settings change, while preserving the configuration already captured by active turns.
- Keep environment connection and shell snapshot resolution reusable across configuration updates.

## Testing

- Cover permission profile updates applied through both session settings updates and per-turn updates.
- Verify that pending environment resolutions use the configuration captured by their turn and that configuration-only updates do not retry failed environments.

GitOrigin-RevId: 923694f0729b87a118d7635ade3a8ca9bcd4e7b1
2026-08-05 05:30:51 +00:00
jacobzhou-oai
56b82e676c Enforce Agent Plugin runtime boundaries (#37027)
## What changed

- Track Agent Plugin manifests through plugin, skill, and MCP loading so their capabilities use format-specific behavior without changing legacy plugins.
- Discover only direct-child skills, exclude app and hook capabilities, isolate MCP data, and reject MCP configuration files that are non-regular or resolve outside the plugin root.
- Bound model-visible skill instructions, plugin instructions, MCP descriptions, schemas, individual tools, and the aggregate Agent Plugin MCP tool set.
- Stop MCP and OAuth redirects when Agent Plugins send configured or authorization headers, while retaining existing redirect behavior for legacy MCP servers.

## Testing

- Add coverage for capability filtering, skill discovery, isolated MCP data and reserved-path expansion, unsafe MCP configuration files, context limits, and redirect handling.

GitOrigin-RevId: c9af66b051269f3226628ca280a58d32c808c38f
2026-08-05 04:54:33 +00:00