Commit Graph

2057 Commits

Author SHA1 Message Date
Andrei Eternal
cbfd999db7 Add hooks for interrupted turns (#40511)
## What changed

- Add an `Interrupt` hook event that runs for an active top-level turn before its
  interrupted abort event is emitted.
- Flush the turn transcript before invoking the hook and provide the session,
  turn, transcript, working directory, model, and permission mode in its input.
- Support command and MCP handlers, including asynchronous commands, with a
  one-second default timeout and a three-second maximum.
- Expose the event through hook configuration, managed requirements, app-server
  notifications, generated schemas, analytics, and the TUI hook views.

## Testing

- Cover handler discovery, timeout normalization, output parsing, protocol
  compatibility, TUI rendering, and interrupt execution ordering.

GitOrigin-RevId: 163fa7c098d94ac2775f6d137f8e916f8ea9b6eb
2026-08-25 01:27:18 +00:00
Tamir Duberstein
c941572917 Honor response budgets when reading skill resources (#40491)
## Why

`skills.read` paginated resources against a fixed response limit, so a page could exceed a smaller tool-call response budget.

## What changed

- Size each serialized `skills.read` page to the current call's response budget, accounting for JSON escaping and UTF-8 boundaries.
- Cache one bounded executor-resource snapshot per thread so cursor continuations return consistent contents without rereading the file. Replace the snapshot when another resource is read, and reject stale cursors after a reread.
- Tie cached executor snapshots to the selected environment and sandbox context without keeping the environment alive.

## Testing

- Cover budget-constrained reads, escaped and multibyte contents, multi-page reconstruction, changed resources, snapshot eviction, and expired turn-scoped access.

GitOrigin-RevId: e515935b82771b3f29b3fb91ea7a7a72e19a65ee
2026-08-24 23:00:57 +00:00
hefuc-oai
1e9e916923 Honor disabled managed network configuration (#40489)
## Why

Managed network requirements can remain present when `enabled = false`, but a
disabled configuration should not create or expose an active proxy runtime.

## What changed

- Start the managed network proxy only when its effective specification is
  enabled.
- Clear an existing proxy when a permission-profile refresh disables managed
  networking.
- Keep remote executor launches free of managed-network proxy settings when the
  requirements explicitly disable the feature.

## Testing

Added session and unified-exec coverage for initial startup and refresh with
disabled managed networking.

GitOrigin-RevId: f76699802e079eb746d5b1ea6547d19a4bfb7715
2026-08-24 22:51:36 +00:00
alexsong-oai
4f6d43c267 Support managed AWS access keys for Amazon Bedrock (#40481)
## What changed

- Add the experimental `amazonBedrockAccessKeys` app-server login flow, persist its credentials in the configured auth store, and use them for SigV4-signed Bedrock requests.
- Report `bedrockAccessKeys` as a distinct auth mode and document access-key login alongside AWS profile and environment credential setup.
- Clear the selected Bedrock provider, AWS settings, and Bedrock-specific model on logout while leaving external AWS credentials and `.env` untouched.
- Reject managed access-key login when higher-precedence configuration would prevent its region or profile settings from taking effect.

## Testing

- Cover access-key login, storage, request signing, configuration conflicts, status reporting, and logout cleanup.

GitOrigin-RevId: bbf297887c6503d3651ceb2aad85c4d626e32723
2026-08-24 21:39:48 +00:00
rhan-oai
d21794d6ba Reload Multi-Agent V2 children through their parent (#40477)
## Why

Multi-Agent V2 children are owned by their parent at runtime. Resuming an
unloaded child directly could rebuild it from caller-provided settings instead
of the parent's current authority.

## What changed

- Route child reloads through their loaded immediate parent and reject direct
  cold resume when that parent is unavailable.
- Preserve the child's recorded model, provider, reasoning effort, and role
  while inheriting the parent's execution policy and MCP extensions.
- Validate cached environments against the parent, intersect local permission
  profiles, and reject stale remote or workspace-root configurations.
- Keep paginated cold-resume token usage attribution when attaching to the
  reloaded child.

## Testing

Add coverage for owner validation, nested-parent reloads, permission and
environment changes, role instruction restoration, paginated usage replay,
and app-server child resume behavior.

GitOrigin-RevId: 84014762bcdb57f94fc23974c9c1af55dc1babf1
2026-08-24 20:47:10 +00:00
Won Park
333beecd41 Add structured full approval reviews to extensions (#40472)
## What changed

- Split the approval review contributor into a `fast_decision` path for existing evidence and a `full_review` path for structured reviews.
- Add host-owned full-review inputs with action evidence, conversation history, thread and turn identifiers, approval context, and extension data.
- Add structured assessment and error types, and resolve full reviews using the first contributor that claims the request.

## Testing

- Cover full-review input propagation, first-claim ordering, and short-circuit behavior in the extension registry tests.

GitOrigin-RevId: 6f763d874af8c0b66a0d760b7b7c7dfe32251c9e
2026-08-24 20:25:26 +00:00
Winston Howes
c3d5e4418f Add credential brokering to network proxy feature config (#40466)
## What changed

- Add `features.network_proxy.credential_broker` and preserve structured network proxy settings when toggling the feature through config APIs.
- Protect broker enablement and provider context variables from project config, while carrying trusted context into filtered shell environments.
- Propagate brokered credentials through shell snapshots and restore real credentials for unsandboxed escalated commands.
- Normalize broker context environment keys case-insensitively on Windows and avoid conflicting remote managed-network enforcement when no proxy launch configuration is available.

## Testing

- Cover config layering, editing, project sanitization, Windows environment handling, shell snapshots, escalated execution, and end-to-end GitHub credential brokering in the zsh-fork runtime.

GitOrigin-RevId: 500e51e804e1988022052ccfe00b8fac5e495f4f
2026-08-24 19:52:27 +00:00
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
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
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
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
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
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
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
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
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
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
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
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
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
Eric Traut
343074d420 Report runtime MCP connection status (#40068)
## Why

MCP inventory can be cached or collected separately from a thread's live
connections, so tool availability alone does not describe the current runtime
state.

## What changed

- Add a nullable `runtimeStatus` to `mcpServerStatus/list` for thread-scoped
  requests, covering not-started, starting, connected, authentication-required,
  failed, cancelled, and disabled connections.
- Observe published connection state without starting or reconnecting servers,
  and return an unknown status when no thread is supplied or the active
  configuration no longer matches the published registration.
- Show connection state and tool counts in the compact `/mcp` view while
  retaining the detailed inventory in `/mcp verbose` and compatibility with
  servers that omit `runtimeStatus`.

## Testing

- Cover runtime status transitions, deferred and disabled servers, closed
  transports, configuration changes, protocol compatibility, and TUI rendering.

GitOrigin-RevId: e3bb6efe652f0fa8b3c97d5c53e4729b3a87cd91
2026-08-22 05:54:43 +00:00
richardopenai
4f39251a01 Add unfinished root turn suspension (#40038)
## Why

An active root turn needs to be stopped without marking it complete or aborted
before another runtime can recover the same turn ID.

## What changed

- Add `CodexThread::suspend_turn_and_shutdown` and `SuspendTurnOutcome`.
- Flush history, stop the active regular task, close the history writer, and
  shut down the session without recording a terminal turn event.
- Reject suspension when no supported turn is active or the loaded agent
  subtree still contains a live descendant.

## Testing

- Verify that suspension preserves unfinished history and allows the turn to be
  recovered under its original ID after the descendant guard is cleared.

GitOrigin-RevId: 1f9b019d07c51474ec2d991d263bc15cdd4f89ad
2026-08-22 00:42:19 +00:00
Sean Huang
9445ef227e Honor granular sandbox approvals in unified exec (#40024)
## What changed

- Use the shared approval-policy check for unified exec sandbox escalation so
  `require_escalated` commands can prompt when granular `sandbox_approval` is
  enabled and remain rejected when it is disabled.
- Add an approval scenario covering sandbox escalation with granular approvals
  enabled.

GitOrigin-RevId: 98907960cd9df181e1b2fd9d7fea11fa3c0ed7e6
2026-08-21 21:54:40 +00:00
Won Park
6143217c67 Cancel Guardian reviews with their tool calls (#40021)
## What changed

Propagate tool cancellation tokens into Guardian approval reviews so interrupting a tool also aborts its pending review. Apply the same cancellation behavior to server-initiated MCP approval elicitation.

## Testing

Add integration coverage for cancellation from direct tool calls, code-mode turns, background code-mode cells, and MCP elicitation.

GitOrigin-RevId: cbee4b422bbcbf6984e415ef6409cee705beebdc
2026-08-21 21:51:12 +00:00
Krish Chainani
677cfee000 Add end-to-end tests for executor Stop hooks (#40020)
## Testing

- Verify an executor plugin's `Stop` hook starts running after its environment
  attaches and stops after disconnection.
- Confirm hook calls carry the expected session, thread, turn, model, and request
  metadata.
- Reject hooks whose MCP server belongs to a different executor environment.
- Cover the current restriction to the first executor environment and handler.

GitOrigin-RevId: ef13baf61379997f117cc57515363cc9880d3724
2026-08-21 21:45:26 +00:00
felixxia-oai
9949c9eafa Reuse Guardian reviews in async risk scoring (#40013)
## What changed

- Retain bounded evidence from completed synchronous Guardian allow and deny reviews and supply it to subsequent Guardian v2 async classifier samples as trusted developer context.
- Keep review evidence isolated from the conversation transcript, escape and truncate its fields, and ignore failed or incomplete reviews.
- Invalidate retained evidence after conversation history rewrites or new user messages, including authorization changes in a worker's root thread.

## Testing

- Cover approved, denied, malformed, and forged review inputs, plus root rollback and authorization-change scenarios.

GitOrigin-RevId: 27817e1fde9a136de727048c4220d148fcf72f42
2026-08-21 21:22:35 +00:00
Krish Chainani
ab8768306f Preserve executor context for MCP stop hooks (#40012)
## What changed

- Scope executor-provided stop-hook calls to the MCP server environment that registered the hook, and reject calls when that environment does not match.
- Forward turn metadata with executor stop-hook requests while retaining the hook call's `threadId` metadata.

## Testing

- Cover environment matching for MCP tool calls and verify executor stop hooks receive their environment ID and request metadata.

GitOrigin-RevId: b544ea3a6ca1f61389fb4597978ed7aac27d529a
2026-08-21 21:17:42 +00:00
felixxia-oai
8b5beea5c0 Synchronize concurrent Git enrichment test explicitly (#40011)
## What changed

- Hold all three concurrent turns at a barrier until their Git enrichment is
  complete.
- Verify workspace metadata on follow-up requests and associate each result
  with its thread ID before comparison.

GitOrigin-RevId: ca3cf52c8e9bd805fbddae676fea0d1bd4064781
2026-08-21 21:12:43 +00:00
felixxia-oai
51d8d12236 Synchronize Git enrichment tests explicitly (#40006)
## What changed

- Track Git enrichment completion with a watch channel and unblock waiters when enrichment finishes or is canceled.
- Let the test sync tool wait for the current turn's enrichment with a bounded timeout.
- Replace polling in metadata tests and wait for enrichment before asserting workspace metadata in the guardian integration test.

GitOrigin-RevId: 8d35f75a0ebfe412674e1e797c6a13c03b1ea373
2026-08-21 20:53:30 +00:00
jif
dbe9dac1ae Route escalated commands through synchronous Guardian review (#40005)
## Why

Commands requesting `sandbox_permissions=require_escalated` need a full Guardian review even when they are not marked as retries.

## What changed

- Treat escalated command requests, along with retries, as requiring synchronous Guardian review.
- Bypass extension approval and Guardian V2 shortcuts for these requests.

## Testing

Add an integration test that installs an auto-approving extension and verifies that an escalated command still reaches Guardian and honors its denial.

GitOrigin-RevId: 30eed273460f3c3c6b24d1ce2d29889e34513afd
2026-08-21 20:45:42 +00:00
sayan-oai
ad9e8097fd Preserve managed deny-read rules across permission updates (#40004)
## Why

Runtime permission updates must not weaken managed filesystem `deny_read`
requirements.

## What changed

- Retain managed deny-read rules separately and merge them into updated
  permission profiles.
- Reject permission profiles and legacy sandbox policies that conflict with a
  managed denied path.
- Apply the same constraint when `command/exec` handles a request-specific
  sandbox policy.

## Testing

- Cover thread permission updates with managed deny-read requirements.
- Cover `command/exec` enforcement for managed and user-defined denies,
  including conflicting policy and profile overrides.

GitOrigin-RevId: 5e387b9c1bf1650a21753a74a3338bd33df7d0ce
2026-08-21 20:15:23 +00:00
andrewgu-oai
79b7606803 Keep credentials out of app-server logs (#39993)
## Why

App-server logs can be persisted or included in submitted diagnostics, so credentials used by model providers, authentication refreshes, and attestation requests must not appear in diagnostic output.

## What changed

- Add `RedactedString`, which preserves serialization and string access while replacing debug output with `<redacted>`.
- Use it for model-provider bearer tokens, header and query values, authentication command arguments, and attestation tokens.
- Avoid logging JSON-RPC error payloads and parser or authentication errors that may echo credentials; retain safe context such as error codes and categories.

## Testing

- Add an app-server regression test that exercises provider credentials, refreshed authentication tokens, and attestation tokens, then verifies none appear in persisted SQLite or submitted diagnostic logs.

GitOrigin-RevId: 8c50408adf94d93847658b1320682cf3b637d2cc
2026-08-21 19:04:32 +00:00
sayan-oai
f580dd886f Enforce environment network policies for remote execution (#39980)
## Why

`EnvironmentConfig.network_policy` could describe attachment-owned traffic
restrictions, but core rejected every configured policy because execution did
not enforce it.

## What changed

- Resolve each remote environment's network policy for the selected command
  and apply it to the execution-scoped proxy.
- Compose owner rules with controller constraints and saved network decisions
  while preserving inherited domain and Unix-socket denials.
- Keep strict allowlists non-expandable, allow reviewable policies to use
  network approvals, and reject sandbox escalation that would bypass an owner
  policy.
- Reject policies for local execution, disabled managed enforcement, or a
  disabled controller proxy.

## Testing

Added coverage for policy composition, scoped remote proxy behavior, approval
and denial flows, offline execution, and unsupported environment authority.

GitOrigin-RevId: d9331f616df24de6cd13ed68196f0ff7b0ca4dd9
2026-08-21 17:29:41 +00:00
jif
d12a7f3fd8 Preserve root user authorization in subagent Guardian reviews (#39975)
## Why

MultiAgent V2 workers can be reviewed after the root conversation has received
new user authorization that is absent from the worker's own transcript. Guardian
reviews need that genuine user context without treating forwarded or
assistant-authored claims as authorization.

## What changed

- Add the bounded root conversation to Guardian prompts for worker reviews.
- Preserve user and assistant roles, and explicitly treat only root user messages
  as authorization evidence.
- Exclude summaries, review artifacts, and assistant commentary from the root
  conversation evidence.
- Apply the same evidence to both core Guardian prompts and Guardian V2
  classification.

## Testing

Add an integration test covering late root-user authorization, forged role text,
forwarded agent claims, and filtered synthetic authorization.

GitOrigin-RevId: 8846de69ba214a88f58f70675798d324e213427c
2026-08-21 17:12:42 +00:00
felixxia-oai
16e2722c50 Consolidate code mode output helper tests (#39969)
## What changed

- Cover object serialization through the `text()` helper directly in the code
  mode runtime suite.
- Remove redundant core integration coverage for serialized text and rejected
  image outputs.

GitOrigin-RevId: f465b8361e9d725a7246994d9c41e9d01c969011
2026-08-21 16:50:34 +00:00
jif
3882ced09c Add in-memory shell snapshots to unified exec (#39957)
## What changed

- Add the under-development `shell_snapshot_v2` feature and advertise executor support through environment capabilities.
- Use executor-managed, in-memory snapshots for eligible direct `bash`, `zsh`, and `sh` login commands, while applying the configured shell environment policy and avoiding duplicate automatic startup-file effects.
- Keep file-backed snapshots available for user-shell commands and fall back to the existing execution path when in-memory snapshots are unsupported or inapplicable.

## Testing

- Cover policy filtering, snapshot reuse without snapshot files, automatic startup files, local and remote execution, and legacy user-shell snapshots.

GitOrigin-RevId: 4ad6cdf13824913ac8c393ba38b9844230677579
2026-08-21 15:24:56 +00:00
Tamir Duberstein
748d8ac834 Bound unified exec output delta frames (#39937)
## What changed

- Cap each `ExecCommandOutputDelta` frame at 8 KiB and stop building frames once the per-call delta quota is exhausted.
- Preserve complete UTF-8 scalars across producer chunks while passing malformed or incomplete trailing bytes through without losing them.
- Append all process output to the transcript independently of delta emission.

## Testing

- Cover split multibyte characters, malformed and trailing bytes, frame and event limits, transcript preservation, and interactive PTY output.

GitOrigin-RevId: ef4100e353df01569a8fbae650c70f439920a2fd
2026-08-21 14:04:33 +00:00
Zahan Malkani
536f86e5cc Support attaching to existing realtime calls (#39876)
## Why

Clients that create and negotiate realtime calls themselves need Codex to join
those calls without creating another call or overwriting the client-owned
session configuration.

## What changed

- Add the `existingCall` transport to `thread/realtime/start`, accepting a
  client-provided `callId` and optional `realtimeSessionId`.
- Attach Codex over the call's sideband WebSocket without SDP negotiation or a
  session update, and reconnect that sideband while preserving transcript
  state.
- Default existing calls to realtime v1, support v1 and v3, and reject v2 or
  options that would reconfigure the client-owned session.
- Encode call IDs as a single URL path segment for v3 sideband connections.

## Testing

Add protocol, app-server, core, reconnection, authentication-header, and URL
encoding coverage for existing-call attachments.

GitOrigin-RevId: 2046b70566f98efa55381bb1e461ea3cc68256c5
2026-08-21 06:41:28 +00:00
richardopenai
2151d3a5b7 Reset registry retries when refreshing Noise bundles (#39852)
## Why

Refreshing a Noise rendezvous bundle after an unauthorized handshake inherited
the initial registry lookup's retry count. If that lookup had exhausted its
retries, a transient registry error during the refresh failed immediately.

## What changed

Reset the registry retry count along with the operation deadline before
requesting a replacement bundle after a `401` handshake response.

## Testing

Extend the initial Noise connection test to exhaust the first lookup's retry
budget, receive a `401`, then verify that an offline replacement lookup is
retried and connects successfully.

GitOrigin-RevId: bcfad50ea32d69855f1c2c4c461022b3ecbbd941
2026-08-21 03:47:37 +00:00