Commit Graph
8827 Commits
Author SHA1 Message Date
jif ca2b47997e Avoid building code-mode definitions during registration (#36764)
## What changed

Derive code-mode tool names directly from registered tool names when checking
eligibility and collisions. Skip unsupported and empty tool specs explicitly,
without serializing schemas or augmenting descriptions that are not used during
executor registration.

GitOrigin-RevId: b439327aafd85ce3745d900301b7e48b56dbd6b4
2026-08-03 15:47:29 +00:00
jif 8922a784fe Harden the TUI focus palette regression test (#36759)
## What changed

- Allow up to five seconds for focus-triggered input to appear in the PTY test.
- Check for unexpected foreground and background palette queries while waiting for both immediate and delayed input, so either focus path fails with the palette-specific error.

GitOrigin-RevId: b8ed4f1ced257865140b1518c8959f65371e744f
2026-08-03 14:18:54 +00:00
jif c39d3e99d5 Wait for patch events before reading shell snapshots (#36757)
## What changed

Move shell snapshot validation in the intercepted `apply_patch` test until after
the turn completes and its patch lifecycle events have been collected.

GitOrigin-RevId: 1c16bcfcc97f09165c4a2eb2d15f4059a14b2a99
2026-08-03 14:14:41 +00:00
jif 7750465934 Consolidate apply_patch runtime execution (#36745)
## What changed

- Route verified patches from both direct tool calls and intercepted shell commands through a shared execution helper.
- Simplify patch safety preparation to return either a runtime invocation or a rejection directly.
- Keep permission resolution, approval handling, event emission, runtime execution, and diff tracking in the common path.

GitOrigin-RevId: e16aae8e91d96b8108aefac7f3fbf2da2cbac016
2026-08-03 12:03:33 +00:00
jif 62839fec5d Store the extension registry directly in its builder (#36744)
## What changed

Make `ExtensionRegistryBuilder` wrap an `ExtensionRegistry` and register
contributors directly on it. Return the wrapped registry from `build()` instead
of copying each field into a new value.

GitOrigin-RevId: ae04de99c17ea951156f9892151b4196c70026bf
2026-08-03 11:59:14 +00:00
jif 7dd2f689e9 Simplify contextual user fragment registration (#36742)
## What changed

Replace the type-erased `FragmentRegistration` trait and proxy objects with a
static list of `matches_text` function pointers. Remove the registration types
and their re-exports while preserving the existing contextual fragment matchers.

GitOrigin-RevId: 4e5a296b278984c6e783a67f48fa4bb37646946b
2026-08-03 11:39:51 +00:00
jif 79479cdf09 Store turn skill state in extension data (#36740)
## What changed

- Store each turn's host skills snapshot in `ExtensionData` and expose it through
  `TurnContext::skills_snapshot`.
- Lazily keep implicit skill invocation deduplication state in the same turn-scoped
  store.
- Carry the skills snapshot into review turns without a separate
  `TurnSkillsContext` field.

GitOrigin-RevId: d71579b5d230bd0b5f3c2ad062861f74d614d88c
2026-08-03 11:00:40 +00:00
jif d6407d7359 Deduplicate MCP resource list handling (#36734)
## What changed

- Share argument normalization, server selection, cursor validation, and pagination setup between `list_mcp_resources` and `list_mcp_resource_templates`.
- Use a generic server-tagged wrapper to build single-server and deterministically sorted all-server payloads for both resources and templates.

## Testing

- Cover shared argument normalization and sorted resource-template payload serialization.

GitOrigin-RevId: 3505e4c1d2b95d8bbbb01f6f930fb914309eb898
2026-08-03 10:41:03 +00:00
jif 87e2d41eb3 Stabilize the cloud environment HTTP test (#36732)
## What changed

- Increase the listener, stream read, and overall test timeouts from 2 to 10 seconds.
- Switch the accepted stream back to blocking mode before reading the request.

GitOrigin-RevId: 1e876350421d7791194e145751603c4d709c7d39
2026-08-03 10:27:19 +00:00
jif 155f1ca9e5 Correlate code mode tool analytics with model responses (#36729)
## What changed

- Emit dynamic tool-call analytics for code mode `exec` and `wait` calls, including duration and terminal status.
- Associate code-mode cells and their nested tool calls with the originating and subsequent model response IDs.
- Buffer correlated tool events until the next response is known, while flushing pending events when turns, threads, or the analytics queue close.

## Testing

- Add reducer coverage for correlating `exec`, `wait`, and nested tool events across turns.
- Add an app-server test that verifies production analytics include the cell and response IDs for a code-mode `exec` call.

GitOrigin-RevId: 8b34ab59c1ad68ebbd57f9c8a05f19ab04df48a4
2026-08-03 10:19:04 +00:00
jif dae2122214 Simplify turn metadata state ownership (#36727)
## What changed

- Store synchronization primitives directly in `TurnMetadataState` instead of
  wrapping each field in its own `Arc`.
- Require an `Arc<TurnMetadataState>` when spawning Git enrichment so the
  background task retains the complete state.
- Update Git enrichment tests to use the shared state container.

GitOrigin-RevId: 745ca6504c0a6533cb7726d045905472e51726df
2026-08-03 10:14:34 +00:00
jif 1b594980f3 Deduplicate MCP resource operation handling (#36716)
## What changed

- Add a shared runner for MCP resource operation lifecycle events, output serialization, truncation, timing, and error handling.
- Use it for listing resources, listing resource templates, and reading resources.

GitOrigin-RevId: 84cae2e01a096d5b8ed97ea1cb462f01fe2ed1f9
2026-08-03 09:50:51 +00:00
rka-oai 8b8fa7276f Use provider-reported rollout budget units (#36715)
## What changed

- Charge `codex_rollout_budget_units` against the shared rollout budget when the provider includes it in response usage.
- Fall back to weighted input and output token accounting when provider units are absent.
- Reject non-finite or negative provider units as a fatal response error.

## Testing

- Cover provider units in reminder thresholds and local and remote compaction budget exhaustion.
- Verify invalid units fail without retrying the response.

GitOrigin-RevId: b452403e365985854d16f298d1ba46383e9892c4
2026-08-03 09:46:38 +00:00
rka-oai bb5054fe47 Capture rollout budget units from response usage (#36641)
## What changed

- Parse `codex_rollout_budget_units` from completed Responses API usage into
  `TokenUsage`.
- Keep the provider-only value out of serialized protocol, JSON schema, and
  TypeScript representations.

## Testing

- Cover the value in unit and end-to-end SSE response parsing tests.

GitOrigin-RevId: a53d4202beb9c8985d25894cb10e7c01f20b2a44
2026-08-03 00:30:57 +00:00
Daniel Wolf 5157493c23 Expose onboarding hints in login completion notifications (#36635)
## What changed

- Accept the allowlisted `.onboarding_entrypoint=life_sciences` suffix on a valid OAuth state while continuing to reject unknown or malformed suffixes.
- Return the parsed callback metadata from the login server without including the suffix in the token exchange redirect URI.
- Add the optional `onboardingEntrypoint` field and `life_sciences` value to the v2 `account/login/completed` notification and generated protocol exports.

## Testing

- Cover valid, invalid, and repeated OAuth state suffixes.
- Verify the end-to-end login callback result, token redirect URI, and app-server notification payload.

GitOrigin-RevId: c2ee146328ddd43c03a503260d5d492e186fa889
2026-08-02 21:01:04 +00:00
Charlie Marsh 9949245d1d Preserve SQLite thread metadata during goal mutations (#36632)
## Why

Setting or clearing a thread goal could reconcile an already indexed rollout and overwrite SQLite-only thread metadata, including the thread preview.

## What changed

Skip rollout reconciliation when SQLite already references the same existing rollout and its session metadata matches the requested thread. Continue reconciling when the SQLite row is missing or the stored rollout is invalid so goal mutations can still repair thread metadata.

## Testing

Add coverage that verifies goal set and clear preserve SQLite previews, and that goal set restores a deleted SQLite thread row.

GitOrigin-RevId: cf19cef98559fc67182ac7430e4e50ed2eed83f3
2026-08-02 20:25:31 +00:00
jacobzhou-oai 2b5bdcf675 Support portable Agent Plugins throughout installation (#36544)
## Why

Agent Plugins use a schema-declared root `plugin.json` and can have dotted names or versions that do not fit Codex's directory-safe version format. The packaging and installation paths still assumed the legacy manifest layout and identifier rules.

## What changed

- Recognize valid root Agent Plugin manifests when discovering, packing, and installing plugins, while leaving unrelated root manifests on the legacy path.
- Accept safe dotted plugin names, default missing Agent Plugin versions to `1.0.0`, and derive stable directory-safe versions when necessary without rewriting the portable manifest.
- Skip legacy command migration for Agent Plugins and reject symlinks or other unsupported file types while copying plugin sources.

## Testing

Add coverage for portable bundle round trips, manifest discovery, dotted names, version handling, command preservation, and symlink rejection.

GitOrigin-RevId: 61476c4c4100495842253d8b429c0b896490962d
2026-08-02 02:29:45 +00:00
Rasmus Rygaard 5825699981 Raise the MCP catalog item limit to 2,048 (#36534)
## What changed

Increase the maximum number of items collected across paginated MCP tool,
resource, and resource-template discovery requests from 1,024 to 2,048.

GitOrigin-RevId: b6ce0691d6a217e92faaf141cbf09978b296eeda
2026-08-01 23:39:55 +00:00
Felipe Coury 1e85ca099e Support two-stroke TUI key chords (#36511)
## What changed

- Accept two-stroke bindings such as `ctrl-x ctrl-s` in TUI keymap configuration while preserving arrays as alternative bindings.
- Route chords through the active TUI context, show pending and configured chord hints, and cancel pending chords on `esc`, context changes, or a one-second timeout.
- Extend `/keymap` to capture, add, replace, and display key chords.
- Reject chords that conflict with active single-key bindings, overlapping-context chords, or reserved terminal shortcuts.

## Testing

- Add coverage for chord parsing, validation, matching, timeout and cancellation behavior, context dispatch, key capture, and rendered shortcut hints.

GitOrigin-RevId: dfdede03f518d4936ad8621ebf5537026f2b282e
2026-08-01 17:43:03 +00:00
ningyi-oai a1dd74b535 Retain attempted tool metadata across prompts (#36507)
## What changed

- Reattach recorded `executed_tool_calls` metadata when an output is included in a subsequent prompt.
- Bound retained metadata to 32 KiB, prioritizing recent calls and reporting omitted calls in truncation metadata.
- Drop retained entries after their corresponding outputs leave the prompt history.

## Testing

- Cover metadata replay, cleanup after compaction, bounded retained history, and propagation through later tool requests.

GitOrigin-RevId: 1c23a26123be3b7ad51c61f4ad522139b71bb773
2026-08-01 17:36:39 +00:00
Eric Ning feee0b07c7 Increase remote plugin bundle size limits (#36485)
## What changed

- Raise the maximum remote plugin bundle download from 50 MiB to 100 MiB.
- Raise the maximum total extracted bundle size from 250 MiB to 512 MiB.

GitOrigin-RevId: 17ff4c256dd496afa7fd08d1e8e4cdbd40d49500
2026-08-01 14:42:11 +00:00
Felipe Coury 7dc1856685 Avoid querying terminal size on every TUI redraw (#36482)
## What changed

- Carry dimensions on resize events and reuse the cached screen size for ordinary draws.
- Refresh terminal geometry after resize settling, process resume, and external program execution.
- Pass the resolved size through transcript reflow, viewport updates, and standalone TUI screens so each frame uses consistent dimensions.

## Testing

- Cover cached draws, resize-driven rendering, settled-size rechecks, resume refreshes, and alternate-screen size updates.

GitOrigin-RevId: 9d83dbab50d7a038bd59b4c66c13abcac69ddc79
2026-08-01 14:33:12 +00:00
Adam Perry @ OpenAI ee0247f95a Extract exec-server request dispatching (#36440)
## What changed

- Move JSON-RPC request, notification, response, error, and malformed-message handling into a dedicated `RequestDispatcher`.
- Keep the connection loop responsible for receiving events and closing the connection when dispatch reports a terminal condition.

## Testing

- Add an integration test confirming that ordinary requests are processed serially by default, including when a blocking `process/read` queues later requests.

GitOrigin-RevId: 29d1358d4524edd492ff3855b29f23c42c8b3390
2026-08-01 06:02:48 +00:00
jiayuhuang-openai 6751b54cae Add a realtime delegation acknowledgement control (#36413)
## What changed

- Add the optional `delegationAckFiller` field to `thread/realtime/start`.
- Forward explicit `true` or `false` values to V3 Frameless Bidi session payloads as `delegation.ack_filler`; leave the field absent when unspecified so the Realtime API default is preserved.
- Document that V1 and V2 ignore this setting.

## Testing

- Cover both boolean values in Frameless Bidi serialization and verify the WebRTC V3 session creation payload.

GitOrigin-RevId: 9fe8efd14e42738c3e86e3e9a8af81d0f4521244
2026-08-01 01:17:26 +00:00
Eddie Chen 4c219fdb1a Use Git repositories as pre-tool hook test markers (#36411)
## What changed

- Run `git init` to mark command execution in the affected pre-tool hook tests.
- Keep marker repositories in per-test temporary directories and assert against
  their `.git` directories.
- Check `git version` output when a code-mode hook rewrites a nested command.

GitOrigin-RevId: 71c54ef525b08e1d592f69c8b88eed1ee6403e4f
2026-08-01 01:03:42 +00:00
Shijie Rao e2c0837923 Make user input blocking behavior explicit (#36410)
## Why

Clients need to know whether a `request_user_input` request must wait for an
explicit response or may auto-resolve. Using `autoResolutionMs` as that signal
conflated the blocking decision with timeout policy.

## What changed

- Add required `isBlocking` fields to user input protocol and app-server
  request payloads. Plan-mode requests are blocking, while requests from other
  enabled modes are non-blocking.
- Drive the TUI's auto-resolution behavior from `isBlocking` and remove
  `autoResolutionMs` from the model-facing tool schema.
- Deprecate `autoResolutionMs` while retaining it for compatibility, and treat
  legacy payloads without `isBlocking` as blocking.

## Testing

- Cover mode-derived blocking behavior, legacy deserialization, app-server
  forwarding, delegated requests, and TUI auto-resolution.

GitOrigin-RevId: 29aade657ef743065ec264376ba567a9b353d7d7
2026-08-01 00:38:10 +00:00
Greg Brisebois a850875a8e Implement remote plugin search (#36409)
## What changed

- Implement `plugin/search` by querying the remote plugin service without using the catalog cache.
- Support global, workspace, and personal scopes with bounded page sizes and passthrough cursors.
- Respect plugin feature gates and omit shared workspace results when plugin sharing is disabled.
- Keep search terms and pagination tokens out of transport errors and telemetry, and return search results as uninstalled plugin summaries.

## Testing

- Add remote search coverage for request parameters, result conversion, authentication, pagination, scope mapping, and error redaction.
- Add app-server coverage for remote-plugin and plugin-sharing feature gates.

GitOrigin-RevId: ac29c5480ed8089d998b6275bc5f11c8d9a43fd1
2026-08-01 00:17:45 +00:00
guinness-oai 670f69416b Allow custom Codex instructions for realtime transitions (#36408)
## What changed

- Add optional `realtimeStartInstructions` and `realtimeEndInstructions` fields to `thread/realtime/start`.
- Apply the instructions when Codex enters and leaves realtime mode, while preserving the existing defaults when either field is omitted.
- Limit each field to 8,192 estimated tokens.

## Testing

- Cover custom entry and exit instructions across realtime state transitions.
- Cover token-limit validation for both fields.

GitOrigin-RevId: b9cfa1ff22e084d8a6b2ed56bd27d95ffdd6b6bd
2026-07-31 23:51:33 +00:00
Greg Brisebois 64b2a3008e Declare the experimental plugin search API (#36402)
## What changed

- Add the experimental `plugin/search` request with search term, scope, working-directory, cursor, and limit parameters.
- Define paginated results that include each plugin's marketplace name and optional local marketplace path.
- Route the request through app server while returning method-not-found until the search implementation is available.

## Testing

- Add an app-server test that verifies `plugin/search` returns JSON-RPC error `-32601` with the expected not-implemented message.

GitOrigin-RevId: 755400468331f0887f7da7d933195c347aadf6d0
2026-07-31 23:08:55 +00:00
Charlie Marsh 003ec63bba Avoid redundant filesystem probes (#36393)
## What changed

- Load `environments.toml` in one operation, falling back to the default
  environment provider only when the read reports that the file is missing.
- Attempt the default daemon socket connection directly instead of checking the
  socket path first.
- Preserve each file search entry's type from the directory walker, avoiding a
  second metadata lookup when producing matches and correctly classifying
  followed directory symlinks.
- Write atomic-file contents through the existing temporary-file handle rather
  than reopening its path.

## Testing

- Add Unix coverage for classifying a followed directory symlink as a
  directory in file search results.

GitOrigin-RevId: aa6739cac23953ca8b9a3fcb53e43e72c41cfdf9
2026-07-31 21:37:56 +00:00
Owen Lin dc60dadce6 Enforce single-writer ownership for all thread histories (#36389)
## Why

Legacy thread histories did not use the cross-process writer ownership guard already applied to paginated histories.

## What changed

- Acquire and retain a writer lock whenever a legacy or paginated thread is created or resumed.
- Apply the same ownership checks when archiving or deleting either history mode.
- Release ownership when initialization fails or the active thread shuts down, allowing another process to resume it.

## Testing

- Cover competing create and resume operations for both history modes.
- Cover archive and deletion conflicts for legacy and paginated descendants.

GitOrigin-RevId: 1be79b01966ad2634ed79eb96c0aa0db8eafe2fa
2026-07-31 20:49:08 +00:00
Curtis 'Fjord' Hawthorne 1bef168976 Track image preparation details in turn analytics (#36388)
## What changed

- Record the effective detail setting and source and prepared dimensions for
  successfully decoded images.
- Associate message images with their role and tool-output images with their
  originating call ID.
- Include the collected image preparation metadata in the corresponding turn
  analytics event.

## Testing

- Cover image resize metadata, tool-output attribution, turn aggregation, event
  serialization, and app-server analytics output.

GitOrigin-RevId: dbfb5ba1ce7cb02dd93d9b579c5109817f16aef5
2026-07-31 20:34:41 +00:00
keith thornhill bf7804c254 Add acknowledged user message submission to core (#36385)
## What changed

- Add `CodexThread::submit_user_input_and_wait_for_admission` and export the
  `UserMessageAdmission` result through `codex-core-api`.
- Resolve submissions only after they start a new turn or steer the active
  turn, returning the accepting turn ID in either case.
- Return errors for invalid operations, rejected thread settings, and session
  termination instead of leaving admission waiters unresolved.

## Testing

Add integration coverage for concurrent start-and-steer submissions, settings
rejection and recovery, non-user operations, and submission after shutdown.

GitOrigin-RevId: 21f1ede38d399baa9836d61a59b9f9af2dbf83b8
2026-07-31 20:17:25 +00:00
Owen Lin 332eac4b85 Load turn summaries with paginated queries (#36384)
## Why

Loading the summary view issued a separate item query for every returned turn.

## What changed

Join each turn's first user and final agent items into the paginated turn query
when `StoredTurnItemsView::Summary` is requested. Preserve the existing fallback
that resolves inherited summary items for synthetic fork-boundary rows.

GitOrigin-RevId: add7f2e03c0809bbee85dc9f07bb6f91af92dfe7
2026-07-31 20:12:28 +00:00
joeytrasatti-openai c42ea41ee0 Add thread section management APIs (#36380)
## What changed

- Add `threadSection/create`, `threadSection/update`, and `threadSection/delete` app-server methods, with generated protocol schemas and TypeScript bindings.
- Persist custom sections in SQLite with stable UUIDv7 identities, trim and validate display names, and prevent renaming or deleting the built-in pinned section.
- Delete sections transactionally and return their active and archived threads to the unsectioned list.
- Serialize section mutations with section listing so concurrent requests observe ordered updates.

## Testing

- Cover section persistence across restarts, ordered renames, member cleanup on deletion, invalid requests, unsupported stores, and thread-store/state-runtime behavior.

GitOrigin-RevId: dc9a4be283c21dbc93ab1829eafc4825d8df6575
2026-07-31 19:08:45 +00:00
Charlie Marsh d62353a312 Load local session pickers from the state DB first (#36378)
## What changed

- Start local resume and fork picker listings from indexed state DB metadata, while preserving the existing store-backed behavior for remote workspaces.
- Keep the selected listing mode across pagination and fall back to the normal local store listing when the initial state DB request returns no rows or fails.
- Add coverage for pagination, fallback rendering, and selecting an indexed thread without validating its rollout file.

GitOrigin-RevId: 9005fbe73134e261bc6dd3f588c4fff494bdeea0
2026-07-31 18:58:32 +00:00
Sean Huang 2e32d95894 Enable sandboxed V8 for code mode (#36374)
## Why

Code mode must link against a V8 build with sandbox support, but Windows MSVC
still used upstream non-sandboxed prebuilts and package builds selected the
older release artifact profile.

## What changed

- Enable the `v8_enable_sandbox` feature directly for the code mode runtime.
- Select the `ptrcomp_sandbox_release` archive and bindings in Cargo packaging
  and CI, including Windows MSVC release builds.
- Point Bazel's Windows MSVC targets at the sandbox-enabled Codex artifacts and
  enable the matching crate feature.

## Testing

Add a runtime test that calls `v8__V8__IsSandboxEnabled()` and verifies that
the linked V8 library has sandbox support enabled.

GitOrigin-RevId: c1b49b44a6ccfea5b5006d69ec7866848d1cddd7
2026-07-31 18:32:28 +00:00
Dylan Hurd b7a6106608 Add an --approve-for-me CLI flag (#36373)
## What changed

- Add `--approve-for-me` to interactive and exec commands to route approval requests through automatic review.
- Configure the mode with `approval_policy="on-request"` and the `workspace-write` sandbox.
- Propagate the option across root, `exec`, `resume`, and `fork` argument handling while preserving later subcommand permission overrides.

## Testing

- Cover parsing, permission conflicts, root/subcommand precedence, resume handling, and the effective exec approval and sandbox modes.

GitOrigin-RevId: ae969e8c18f925f943049fefff56255f10b25659
2026-07-31 18:26:04 +00:00
Adam Perry @ OpenAI 845497f483 Run native Windows Bazel tests with MSVC (#36372)
## What changed

- Target `x86_64-pc-windows-msvc` in the post-merge native Windows Bazel job.
- Select the `//:windows_x86_64_msvc` target platform and the MSVC host platform.
- Update the job and execution-log artifact names to identify the MSVC target.

GitOrigin-RevId: ca7d65c8bc074dccb5e7ebbac3be80b97545a846
2026-07-31 18:22:06 +00:00
jif 775fb21d2a Keep effective tool exposure in the registry (#36367)
## Why

`ToolExecutor::exposure()` describes a tool's preferred exposure, while the host
may apply step-specific policy when building a tool plan.

## What changed

- Store each runtime together with its effective exposure in `ToolRegistry`.
- Apply MCP, namespace, and collaboration-tool exposure overrides directly to
  registry entries instead of wrapping runtimes.
- Use the registry-owned exposure when building model-visible specs, deferred
  tool search, code-mode executors, and parallel-call support.

## Testing

- Cover that a hidden MCP tool remains routable but is not eligible for parallel
  tool calls.

GitOrigin-RevId: 1bc2760add8d993f477954269fa13681bfcc2444
2026-07-31 17:24:33 +00:00
Ankush Gupta 287e1020ae Add strict automatic review for MCP elicitations (#36365)
## What changed

- Recognize the `codex_strict_auto_review` MCP elicitation marker and route
  marked approval requests through the configured automatic reviewer.
- Accept only canonical automatic-review approvals and fail closed without a
  user prompt when review is unavailable, denied, malformed, disallowed by
  policy, or requests persistence.
- Validate Codex Apps approval metadata against the active MCP invocation and
  build the review request from the trusted invocation details.

## Testing

- Add unit coverage for strict review decisions, malformed markers, reviewer
  failures, explicit policy denials, and lifecycle cleanup.
- Add app-server round-trip coverage for approvals, denials, configuration
  constraints, spoofed metadata, persistent requests, and subsequent turns.

GitOrigin-RevId: af73b45a9b63118f25f6429d95b3222c5dbb59fb
2026-07-31 17:18:08 +00:00
felixxia-oai 0d109f097c Move skill catalog rendering out of core (#36364)
## What changed

- Make the skills extension own the catalog prompt templates and rendering path.
- Remove the duplicate core fallback that injected available skills into initial context.
- Update core integration tests to install the skills extension explicitly when they expect model-visible skill context.

GitOrigin-RevId: bbe6b15c4e776a09c98b7f4166426fe4e58434ba
2026-07-31 17:12:10 +00:00
charlesgong-openai da2c7ca8d1 Migrate Cursor-managed skills into Codex (#36361)
## What changed

- Discover and import home-level Cursor skills from both `skills` and
  `skills-cursor`.
- Keep repository-level Cursor migration scoped to `skills`.
- Deduplicate skill names when reporting migration candidates from multiple
  source directories.

## Testing

- Add coverage for detecting and importing user and Cursor-managed skills.
- Verify repository detection continues to use the `skills` directory.

GitOrigin-RevId: 7b5e96a0d9c5ca14c61230e336728f2e4930a3b0
2026-07-31 16:40:53 +00:00
jif 385fe95ce1 Use MCP bindings as the step tool catalog (#36360)
## What changed

- Read the frozen MCP tool catalog directly from the step-scoped `McpBinding`
  when building tool routers, plugin injections, and connector state.
- Remove the redundant `Vec<ToolInfo>` from `StepContext` and stop returning a
  duplicate catalog from `built_tools`.

GitOrigin-RevId: d12d694e1224da3f6ccb1960868491f0d80c6e19
2026-07-31 16:35:14 +00:00
jif d97cb0dcad Consolidate MCP config editing in codex-core (#36359)
## What changed

- Route skill dependency updates through the shared `codex-core` `ConfigEditsBuilder`.
- Remove the duplicate MCP config writer and its tests from `codex-config`, while retaining MCP config loading there.

GitOrigin-RevId: cdce84c8353514529126156750433e859b78be3b
2026-07-31 16:28:22 +00:00
jif 66ebeb7037 Use the step-scoped router for tool execution (#36357)
## Why

Tool calls can outlive the sampling request that advertised them, so execution
must retain the finalized tool plan for that specific step.

## What changed

- Resolve tool runtimes, parallelism, cancellation behavior, argument diff
  consumers, and dispatch from the `ToolRouter` stored in `StepContext`.
- Remove the separate router parameter from `ToolCallRuntime` and code-mode
  worker construction so callers cannot supply a different router.
- Add a test helper for installing a router into a test `StepContext`.

GitOrigin-RevId: 9e476ddd228ca5b1c03ed87863618ba77de6200c
2026-07-31 16:23:53 +00:00
stefanstokic-oai bbbf396839 Sync updates to imported external agent sessions (#36356)
## Why

External agent session files can gain messages after their initial import. Re-importing those files should extend the existing Codex thread instead of creating a duplicate.

## What changed

- Map a changed source session back to its uniquely imported thread and append only the missing transcript suffix.
- Update the import ledger after verifying that the source and destination transcripts match.
- Defer the update when the target is active, archived, ambiguous, diverged, or otherwise unsafe to modify.

## Testing

Added unit and app-server coverage for suffix planning, ledger checkpointing, concurrent updates, and unsafe targets that must be deferred.

GitOrigin-RevId: 3d9e71cd66e8b31cf5128e8869063868bfb3eb05
2026-07-31 16:17:44 +00:00
jif c4f2746c43 Keep MCP tool calls bound to their thread (#36355)
## Why

Threads can configure the same MCP server name with different runtimes. Tool calls
must use the runtime associated with the thread that issued the call.

## What changed

- Route MCP readiness checks and call preparation through the invoking session.
- Add regression coverage that alternates calls between two threads and verifies
  that each thread continues using its own MCP server process and configuration.

GitOrigin-RevId: 5735f7b29a579f545351385ab01a575e35ead01e
2026-07-31 16:12:46 +00:00
jif 35eab50501 Pass sessions directly to session tasks (#36354)
## What changed

- Replace `SessionTaskContext` with `Arc<Session>` in the session task run and abort interfaces.
- Read extension data from `TurnContext` during regular turns instead of storing and forwarding a duplicate reference through the running task.

GitOrigin-RevId: 04bc0d324e5ba781f35ac9c61e811888208b74ae
2026-07-31 16:05:52 +00:00
rhan-oai 2c005abb07 Use model catalog collaboration mode messages (#36351)
## What changed

- Add optional `default` and `plan` collaboration-mode messages to model catalog metadata.
- Prefer the active mode's catalog message, including an explicit empty value, while falling back to the existing developer instructions when the catalog variant is absent.
- Track the model in collaboration-mode world state so mode and model changes append the appropriate instructions, and clear prior instructions when no current message exists.
- Preserve catalog collaboration messages when instruction overrides remove other model instruction fields.

## Testing

- Cover catalog deserialization, variant selection, fallback and empty-message behavior, legacy snapshot migration, mode changes, and model changes.

GitOrigin-RevId: d4c6c0028423bc50b0e8175e55586f3e7bc1c3a8
2026-07-31 15:40:52 +00:00