Commit Graph

9386 Commits

Author SHA1 Message Date
jif
325cf16194 Bound exec-server JSON-RPC decoding complexity (#33013)
## Why

Compact JSON arrays can expand into millions of heap values during decoding, and duplicate object keys make a message ambiguous.

## What changed

- Limit exec-server JSON-RPC messages to 256K JSON values and reject duplicate object keys.
- Cap `fs/read_directory` results and retained `process/read` output at 50,000 entries or chunks so locally produced responses remain within the decoder budget.

## Testing

Add coverage for all JSON-RPC variants, large scalar payloads, duplicate keys, compact array amplification, and retained process output at the chunk limit.

GitOrigin-RevId: e31d1f25ab0a7e2272015c98174fd2b7cdd669d7
2026-07-14 09:15:27 +00:00
Shijie Rao
d7ba5ff955 Always confirm before enabling full access (#32989)
## Why

Full access significantly increases the risk of data loss, leaks, or unexpected behavior, so users should explicitly confirm each time they select it.

## What changed

- Always open the full access confirmation when user-reviewed approvals are active, regardless of `notices.hide_full_access_warning`.
- Remove the persistent "don't ask again" option and its acknowledgement events.

## Testing

- Update the TUI permission tests and confirmation popup snapshot to cover repeated confirmation.

GitOrigin-RevId: 0ee827332441e13d9445349ed6a5a92dc8fef4b2
2026-07-14 06:55:29 +00:00
Dylan Hurd
1c9f890c05 Expose exact per-response usage in raw app-server events (#32985)
## Why

Clients that account for individual upstream Responses API calls need the exact
usage for each completion rather than accumulated or estimated thread usage.

## What changed

- Add the opt-in `rawResponse/completed` app-server notification with the
  `threadId`, `turnId`, `responseId`, and upstream `usage` payload.
- Emit the transient event for normal turns and compaction requests when
  `experimentalRawEvents` is enabled. The event is not persisted or replayed,
  and `usage` is `null` when the upstream response omits it.
- Export the notification in the app-server schemas and document its behavior.

## Testing

- Cover exact token breakdowns for turn and compaction completions.

GitOrigin-RevId: 49040a060bf1784c1ff1dd62112efb4a778428c4
2026-07-14 06:39:42 +00:00
pakrym-oai
393f64565a Scope runtime workspace roots to execution environments (#32952)
## Why

Multi-environment turns can run against different filesystems, so a single
thread-wide workspace-root list cannot accurately describe every selected
environment.

## What changed

- Add optional `runtimeWorkspaceRoots` to each app-server environment selection.
  Omitted roots default to that environment's `cwd`, while an empty list selects
  no roots.
- Carry environment-native roots through turn selection, model-visible context,
  permission materialization, and tool sandboxing.
- Keep the top-level `runtimeWorkspaceRoots` field as a compatibility input when
  constructing default environment selections; explicit selections use their
  own roots.

## Testing

- Cover thread and turn API defaults, overrides, empty roots, and schema
  round-tripping.
- Verify foreign roots remain model-visible and remote execution applies the
  target environment's roots before sandbox selection.

GitOrigin-RevId: c6e7a62883c45c676c153055f46a55ee15a323a4
2026-07-14 04:41:08 +00:00
Matthew Zeng
b019a5577c Tighten recommended plugin install suggestions (#32949)
## What changed

- Limit `request_plugin_install` guidance to explicitly requested plugins after tool search has been exhausted.
- Exclude adjacent capabilities, broad recommendations, and plugins that only seem potentially useful.
- Clarify that `plugin_id` is the parenthesized ID from `<recommended_plugins>` and prohibit parallel tool calls.
- Keep the recommendation context focused on listing available plugins while the tool specification owns the installation criteria.

## Testing

- Update tool specification tests to verify the stricter eligibility and serialization guidance.

GitOrigin-RevId: 6ebfdd864a76316ab59a0624dc4d7d3abda39a98
2026-07-14 04:29:57 +00:00
Won Park
0d78fa8846 Restrict Guardian reviewer tools (#32945)
## What changed

- Limit Guardian reviewer sessions with an environment to `exec_command`,
  `write_stdin`, and `view_image`.
- Exclude general tool sources from Guardian reviewer tool planning.

## Testing

- Extend the Guardian request snapshot test to assert the exact model-visible
  tool list.

GitOrigin-RevId: 80ba7011c23c32d163aaad906087fac396cc70fa
2026-07-14 04:15:19 +00:00
Owen Lin
b24aa20107 Resume thread history projection from its SQLite checkpoint (#32928)
## Why

Thread history JSONL is the durable source of truth, while SQLite is a rebuildable view. If a SQLite projection fails after a durable append, the next write must catch up the unprojected suffix instead of skipping it.

## What changed

- Start materialization at the byte offset stored in `thread_history_projection_state`.
- Project only complete newline-terminated rollout records, leaving a trailing partial record for a later pass.
- Preserve validation for missing files, invalid offsets, and missing or out-of-order ordinals without advancing projection state.

## Testing

Add coverage for catching up after projection failure, avoiding replay when already synchronized, retaining partial lines, and rejecting invalid suffixes without changing SQLite state.

GitOrigin-RevId: 8a7200a77edd5411ddf5fe31ab6af5ee287ed7d7
2026-07-14 02:22:57 +00:00
Owen Lin
0ef9fa4d65 Materialize paginated thread history in SQLite (#32923)
## What changed

- Project durable paginated rollout records into rebuildable SQLite tables for turns, items, and projection progress while keeping JSONL as the source of truth.
- Add cursor-based local reads for turn summaries and thread or per-turn items, including archived-thread and history-mode validation.
- Serialize writes, shutdown, and deletion per thread so projection updates cannot race cleanup, and remove projected rows when a thread is deleted.
- Preserve stable item ordering while updating repeated snapshots and expose structured turn error details.

## Testing

- Cover projection, snapshot updates, summary recovery, pagination, failure handling, shutdown flushing, legacy-mode rejection, and deletion races.

GitOrigin-RevId: 34533185ece7f1f5690004c7f12b0f1f34dc2640
2026-07-14 02:00:39 +00:00
Adam Perry @ OpenAI
f96cf4d1c3 Expose environment status through app-server (#32920)
## What changed

- Add the experimental `environment/status` request for inspecting a configured environment without starting or reconnecting it.
- Report `ready`, `pending`, `disconnected`, or `unknown`, including error details for disconnected and unknown environments.
- Probe ready remote environments over their existing exec-server connection.

## Testing

- Add an app-server integration test covering local and remote ready, pending, disconnected, and unknown environments.

GitOrigin-RevId: 397bba603aa9e0b59008ee6cb7cbde46e357652c
2026-07-14 01:49:16 +00:00
richardopenai
80c6cd3014 Allow injecting the models manager into ThreadManager (#32911)
## Why

Embedding callers need to control whether model catalogs are persisted to disk.

## What changed

- Accept a shared models manager when constructing `ThreadManager` instead of always creating a cached manager internally.
- Add provider APIs for creating uncached model managers. OpenAI-compatible providers fetch on each `OnlineIfUncached` refresh without reading or writing `models_cache.json`.
- Keep existing app server, MCP server, sample, and test callers on the standard cached manager.

## Testing

- Verify an uncached manager fetches on every refresh.
- Verify an injected uncached manager controls thread refresh behavior and does not create `models_cache.json`.

GitOrigin-RevId: 8bb646054ecec4ccb865b2bf56249384916ea9db
2026-07-14 01:06:11 +00:00
Owen Lin
c39520f3d1 Timestamp app-server notifications at emission (#32905)
## What changed

- Add an optional `emittedAtMs` field to server notification envelopes and expose the envelope in the generated JSON and TypeScript schemas.
- Populate the Unix timestamp when app-server emits a notification, before transport routing, so every connection in a fan-out receives the same value.
- Keep the field optional for clients decoding notifications from older app-server versions.

## Testing

- Verify notification serialization includes `emittedAtMs`.
- Verify targeted fan-out reuses one timestamp across connections.

GitOrigin-RevId: b379cb11e8e91c558bcd3d46ce459311a6e81e54
2026-07-14 00:38:04 +00:00
marksteinbrick-oai
7f3eb8a223 Include session IDs in tool item analytics events (#32903)
## What changed

- Add `session_id` to the shared tool item event payload, sourced from the
  thread metadata.
- Preserve the parent session ID on tool events emitted by subagent threads.

## Testing

- Cover serialization of the session ID for command execution events,
  subagent tool events, and every supported completed tool item type.

GitOrigin-RevId: 73afc0e1be1ddec4fb5a42f43a23f1e87360e68f
2026-07-14 00:19:01 +00:00
Ahmed Ibrahim
4657ab06c6 Derive collaboration settings from turn context (#32900)
## Why

`TurnContext` stored model and reasoning settings both as resolved turn fields and inside `CollaborationMode`, requiring the copies to stay synchronized when the model changed.

## What changed

- Store the mode and collaboration-mode developer instructions directly on `TurnContext`.
- Reconstruct `CollaborationMode` from those values plus the turn's current model and reasoning effort when callers need it.
- Read the mode directly for plan-mode checks, lifecycle events, and telemetry.

GitOrigin-RevId: b8fccafdd5d5cbccc84bc70d542588087ddf0093
2026-07-13 23:48:42 +00:00
Adam Perry @ OpenAI
75470c3e2f Add exec-server environment status checks (#32899)
## What changed

- Add the initialized `environment/status` RPC, which reports `ready` when the exec server can handle requests.
- Expose environment IDs and `ready`, `pending`, or `disconnected` status through `EnvironmentManager` and `Environment`.
- Keep status checks non-mutating: they do not start or recover lazy remote environments, and probe only an existing connection.

## Testing

- Cover the status RPC over WebSocket and the in-process request processor.
- Verify that checking an unstarted stdio environment leaves it pending and that failed connections report as disconnected.

GitOrigin-RevId: 22febeb6a3457849292128a8991c6400c22b3fd8
2026-07-13 23:43:15 +00:00
briansong-oai
2ca20d5224 Expose structured standalone web search results (#32898)
## Why

Standalone web search can return structured result DTOs separately from its
model-facing text output. App-server clients need access to that data without
coupling Codex to every result type or field.

## What changed

- Preserve the optional `results` array from `/v1/alpha/search` as opaque JSON
  through web-search completion events, thread history, and app-server
  `webSearch` items.
- Keep responses from older endpoints compatible when `results` is absent, and
  allow clients to ignore result types and fields they do not understand.
- Regenerate the protocol schemas and TypeScript definitions for the optional
  field.

## Testing

- Cover responses with missing, empty, and forward-compatible result payloads.
- Verify standalone web-search results round-trip through app-server item
  notifications and thread-item conversion.

GitOrigin-RevId: 739ef5694ece5733f7b8749ec41d6bfa3f33c8c5
2026-07-13 23:37:35 +00:00
Dylan Hurd
090f4de37b Route blocked network requests to their owning calls (#32897)
## Why

Policy-blocked proxy requests must terminate the corresponding active tool call and preserve the correct approval result, including when multiple calls are running concurrently.

## What changed

- Resolve a blocked request's execution ID to its registered active network call before recording the policy denial.
- Preserve an outcome already recorded for that call, and cancel the owning call after storing a new denial.

## Testing

Expand network approval integration coverage for Guardian and user decisions, permission hooks, persisted policy amendments, concurrent calls, timeouts, cancellations, and unattributed proxy requests.

GitOrigin-RevId: 961901bbc07cc498309453ec78cda1a56ab00a4b
2026-07-13 23:33:58 +00:00
Owen Lin
592467fb96 Load model context from a bounded rollout suffix (#32896)
## Why

Reconstructing the latest model-visible context does not require replaying an
entire paginated rollout when a usable compaction checkpoint and the associated
completed-turn metadata are available.

## What changed

- Add `ThreadStore::load_latest_model_context` and `StoredModelContext` for
  loading replay-ready model context independently of full thread history.
- Reverse-scan plain paginated JSONL rollouts until the newest safe bounded
  suffix is found, while preserving canonical session metadata and chronological
  replay order.
- Fall back to complete history for legacy or compressed rollouts and whenever
  compaction or rollback records make a bounded cutoff unsafe.

## Testing

- Cover checkpoint selection, turn-metadata boundaries, agent messages,
  contextual user fragments, and full-history fallbacks.

GitOrigin-RevId: 3572f4ecc7aa4099a6d9f0d3e72d0ef432cd9497
2026-07-13 23:29:59 +00:00
Matthew Zeng
7fdf2f254b Serialize plugin install requests (#32894)
## What changed

- Mark `request_plugin_install` as not supporting parallel tool calls so install requests execute serially.
- Add a unit test covering the handler's parallel-call capability.

GitOrigin-RevId: 5f2c8184562bd776b0e527e5e258c61c604a0910
2026-07-13 23:17:38 +00:00
stevenlee-oai
fb350d1e7d Attach connector caches to diagnostic uploads (#32891)
## What changed

- Include the active Codex Apps tools cache and connector directory cache, when available, in diagnostic uploads that include logs.
- Resolve cache paths from the current authentication context and use stable attachment filenames.
- List both optional cache files in the upload consent dialog.

## Testing

- Add coverage for selecting existing active cache files, including a directory cache without an account ID.
- Update consent dialog snapshots to include the optional attachments.

GitOrigin-RevId: 1d4ffbf2bcb96653f03dc25f91d80dd65038d585
2026-07-13 22:50:28 +00:00
jif
bb947e8e36 Tag shell tool telemetry by command category (#32887)
## What changed

Add a `command_category` tag to tool result telemetry for `exec_command` and
`shell_command` invocations. Classify parsed commands as `read`, `list_files`,
`search`, or `unknown`; use `mixed` when a script contains multiple categories.

GitOrigin-RevId: 1edacb38c7be9b03af4f2fc86746184f19067592
2026-07-13 22:34:16 +00:00
charlesgong-openai
bc8222b8d9 Prepare external agent migration for source adapters (#32884)
## What changed

- Add an optional `source` selector to `externalAgentConfig/detect`, while preserving the existing behavior for omitted, `null`, and unrecognized values.
- Pass `claude-code` as the source for TUI detection and import requests.
- Move source-specific migration behavior behind an adapter boundary and consolidate session migration into `codex-external-agent-migration`.

## Testing

- Cover explicit, omitted, and unknown detection source values with app-server protocol tests.
- Add unit coverage for the extracted migration and hook helpers.

GitOrigin-RevId: 63bd3dcb485f3ad7bd996022db4e351506aeea77
2026-07-13 22:15:55 +00:00
Celia Chen
0877afbe85 Broaden remote compaction model fallback (#32881)
## Why

Compacting a resumed conversation can fail when its previous model is no longer
available. Some model-specific failures, such as a model-not-found response, are
not represented as invalid requests and therefore did not trigger the existing
fallback to the currently selected model.

## What changed

- Share a retry predicate between both remote compaction implementations.
- Fall back to the current model for invalid requests, unexpected statuses,
  context-window and usage-limit errors, server failures, and exhausted retries.

## Testing

Add an integration test that resumes a conversation whose previous model returns
model-not-found and verifies that compaction and the next turn use the renamed
model.

GitOrigin-RevId: c3857beae2ce79b50589deb13c2e59710ce14725
2026-07-13 21:54:04 +00:00
rhan-oai
60b9b551c1 Use model catalog policies for Guardian auto review (#32875)
## What changed

- Add an `auto_review.policy` field to model catalog messages.
- Use the selected Guardian model's catalog policy for review-session instructions, while preserving the precedence of `guardian_policy_config` and falling back to the built-in policy when neither is present.
- Preserve auto-review messages when model instruction overrides remove catalog instruction templates.

## Testing

- Cover configured-policy precedence, explicit empty catalog policies, catalog-message preservation, and propagation of the catalog policy into a prewarmed Guardian session.

GitOrigin-RevId: 26b61ae2958ea8325a64834dcf91f47e140d74b3
2026-07-13 21:25:28 +00:00
Chris Dong
bbfa08fe3b Include connector IDs in MCP tool call analytics (#32867)
## What changed

- Add the optional `connector_id` to `codex_mcp_tool_call_event` parameters.
- Populate it from the MCP tool call's `app_context` when available.

## Testing

- Extend the completed tool item analytics test to verify the connector ID is serialized.

GitOrigin-RevId: ea62202318dd492fa0ffd4ff1d48a66d1cc37e96
2026-07-13 20:16:38 +00:00
Won Park
6e113acf5f Allow responses after image generation (#32866)
## What changed

Remove the image generation instruction that prohibited any response after an
image was generated.

GitOrigin-RevId: c779055da3142ba84cdbb9312e5f66b132f24b29
2026-07-13 20:12:42 +00:00
iceweasel-oai
3370181ec6 Coalesce concurrent Windows sandbox setup requests (#32864)
## Why

Concurrent callers can submit the same Windows sandbox setup payload while an
identical helper invocation is already running.

## What changed

- Share one in-flight helper invocation among setup and refresh requests with
  identical serialized payloads.
- Return the shared success or failure to every waiter while preserving
  structured setup error codes, then allow subsequent requests to run again.

## Testing

- Add a concurrency test that verifies identical requests execute the setup
  operation once.

GitOrigin-RevId: 18ebbcb9b36de3eb5912b8bbbe153d39328b5e48
2026-07-13 20:06:15 +00:00
Charlie Marsh
bbe93d3e5f Persist slash-command popup dismissal (#32858)
## What changed

- Make `Esc` dismiss the slash-command popup immediately without changing the draft or interrupting a running task.
- Keep the popup closed while the first-line command token is unchanged, and reopen it after the token is edited.

## Testing

- Cover dismissal while idle and while a task is running.
- Add a snapshot confirming that the dismissed popup remains hidden.

GitOrigin-RevId: f0ee84af080181e8d92c435f474ded1c8cb5b457
2026-07-13 19:08:11 +00:00
iceweasel-oai
abbb8c569c Require the elevated Windows sandbox for network proxies (#32857)
## Why

Network proxy enforcement on Windows requires the elevated sandbox backend. Silently selecting that backend for an unelevated configuration makes the effective sandbox differ from the configured mode.

## What changed

- Reject enabled network proxy configurations on Windows unless managed requirements allow only the elevated sandbox and `windows.sandbox` resolves to `"elevated"`.
- Preserve the configured sandbox backend during execution and validate proxy compatibility at config loading, sandbox setup, and process launch boundaries.
- Defer this validation during cloud-config bootstrap so authoritative managed requirements can be loaded first.
- Do not start or expose disabled Windows proxies, and render transitions to disabled networking as `<network enabled="false"></network>`.

## Testing

- Cover Windows requirement and sandbox compatibility matrices, bootstrap behavior, backend selection, disabled proxy handling, and environment-context updates.

GitOrigin-RevId: bfa1dda98594e0db61883f8e7f65bd560e3453e6
2026-07-13 19:04:22 +00:00
zm-oai
87f3e39fdf Hide Windows filesystem helper console windows (#32849)
## What changed

- Add a console mode to the Windows sandbox process launcher.
- Launch `--codex-run-as-fs-helper` subprocesses with `CREATE_NO_WINDOW`.
- Preserve inherited-console behavior for regular sandboxed commands.

GitOrigin-RevId: 927be36b82903b6a5fb1a243ba7f406f9ed85f3f
2026-07-13 18:25:55 +00:00
keith thornhill
84696e3d57 Expand millisecond duration histogram boundaries (#32844)
## What changed

Add finer-grained buckets from 1 to 10 seconds and extend millisecond duration histograms with buckets up to 120 seconds.

GitOrigin-RevId: dee492de08db058444926d22281ef7bc4ba1cdeb
2026-07-13 18:00:10 +00:00
Teddy Ni
b36c0b1189 Reap exited PID-managed app-server children (#32838)
## Why

An app-server child started by a previous updater can remain as a zombie after
termination. Its PID then still appears active, causing daemon shutdown to wait
until its timeout instead of removing the stale PID file.

## What changed

- Poll `waitpid` with `WNOHANG` while waiting for a PID-managed process to stop.
- Check process state before enforcing the stop deadline so an exit at the
  deadline can still be observed and cleaned up.

## Testing

Added a regression test that stops an untracked child and verifies that shutdown
finishes promptly and removes its PID file.

GitOrigin-RevId: b203cf860e4207716a6cfc36015f8ee77918d13a
2026-07-13 17:33:13 +00:00
jif
088239294a Restore V2 agent identities on root thread resume (#32837)
## Why

After a cold resume, a Multi-Agent V2 root thread must still be able to
address its persisted descendants even though their runtimes are not reopened
eagerly.

## What changed

- Restore metadata for open descendant agents when resuming a V2 root thread.
- Preserve each descendant's path, nickname, and role while leaving its runtime
  unloaded until a message targets it.
- Reuse the spawn metadata preparation path so restored identities retain the
  same reservation and naming checks as newly spawned agents.

## Testing

Added an end-to-end cold-resume test that follows up with a persisted agent by
name and verifies that the original agent thread is loaded on demand.

GitOrigin-RevId: a1663c1ae60eefadb948cd39f933cd3bbb49a492
2026-07-13 17:24:10 +00:00
XMLIU-oai
19a000259d Forward turn metadata in standalone web search (#32835)
## What changed

- Add optional serialized Codex turn metadata to extension tool calls.
- Populate it from the current turn context and send it as the
  `x-codex-turn-metadata` header on standalone web search requests.

## Testing

- Extend the app-server web search integration test to verify that client
  metadata, including the model ID, reaches the standalone search request.

GitOrigin-RevId: c0950108d89a1d317ac94ccd23efcee72fffc6f0
2026-07-13 16:52:18 +00:00
jif
2e156cbe31 Avoid blocking thread startup on MCP OAuth discovery (#32825)
## Why

OAuth metadata discovery for an optional HTTP MCP server can stall, delaying
`thread/start` even though that server is not required.

## What changed

- Remove eager MCP authentication-status discovery from session and connection
  manager startup.
- When an MCP connection reports an authentication error, inspect configured and
  stored credentials locally to preserve login and reauthentication failure
  reasons without making another discovery request.
- Continue using server configuration directly for startup error messages and
  timeout hints.

## Testing

Add an app-server regression test with an optional HTTP MCP endpoint that accepts
a connection but never responds, and verify that `thread/start` completes without
waiting for its configured startup timeout.

GitOrigin-RevId: 56fe0188cc1ceaf746b0b65e8b7dd1fd2e13420d
2026-07-13 15:47:03 +00:00
jif
4ebc61c0f8 Make explicit multi-agent mode override proactive delegation (#32822)
## Why

After switching from proactive delegation to explicit-request-only mode, an
earlier proactive instruction can remain in the conversation context. The new
mode must clearly supersede that instruction.

## What changed

Update the explicit-request-only developer message to cancel earlier proactive
delegation instructions before requiring delegation to be explicitly requested
by the user, `AGENTS.md`, or a skill.

## Testing

Update the multi-agent mode integration test expectation for the explicit-mode
instruction emitted after a cold resume.

GitOrigin-RevId: 0a6d18f38ef82d29cf4f3bfcfd4ac84738a39598
2026-07-13 15:39:24 +00:00
jif
c7a4a7e136 Refactor OAuth store lock contention tests (#32801)
## What changed

- Extend the lock-contention test helper with a callback that runs while the
  aggregate store lock is held.
- Use a scoped worker thread and return its result directly after releasing the
  lock.
- Reuse the helper for concurrent update tests covering both file and secrets
  credential stores.

GitOrigin-RevId: 74b8b5370456e90ecd39fc2af2f0853594ca4f60
2026-07-13 13:56:34 +00:00
jif
8b2c84ddcc Apply MCP startup timeouts during client creation (#32781)
## What changed

- Apply each server's `startup_timeout_sec` (or the default) while creating the
  MCP client, so the deadline also covers transport setup.
- Launch local stdio servers on a blocking task so synchronous command
  resolution and process creation do not prevent the deadline from firing.
- Recognize the new client-startup timeout error and show the existing
  `startup_timeout_sec` configuration hint.

## Testing

- Extend the timeout error display test to cover the client-startup timeout.

GitOrigin-RevId: 1967c62f943d55f6aa18792d4488e52c22f1e717
2026-07-13 12:00:50 +00:00
jif
4477b20713 Enable skill search shadow selection by default (#32780)
## What changed

Mark `skill_search` as stable and enable it by default so the app server runs
shadow skill selection and emits its experiment metrics.

GitOrigin-RevId: ea9da3b71bfb3be2093aac89ad3d3e388931901d
2026-07-13 11:46:25 +00:00
jif
2b0b37abb7 Align shadow skill selection with observable sources (#32768)
## Why

Shadow selection can observe invocations from host and orchestrator skills, but
including executor skills in its candidates can skew the resulting metrics.

## What changed

Limit eligible shadow-selection candidates to enabled, prompt-visible skills
from host or orchestrator sources.

## Testing

Extend the implicit-invocation test to add matching executor candidates and
verify that the host skill remains the selected invocation hit.

GitOrigin-RevId: fd444fe27254b5a880ef5c03c29b5e195127cd97
2026-07-13 11:05:31 +00:00
jif
c100109280 Add shadow metrics for lexical skill selection (#32761)
## What changed

- Add an opt-in `skill_search` feature that ranks prompt-visible skills against each turn's user input with a bounded weighted lexical selector.
- Keep the ranked selection out of model-visible context and record metrics for selection cost, catalog reduction, and whether later implicit or `skills.read` invocations matched the ranked candidates.
- Include host-provided skills in the experiment catalog without changing the rendered skill catalog.

## Testing

- Add selector unit tests covering ranking, limits, truncation, stop words, and deterministic tie-breaking.
- Add extension tests covering turn-local invocation recording and host-skill shadow selection.

GitOrigin-RevId: 4d00a1c805ea8b391d6c6ac6a8450afa88ca3e25
2026-07-13 10:38:37 +00:00
jif
92938d880e Restrict spawned-agent models to the active backend (#32751)
## Why

Model overrides for `spawn_agent` must be compatible with the multi-agent backend used by the current turn.

## What changed

- Carry each model's multi-agent backend metadata into `ModelPreset`.
- Filter the advertised `spawn_agent` model overrides for multi-agent v2 and reject overrides assigned to another backend.
- Limit error suggestions to picker-visible, backend-compatible models.

## Testing

Added coverage for hiding incompatible models from the tool description and rejecting them during spawn validation.

GitOrigin-RevId: 22c12aba67df46e9743a74f019b72a1b8b76b308
2026-07-13 09:52:27 +00:00
jif
ea15456284 Expose model overrides for multi-agent v2 spawns (#32749)
## What changed

- Add the `features.multi_agent_v2.expose_spawn_agent_model_overrides` setting, enabled by default, to expose `model` and `reasoning_effort` on the v2 `spawn_agent` tool.
- Keep these controls available when other spawn metadata is hidden, while allowing them to be disabled independently.
- Add root-agent and subagent guidance that overrides require a partial or context-free fork and should only be used when explicitly authorized.

## Testing

- Cover configuration parsing and defaults, usage-hint preservation, and tool-schema behavior with override exposure enabled and disabled.

GitOrigin-RevId: 92370498108c96fbd51f32965624ce531e991d9a
2026-07-13 09:48:33 +00:00
Dylan Hurd
ea0fd84d94 Align Guardian reviews with session configuration (#32747)
## What changed

- Include permission instructions in Guardian review requests and let the review model use its configured tool mode and standard tool plan instead of a Guardian-specific direct-tool override.
- Refine the Guardian policy for tenant policy precedence, authorization scoring, prompt-injection handling, read-only investigation, and post-denial user approval.
- Simplify low-risk allow responses to `{"outcome":"allow"}` regardless of authorization scoring.

## Testing

- Update Guardian request-layout snapshots to cover the permission instructions included in initial and follow-up reviews.

GitOrigin-RevId: eb83571ef61f7b4e854c12e13e7163c6fab43f00
2026-07-13 09:44:56 +00:00
Felipe Coury
769a5de257 Make advanced reasoning selection explicit in the TUI (#32746)
## Why

`Max` and `Ultra` consume usage limits faster than standard reasoning levels, so they should not be selected accidentally while navigating the normal effort scale.

## What changed

- Move `Max` and `Ultra` behind a `More reasoning…` entry with a dedicated warning and descriptions.
- Keep the reasoning shortcuts from silently increasing into advanced efforts.
- Apply `Ultra` to the active conversation without changing defaults for new threads, while preserving it across mode switches and thread resumes.
- Record applied thread settings in thread metadata, including explicit clearing of reasoning effort, so resumed threads restore their latest model settings unless the user supplied an override.

## Testing

- Add TUI coverage for the advanced picker, shortcuts, Plan mode, configuration defaults, and resumed conversations.
- Add app-server and thread-store coverage for persisting, clearing, and restoring model and reasoning settings.

GitOrigin-RevId: 6708c7c2e8d38f491bf63000ea34f83476afdfe6
2026-07-13 09:40:51 +00:00
rhan-oai
2a4942c081 Log missing personality messages at trace level (#32744)
## What changed

Emit the diagnostic for a requested personality without model-specific messages
at `trace` instead of `warn`. The existing fallback to `base_instructions` is
unchanged.

GitOrigin-RevId: f7a00d28b57d4a6513df5d43c9456ae9b16c738b
2026-07-13 09:36:31 +00:00
Matthew Zeng
2f7d89b141 Extract connector runtime snapshot management (#32698)
## What changed

- Move the Codex Apps tool cache into a reusable `codex-connectors` runtime manager keyed by account and workspace.
- Represent cached tools as atomically published snapshots with refresh timestamps while preserving the newest accepted fetch generation.
- Harden disk persistence with bounded reads, atomic file replacement, and serialized writes so an older fetch cannot overwrite newer state.

## Testing

Add coverage for identity isolation, snapshot timestamps, oversized cache files, atomic replacement, and concurrent persistence ordering.

GitOrigin-RevId: 5ea2234469daae3abf54b030244c3251de62ca5a
2026-07-13 05:02:52 +00:00
Charlie Marsh
c888e8e75a Improve composer completion target resolution (#32628)
## What changed

- Resolve `@` and `$` completion targets on either side of the cursor while treating atomic text elements and line breaks as boundaries.
- Prefer the nearest editable mention when file, skill, and plugin candidates compete, and avoid treating common uppercase environment variables as skill queries.
- Insert a separator before completions adjacent to atomic elements and keep dismissed popup state scoped to the matching editable token occurrence.

## Testing

- Add unit and snapshot coverage for adjacent and partially bound mentions, whitespace boundaries, shell variables, popup dismissal, and file, image, skill, and plugin insertion.

GitOrigin-RevId: 352a42c7bcdbf4f6cd35368ced25f71926fdbc1b
2026-07-12 19:18:37 +00:00
Felipe Coury
9e552e9d15 Use available width for skill names in the toggle view (#32485)
## Why

The skill toggle view truncated every display name to 21 characters, even when
the popup had enough room to show more. This could hide the part that
distinguishes similarly named skills.

## What changed

- Pass full skill display names to the shared row renderer so it can fit them
  to the available width alongside descriptions.
- Keep narrow layouts bounded by the renderer's width-aware truncation.

## Testing

Added coverage for preserving and filtering full display names, plus snapshots
for wide and narrow popup layouts.

GitOrigin-RevId: c434237e00440f920d8aa9c365b6bda5e68e0941
2026-07-11 21:03:12 +00:00
Felipe Coury
385c0a9351 Expand tabs when rendering TUI diffs (#32461)
## What changed

- Replace tab characters in rendered diff spans with four spaces while keeping
  their wrapping width and style intact.
- Ensure diff buffers never contain literal tab characters.

## Testing

- Cover tab expansion and wrapping in `wrap_styled_spans`.
- Update diff gallery snapshots at multiple terminal sizes.

GitOrigin-RevId: 2159e84991b844ea8c4c57dfad52bc3fe7a9059f
2026-07-11 17:47:17 +00:00
Eric Traut
bbdf3030de Emit thread-idle lifecycle after guardian interrupts (#32460)
## What changed

- Emit the thread-idle extension lifecycle when the guardian successfully aborts an active turn after repeated automatic review denials.
- Keep user-initiated interrupt behavior unchanged.
- Add a regression test that waits for the thread-idle callback after a guardian interrupt.

GitOrigin-RevId: 6622c35361a3da9126c11bd6ca49a532c1bd6e27
2026-07-11 17:13:16 +00:00