Commit Graph

9740 Commits

Author SHA1 Message Date
pakrym-oai
4aa52f2cb2 Gate content item kinds behind a feature flag (#40450)
## What changed

- Add the under-development `content_item_kinds` feature, disabled by default.
- Strip content item classifications from Responses input when the feature is
  disabled while preserving other passthrough metadata.

## Testing

- Add coverage that disables the feature and verifies requests omit content item
  kinds without removing the turn ID.

GitOrigin-RevId: f938feb2895d766d979b1666fc7b97fd128fe8a7
2026-08-24 18:22:13 +00:00
jif
2126f93617 Route peer agent completion activity to the initiating turn (#40449)
## What changed

- Record the initiating agent path when inter-agent communication triggers a turn.
- Emit completed subagent activity to that agent's turn instead of always using the completed agent's parent thread.
- Keep parent-directed completion messages unchanged.

## Testing

Added a multi-agent v2 regression test where one sibling requests follow-up work from another and receives the resulting completion activity on the requesting turn.

GitOrigin-RevId: 949dd1116cccdd461c66a9b213a5bcd554cb3720
2026-08-24 18:15:04 +00:00
jif
0fe877b4de Retry failed shell snapshot captures (#40447)
## Why

A failed shell snapshot capture was cached for the lifetime of its cache entry, so later commands continued using the original command even after a transient profile error was fixed.

## What changed

- Retry failed captures after a one-second backoff, up to three total attempts.
- Share each attempt across concurrent requests and preserve command fallback during failures and backoff.
- Keep the final failure cached after the retry budget is exhausted.

## Testing

Cover recovery and retry exhaustion for concurrent requests, local and remote execution, pipes and TTYs, and Bash and zsh where available.

GitOrigin-RevId: b432ef7c9eb35a3a0a703ac675b4db6954c43a80
2026-08-24 18:09:47 +00:00
jif
eb15245d82 Batch sandboxed capability root discovery (#40443)
## What changed

- Run capability discovery for roots with the same sandbox context in one sandbox helper invocation.
- Keep roots with different sandbox permissions isolated, and fall back to per-root discovery if the batched invocation fails.

## Testing

- Add coverage for single-launch batching, fallback after a sandbox launch failure, and roots with different permission profiles.

GitOrigin-RevId: a6e185a8edfd028fc3639b7c6c3cc7da342b6fe3
2026-08-24 17:39:16 +00:00
zm-oai
a12c4f4c01 Preserve Windows root reads with deny-read rules (#40441)
## What changed

- Detect readable symbolic `:root` entries separately from effective full-disk access so narrower deny-read rules do not disable the Windows sandbox's broad-read setup.
- Add explicit readable roots to that setup while omitting the filesystem root itself, and prevent read roots at or below denied paths from being granted access.

## Testing

- Extend the elevated Windows sandbox integration test to verify that an allowed bundled skill under the user profile remains readable while exact and glob-based secrets stay denied.

GitOrigin-RevId: 8f6f267b78718b9e8609a9205c489f253f478491
2026-08-24 17:29:21 +00:00
felixxia-oai
3470b807b4 Use rust-lld for Bazel Windows MSVC Rust links (#40438)
## What changed

- Configure x86_64 Windows MSVC `rules_rs` toolchains to use the bundled
  `rust-lld` linker.
- Make `rules_rust` select the configured direct linker for that target unless
  the toolchain explicitly prefers the C compiler driver.

GitOrigin-RevId: 941a1ca42b931cbb9e1c2d68300b8a82a5250be8
2026-08-24 17:17:25 +00:00
jif
b705b6b076 Report completed sub-agent activity on parent turns (#40437)
## Why

A Multi-Agent V2 child can finish after the parent turn that spawned it, so its
successful completion needs to remain associated with that parent turn in
notifications and history.

## What changed

- Add `completed` to `SubAgentActivityKind` and emit the corresponding started
  and completed item events on the spawning parent turn when a child succeeds.
- Persist completed activity as a canonical turn item in both legacy and
  paginated history, and expose it through app-server history and schemas.
- Render completed activity as terminal in the TUI without counting it as a
  separate tool call or tool-runtime event.

## Testing

- Cover successful completion in legacy and paginated history, late updates to
  completed parent turns, TUI rendering, analytics, and rollout tracing.
- Verify that terminal child errors do not emit completed activity.

GitOrigin-RevId: 6c71eb8b10e7327611c6af84f70e294e27d94d02
2026-08-24 17:07:21 +00:00
Shijie Rao
7781f0a5a8 Add a managed gate for in-app local automation (#40436)
## What changed

- Register the stable, requirements-only `in_app_local_automation` feature for desktop apps.
- Add the feature to the configuration schema.
- Verify that an enterprise requirement can disable local automation.

GitOrigin-RevId: 939f7f3ee15f662dc85589cd1bcc3838e4cd1287
2026-08-24 16:56:50 +00:00
felixxia-oai
523519d974 Render Guardian review evidence with async scorer truncation (#40431)
## What changed

- Retain completed synchronous Guardian reviews as structured records until the async scorer builds its classification input.
- Render and bound review correlation, action, rationale, and full evidence body with the async scorer's transcript truncation marker.
- Extend the Guardian V2 integration test to verify oversized action and rationale content is truncated and the resulting review evidence remains bounded.

GitOrigin-RevId: 0000ba77b810748e34254dd00df4a69f8492e175
2026-08-24 16:41:55 +00:00
zm-oai
0d9bb6c34c Harden Windows file URI conversion (#40423)
## What changed

- Recognize percent-encoded drive colons when inferring Windows paths, rendering
  native path strings, and resolving same-drive relative joins.
- Reject Windows file URIs with percent-encoded `/` or `\` separators before
  converting them to native absolute paths, so decoding cannot reinterpret URI
  segment boundaries.

## Testing

- Cover uppercase and lowercase encodings for drive colons and path separators,
  including local-drive and UNC file URIs.

GitOrigin-RevId: ecb6c92f4ef1af73f85e57a135abf6bc5bb968dc
2026-08-24 15:54:16 +00:00
iceweasel-oai
09609ba414 Harden Windows updater command execution (#40422)
## Why

Windows update commands could be influenced by the current project through
relative `PATH` entries or project-local package-manager configuration.

## What changed

- Resolve package-manager commands and `powershell.exe` using only absolute
  `PATH` entries before starting an update.
- Run the resolved command from a temporary directory so the current project
  does not affect the update, while retaining Windows `.cmd` and `.bat`
  handling.
- Reject a relative-only `PATH` with guidance to update manually.

## Testing

Added a Windows regression test that verifies relative `PATH` entries and
current-directory command decoys are ignored.

GitOrigin-RevId: 15303165af42718244b99786f939f400dc6cbd07
2026-08-24 15:48:51 +00:00
pakrym-oai
60821c5043 Represent Guardian policy as a contextual fragment (#40420)
## What changed

- Add a `GuardianPolicy` contextual fragment that renders as a standalone
  developer message with the `guardian.policy` content kind.
- Use the fragment when rebuilding Guardian context and verify that its content
  kind remains attached after history compaction.

GitOrigin-RevId: f7028fb29a48ad2453437f3d3a4405fcab7a2fd7
2026-08-24 15:42:16 +00:00
Tamir Duberstein
a25e986323 Honor response budgets when listing skills (#40413)
## What changed

- Build `skills.list` pages against the current tool-call response-byte budget.
- Skip entries that cannot fit, preserve pagination across retained entries, and report oversized metadata without repeating the warning for the same budget.
- Keep existing cursors compatible while encoding the response budget in new cursors.

## Testing

- Cover direct and Code Mode listing, budget changes between pages, provider and omission warnings, oversized entries, legacy cursors, and budgets too small to return discovery warnings.

GitOrigin-RevId: 4b34cd2714e4849fe9155ce3f0021b218763c395
2026-08-24 14:54:31 +00:00
jif
cd25b81c65 Strengthen Agent Plugin MCP environment overlay tests (#40410)
## What changed

- Cover forwarding a legacy `env_vars` entry when the portable MCP server has no `env` map.
- Use the test workspace variable instead of `PATH` in the stdio round-trip test, keeping overlay forwarding distinct from portable environment expansion.

GitOrigin-RevId: c5cfb333e553581fc856d43a04e5be0abd9f65ef
2026-08-24 14:37:48 +00:00
jif
77b30a21e1 Prewarm more Guardian sampling WebSockets (#40403)
## What changed

- Increase the Guardian sampler's initial WebSocket pool from 2 connections to 8.
- Keep pool growth and recovery tests focused on the two-connection scenarios they exercise while making the remaining tests derive their expectations from the initial pool size.

GitOrigin-RevId: e2eabcdde5828ac7df333271f3253e74d696f396
2026-08-24 13:23:10 +00:00
jif
80cce09d05 Stabilize the mismatched executor Stop hook test (#40398)
## Why

Yielding once after spawning the test executor does not guarantee that its TCP
listener is ready, so the environment can race the server during setup.

## What changed

Poll the executor address until it accepts a TCP connection, with a five-second
timeout and a clear error if startup does not complete.

GitOrigin-RevId: b44b5bbef666a97da1299d05790f5e9c976d914f
2026-08-24 12:45:35 +00:00
jif
a9e7920da1 Classify Guardian V2 risk with a single token (#40393)
## What changed

- Replace structured numeric classifier output with a single `high` or `low`
  token and map those classifications to `1.0` and `0.0` risk scores.
- Require the classification contract in both default and overridden prompts,
  including when classifier instructions are truncated.
- Return the first streamed classification immediately while draining the
  remaining response for connection reuse and token accounting.

## Testing

- Cover prompt rendering and truncation, classification parsing, early streamed
  results, conflicting later output, WebSocket reuse, and approval routing.

GitOrigin-RevId: 31a57e4eb9bf8df2a161b84aa3d5b16ab8f2937b
2026-08-24 12:22:02 +00:00
Tamir Duberstein
e3609f2d02 Expose invocation sources to extension tools (#40382)
## What changed

- Add `ToolCallSource` to extension `ToolCall`s and propagate direct or Code Mode
  invocation metadata, including the runtime cell and nested tool-call IDs.
- Add `ToolCall::response_byte_budget` so extension tools can bound direct-call
  responses by the host truncation policy while allowing Code Mode responses up
  to the tool's own limit.
- Share the skills extension's response-size limit between its `list` and `read`
  tools.

## Testing

- Verify that Code Mode source metadata is preserved when core constructs an
  extension tool call.

GitOrigin-RevId: b10aef01be30d35b67bee3af24a1a4175c9ee112
2026-08-24 11:02:14 +00:00
jif
6771ae7ac3 Preserve sandbox errors during session initialization (#40381)
## Why

On macOS, rejecting a symlinked writable root during sandbox setup could be
misreported as corrupt session data because both paths surfaced an
`InvalidInput` I/O error.

## What changed

- Treat only `InvalidData` errors as evidence of corrupt session storage.
- Preserve `InvalidInput` failures so the original sandbox preparation error
  and its actionable details reach the user.

## Testing

Add a macOS regression test that configures a symlinked writable root and
verifies thread creation reports the sandbox failure without suggesting that
session data is corrupt.

GitOrigin-RevId: 2b83d9f92a517407b88c21b471fa8bff5fd20d1d
2026-08-24 10:56:54 +00:00
jif
4beea50e26 Advertise shell snapshot v2 support on Unix (#40376)
## What changed

Set the local exec server's `shellSnapshotV2` capability on Unix, while
continuing to report it as unsupported on other platforms.

GitOrigin-RevId: 5e60cfb459c9312a3c56f020c11f7eece6643ab2
2026-08-24 10:15:42 +00:00
jif
339751715c Use snapshot session sources for MCP projection (#40368)
## What changed

Pass the session source associated with each MCP configuration snapshot into
selected-environment server projection. This keeps Guardian reviewer isolation
decisions aligned with the snapshot being projected instead of rereading the
session's mutable configuration.

GitOrigin-RevId: 61fd891fec13f62cfea9886d13e2f94f6f60922f
2026-08-24 09:14:32 +00:00
jif
40b7560169 Forward local env vars to Agent Plugin MCP servers (#40363)
## What changed

- Apply local `env_vars` declarations from `.codex-plugin/plugin.json` to matching stdio servers loaded from an Agent Plugin manifest.
- Replace matching `${NAME}` entries in the portable server environment with host environment forwarding while preserving the portable command, arguments, and unrelated servers.
- Ignore remote-sourced environment variables and support both inline and file-based Codex MCP declarations.

## Testing

- Cover matching-server filtering, local and remote sources, inline declarations, and an end-to-end `PATH` forwarding round trip.

GitOrigin-RevId: 843e1232a084fa5f571fe56e07266995b87fd53d
2026-08-24 08:43:25 +00:00
cgst-oai
2df6705423 Cache executor metadata from initialization (#40343)
## What changed

- Include `environmentInfo` in the exec-server `initialize` response and seed the Rust client's metadata cache from it.
- Fall back to one lazy `environment/info` request when connecting to older servers that omit initialization metadata, then share the cached result across client clones and session recovery.
- Keep app-server `environment/info` requests uncached so they continue to probe the executor.

## Testing

- Cover initialization metadata, the legacy-server fallback, shared caching, accepted WebSocket environments, and repeated uncached app-server probes.

GitOrigin-RevId: 380132d9db183998d73e8c6b0954e4d70c7e8406
2026-08-24 06:43:07 +00:00
Eric Traut
068c49f075 Update the frameless realtime default model (#40321)
## What changed

- Use `gpt-live-1-codex` as the default model for frameless realtime sessions.
- Preserve an explicitly supplied per-session model override.

## Testing

- Cover both default and explicit model selection in the WebRTC frameless conversation test.
- Update the app-server live session request expectation for the new default.

GitOrigin-RevId: ce5dc978911ff0289d677b60fae2dd8cb1058d22
2026-08-24 03:34:15 +00:00
Eric Traut
76d98a771e Add task mentions to the TUI composer (#40315)
## What changed

- Include matching Codex tasks in the `@` mention popup when the active thread supports task tools, prioritizing tasks from the current working directory.
- Submit selected tasks as bounded live thread references so Codex can load their contents with `read_thread`.
- Preserve task mentions across composer history and thread start, resume, and fork flows.

## Testing

- Add coverage for task search and capability propagation, popup selection and rendering, submission encoding, history round-trips, and reference validation and limits.

GitOrigin-RevId: 17502be91bf6d4b01745668829eb69fb318cb5b9
2026-08-24 02:46:56 +00:00
Eric Traut
a8468330bb Add TUI tools for managing Codex tasks (#40308)
## Why

The TUI rejected app-server dynamic tool calls as unsupported, so agents could
not inspect or manage other Codex tasks through a TUI session.

## What changed

- Add the `codex_tui` tool namespace for listing, reading, waiting on, creating,
  forking, messaging, renaming, archiving, and restoring tasks.
- Handle tool calls through existing app-server thread operations, with bounded
  inputs and responses and cleanup when calls complete or the TUI disconnects.
- Route delegation tools through an authenticated local MCP server with explicit
  approval prompts, while respecting configured and managed MCP policies.
- Fall back to starting threads without dynamic tools when connected to an older
  app server that does not support them.

## Testing

Add coverage for tool schemas and response bounds, task lifecycle operations,
approval-gated MCP transport, namespace dispatch, cancellation, and legacy
app-server fallback behavior.

GitOrigin-RevId: c782c11f0a3edceb3fa6909a4b92d6ce01a6eed3
2026-08-24 01:50:53 +00:00
Eric Traut
fb0781b9ee Harden bubblewrap synthetic mount registry isolation (#40302)
## Why

The synthetic mount registry must remain private to the sandbox helper. A
writable bind overlapping its temporary directory could expose the registry,
and a pre-existing registry symlink could redirect bookkeeping into a writable
location.

## What changed

- Add the registry's read-only bind while constructing filesystem mounts, but
  only when a writable bind exposes it and before applying deny masks.
- Reject a symlinked registry path before registering mounts or starting the
  sandboxed command.

## Testing

Add coverage for symlink rejection and for denied temporary directories under
both full-root and minimal filesystem policies.

GitOrigin-RevId: 3adff28998f0ef8c8ec26a73e5a1183b4931c0e8
2026-08-24 00:52:52 +00:00
Eric Traut
0533f96c44 Label Business Pro Lite plans as Business Premium (#40301)
## What changed

- Show `SelfServeBusinessProLite` as `Business Premium` in TUI account displays instead of grouping it under `Business`.
- Update the display-name and app-server session tests for the new label.

GitOrigin-RevId: aac5c7abe9543f5d49f4e9dc9cbe20e7e3b41e5b
2026-08-24 00:48:31 +00:00
pakrym-oai
a70974c1a0 Preserve developer instruction annotations in subagent forks (#40297)
## What changed

- Add a dedicated contextual fragment for developer instructions that emits the
  `generic.developer_instructions` content kind.
- Use the fragment when adding child-specific developer instructions to a
  full-history subagent fork, preserving their classification and ensuring they
  reach the child exactly once without appearing in the parent request.

## Testing

- Extend full-history subagent coverage to verify the child-only instructions'
  annotation, placement, and count.

GitOrigin-RevId: 82589d311535225fed76d500a19458fda72f40f2
2026-08-23 23:56:23 +00:00
pakrym-oai
84c989acf9 Annotate Responses Lite base instructions (#40296)
## What changed

- Build Responses Lite base instructions through a dedicated context fragment so the developer message carries the `model.base_instructions` content kind.
- Apply provider metadata cleanup after adding the base-instructions message, preserving the existing behavior for non-OpenAI providers.

## Testing

- Extend Responses Lite request coverage to verify the annotation is present for OpenAI requests and omitted for a third-party provider.

GitOrigin-RevId: b0317f92dfb9570860688b49e3a7668da516ee8c
2026-08-23 23:52:07 +00:00
pakrym-oai
068847f76d Classify permission instructions under the permissions namespace (#40295)
## What changed

- Change the permission prompt content kind from
  `generic.permissions_instructions` to `permissions.instructions`.
- Update request annotation tests to expect the new content kind.

GitOrigin-RevId: e1e39c74ac24668ac1f3467bb0cc1335a9408712
2026-08-23 23:38:12 +00:00
pakrym-oai
9228a3a407 Classify internal model context by source (#40294)
## What changed

- Derive each `InternalModelContextFragment` content kind from its source as
  `<source>.internal_context` instead of using a shared generic kind.
- Cover the source-specific kind in the contextual user fragment test.

GitOrigin-RevId: 2075d558265fc1ae1ce394e9a865210d1bc270af
2026-08-23 23:33:02 +00:00
Adam Perry @ OpenAI
ad32eba832 Add smoke tests for assembled Codex packages (#40292)
## What changed

Add a cross-platform pytest suite that extracts the CLI and app-server
archives and verifies:

- common CLI discovery commands;
- code-mode execution through both packaged entrypoints, including use of each
  package's bundled `rg`; and
- the presence and usability of packaged debug symbols on Linux, macOS, and
  Windows.

The suite accepts gzip or zstd package archives and isolates its Codex
configuration and state from the invoking environment.

GitOrigin-RevId: 25e517d349242c9f6226e95ef41e37a783e2373f
2026-08-23 23:26:06 +00:00
pakrym-oai
479c8c8924 Preserve content kinds during image preparation (#40281)
## Why

Image preparation can rewrite message content, including replacing images that
cannot be processed with model-visible error text. The positional content-kind
metadata must stay aligned with those rewrites.

## What changed

- Process message images together with their content-kind annotations.
- Preserve existing kinds for unchanged and resized content.
- Classify failed-image placeholders as `images.preparation_error`.

## Testing

- Cover metadata preservation across successful, resized, and failed images.
- Verify Responses Lite sends `user.image` and `images.preparation_error` kinds.

GitOrigin-RevId: 1be7bcbe47014251019bfff0d826c9dfe3239dec
2026-08-23 22:23:40 +00:00
ashwinnathan-openai
6677fd827d Budget retained images during remote compaction (#40280)
## Why

Remote compaction's retained-message budget counted text but not images, so
image-heavy history could retain more context than the budget represented.

## What changed

- Add the opt-in `compaction_image_budget` feature to charge retained images
  using the existing image size estimate.
- Keep images and their adjacent labels atomic when truncating a boundary
  message, while preserving existing text, audio, metadata, and
  client-authored developer-message behavior.
- Stop backfilling older messages when an image at the truncation boundary
  does not fit.

## Testing

- Add unit coverage for image boundaries, annotations, audio, text-only
  messages, and client-authored developer messages.
- Add an integration test covering repeated remote compaction with the feature
  enabled, disabled, and left at its default.

GitOrigin-RevId: 88868bbd09d2858939dbae3f8402e1f497b4e3c6
2026-08-23 21:29:11 +00:00
pakrym-oai
aec653daa9 Preserve annotations when omitting unsupported media (#40277)
## What changed

- Render omitted image and audio inputs as contextual fragments tagged with
  `images.unsupported` and `audio.unsupported` content kinds.
- Normalize message media through annotated content so metadata for surrounding
  content remains intact when switching to a model without media support.

## Testing

- Extend history and model-switching tests to verify content-kind annotations
  before and after unsupported media is replaced.

GitOrigin-RevId: 4ee6577f8b78bd5a850ee01ea9d4590c20272850
2026-08-23 20:14:26 +00:00
pakrym-oai
287587c32c Classify additional generated context fragments (#40275)
## What changed

- Represent compaction summaries and Guardian-approved actions as typed contextual fragments.
- Inject subagent notifications through the same fragment path.
- Annotate the resulting request items with `compaction.summary`, `guardian.approved_action`, and `multi_agent.subagent_notification` content kinds while preserving their existing roles and text.

## Testing

- Verify the content-kind metadata on compacted summaries, approved actions, and subagent notifications.

GitOrigin-RevId: 01c93e7f08b2dc1c1e85ba69e82bfb5f56e6cca5
2026-08-23 20:08:40 +00:00
pakrym-oai
e21bc763a7 Normalize compacted user message annotations (#40273)
## Why

Local compaction rebuilds preserved user input as a single text item. Carrying
over the original per-item content kinds can leave its annotation metadata out
of sync with the rebuilt content.

## What changed

- Set the rebuilt item's content kind to `user.text` when the original message
  had content-kind metadata.
- Preserve the remaining message and harness metadata.

## Testing

- Cover metadata normalization in compacted history.
- Verify persisted replacement history contains the merged text and a matching
  `user.text` content kind.

GitOrigin-RevId: cd10b8ec68ef8ec2a272a90182e69875b60dc35c
2026-08-23 19:49:44 +00:00
pakrym-oai
bd0d4a23e3 Preserve content annotations when rolling back model switches (#40271)
## What changed

- Filter rolled-back model-switch instructions through annotated content so the
  surviving developer fragments retain their matching content-kind metadata.
- Add regression coverage for annotation preservation and request-level metadata
  alignment after rolling back a first-turn model change.

GitOrigin-RevId: 42a3c0cf4c5727bc6fe40990254467f40f4686f9
2026-08-23 19:33:54 +00:00
pakrym-oai
184ff338ad Preserve content annotations when filtering forked agent history (#40266)
## Why

Developer-message content and its positional `content_item_kinds` metadata must stay aligned when parent history is prepared for a spawned agent.

## What changed

- Filter and rewrite developer-message content as annotated content so each retained item keeps its matching kind.
- Rebuild both message content and annotation metadata together after removing parent-only instructions and multi-agent usage hints.

## Testing

- Extend forked-history coverage to verify retained annotation kinds.
- Assert that spawned child requests contain the same number of content items and annotation kinds.

GitOrigin-RevId: 59748d9e8c4fc06ef8e5b90389bcf40465589f90
2026-08-23 19:01:22 +00:00
pakrym-oai
0a80fab240 Preserve content metadata when truncating messages (#40264)
## Why

Rebuilding a truncated message from its content fields can drop passthrough
metadata and leave positional content classifications out of sync with the
items that remain.

## What changed

- Convert message content and its classifications into `AnnotatedContent`
  before applying the token budget, then write both back together.
- Preserve other message and envelope metadata during truncation.
- Assign the `unknown` classification to content from legacy messages that do
  not provide classifications.

## Testing

Expanded truncation coverage to verify that retained text and image items keep
their matching classifications and that unrelated passthrough metadata is
preserved.

GitOrigin-RevId: f84e2ebc3e97392e45f321dec3c171713864bdcd
2026-08-23 18:53:15 +00:00
Ankush Gupta
2161ec272a Support cua_repl as a Node REPL-backed MCP server (#40257)
## What changed

- Recognize `cua_repl` alongside `node_repl` when collecting Guardian review evidence, applying computer-use policy, and capturing transcript images.
- Render `cua_repl.js` results with the compact REPL history and transcript views.
- Preserve failed MCP call status and result content when replaying app-server history.

## Testing

- Cover both REPL server names across Guardian policy, evidence, image capture, history rendering, and failed-call replay tests.

GitOrigin-RevId: 8c13a721f718add403b07e727c1634b59203c51a
2026-08-23 17:02:21 +00:00
Dylan Hurd
c9b19deb09 Distinguish Guardian review threads from subagents (#40221)
## Why

Guardian reviews were reported with the generic `subagent` thread source, making them indistinguishable from other delegated threads in persisted metadata and analytics.

## What changed

- Add the `guardian_review` thread source to the core protocol and app-server schema.
- Assign it to Guardian reviewer sessions and propagate the configured source through turn metadata, rollouts, and analytics.
- Continue treating Guardian reviews like subagents for paginated history and trusted-provenance checks.

## Testing

- Cover protocol round trips, delegate source selection, emitted analytics, request metadata, and persisted rollout metadata.

GitOrigin-RevId: 07480c122715812874c9d3b48bb39fc5c86b2367
2026-08-23 10:06:57 +00:00
Eric Traut
83d1fe0e67 Remove the Plan mode composer nudge (#40200)
## What changed

- Keep the normal composer footer visible when a draft contains the word `plan`.
- Remove the contextual “Create a plan?” prompt, its Escape dismissal behavior, and its per-thread dismissal state.

## Testing

- Update wide and narrow composer snapshots to cover the standard footer for plan-related drafts.

GitOrigin-RevId: 1a3c8cfce9d4effa2149790975133f652aa7c914
2026-08-23 07:24:57 +00:00
pakrym-oai
4582c0a498 Annotate user input and contextual fragments with content kinds (#40196)
## What changed

- Preserve each contextual fragment's `ContentItemKind` when converting it to a response message.
- Classify user text, image, and audio content as `user.text`, `user.image`, and `user.audio` in their original order.
- Give additional context key-specific `additional_content.<key>` kinds and retain annotations on generated messages such as image resize notices and interrupted-turn markers.

## Testing

- Expand request-level coverage to verify content-kind annotations across mixed-modality turns, additional context, reminders, budgets, skills, model switching, subagents, and image resizing.

GitOrigin-RevId: 671e4545f39b335525c60d2a5df4608e8068cafc
2026-08-23 06:10:44 +00:00
pakrym-oai
7b5b3bd5a2 Identify detached memory requests as memory consolidation (#40186)
## What changed

- Set `thread_source` to `memory_consolidation` in turn metadata for detached memory requests.
- Verify that startup requests carry matching turn metadata in the request header and nested `client_metadata`.

GitOrigin-RevId: 318d6f097e07463ac7a1c52b35a926532e67b83d
2026-08-23 04:59:28 +00:00
pakrym-oai
c4b434aae2 Preserve context annotations in merged messages (#40184)
## What changed

- Carry each contextual fragment's `ContentItemKind` through initial context assembly and world-state updates.
- Attach the classifications to merged response messages through `content_item_kinds`, preserving their order alongside the message content.
- Convert extension prompt fragments into annotated developer fragments and classify built-in developer and guardian instructions.

## Testing

- Add an integration test covering roles and content annotations in the first request.
- Update world-state and persisted-history tests to account for annotation metadata.

GitOrigin-RevId: 71c48dad5b17bffd47ba03263e3eb6d5e74fbf4b
2026-08-23 04:41:11 +00:00
pakrym-oai
422239eb4b Classify contextual fragments with content kinds (#40180)
## What changed

- Require each `ContextualUserFragment` to provide a stable `<feature>.<name>`
  `ContentItemKind`.
- Add `AnnotatedContent` and `RenderedFragment` so rendered text, its role, and
  its classification can travel together to API boundaries.
- Derive extension-owned world-state classifications from the extension ID and
  keep the skills catalog classification with its fragment implementation.

## Testing

- Verify that an extension-owned world-state section renders with an
  `<extension-id>.instructions` content kind.

GitOrigin-RevId: e46b74a0bb41e0b6112667c9d36bc9e7f2714451
2026-08-23 03:44:21 +00:00
Owen Lin
a1d4aea265 Shut down resumed descendants when archiving thread trees (#40179)
## Why

Collaboration can resume an archived descendant without unarchiving its
rollout. Archiving the parent again previously skipped shutdown for that
descendant because only rollouts newly marked as archived were prepared.

## What changed

Prepare every loaded thread in the spawn subtree for archival, including
descendants whose rollouts are already archived, before updating archive
state.

## Testing

Add an app-server integration test that resumes an archived child through its
parent and verifies that archiving the parent unloads the entire subtree.

GitOrigin-RevId: aca8c0d6ddb8900aad16becbeb594426cea1e3a6
2026-08-23 03:25:56 +00:00
pakrym-oai
546eed94ac Require content kinds for extension prompt fragments (#40177)
## What changed

- Require each `PromptFragment` to include a producer-owned `ContentItemKind`.
- Re-export `ContentItemKind` from `codex_extension_api` and assign stable kinds to skills, memories, examples, and test contributors.
- Limit prompt slots to developer policy and developer capabilities, and combine contributed fragments into a single developer update.

## Testing

- Update extension registry tests to verify fragment ordering with the new content-kind metadata.

GitOrigin-RevId: ef8624a9b4ae9dce025bca9c0954d91dd8075e85
2026-08-23 03:12:58 +00:00