## Why
A connected account or app can choose an approval reviewer, but that
setting applies across its tools. Users may want to review calendar
event creation themselves while keeping automatic review for other tools.
## What changed
Set `approvals_reviewer` on an individual app tool in `config.toml`:
```toml
[apps.calendar.tools.calendar_create_event]
approvals_reviewer = "user"
```
Codex matches the tool by raw name first and falls back to its title.
The tool's reviewer takes precedence over the connected account, app,
app defaults, and session settings, subject to managed requirements.
This applies to tool-call approval prompts and MCP approval requests
that match a verified app tool invocation. The app-server
`config/read` response also exposes the per-tool setting.
## Testing
Extend coverage for reviewer precedence, tool title fallback, managed
review requirements, tool-call approval routing, strict MCP elicitation,
and app-server config reads.
GitOrigin-RevId: c92bd39b9e708dada9d314c19a446b4c580edf91
## What changed
Reserve `[permissions.credentials]` in `requirements.toml` for shared
credential policy. The table currently accepts no settings and should be
omitted. Empty tables and legacy profile definitions with profile fields
produce a migration error that tells administrators to rename the managed
profile and update references. Profiles named `credentials` remain valid
in `config.toml`.
Accept an empty `[permissions.<profile>.credentials]` table in named
profiles in both files and expose it in the `config.toml` schema.
## Testing
Add regression coverage for rejecting direct and inherited selection of a
user profile through an empty managed credentials table, preserving MCP
configuration reads, and enforcing network policy inheritance checks for
legacy managed profiles.
GitOrigin-RevId: 33dcca30b37d3f07ce670967342199f5302e1d98
## Why
The `incomplete` status alone gives no indication of which timing dependency was missing or which operation prevented capture.
## What changed
Emit deduplicated `critical_path_incomplete_reasons` in turn analytics for incomplete captures. Reasons cover unsupported Code Mode and agent operations, unattributed reviews and user waits, missing turn starts, and forced teardown, with an `unclassified` fallback. External tools that share a built-in name can still invalidate capture without being classified as the built-in operation.
During interruption, use the task's join result to distinguish forced teardown from normal completion so a task that already finished can still report a complete path.
## Testing
Add coverage for analytics serialization, concurrent reason deduplication, tool name collisions, and interrupted tasks that finish normally or require forced teardown.
GitOrigin-RevId: fab9aa1ff881997a34dcf75adc5638133cedc7fe
## Why
Generic quota errors hide whether the project or organization spend limit
blocked a request. Reporting the scope tells users which limit to check.
## What changed
Recognize API key, project, and organization spend limit errors across
HTTP, SSE, and WebSocket responses. Show a message that names the scope and
treat the error as non-retryable, even when the provider sends
`Retry-After`. Apply the existing usage-limit handling to goals and
compaction.
Expose distinct `CodexErrorInfo` values in the app-server protocol and
generated bindings so clients can identify the limit in live errors and
failed turn history.
## Testing
Extend the transport tests to cover all three scopes and verify that they
stop retries. Extend the app-server test to check that the error survives
`thread/read` and that a subsequent turn can succeed in the same thread.
GitOrigin-RevId: 03341f7a78daa7540e7baa519f1a29ec07e34509
Record how long initial context assembly waits for prompt-only plugin
recommendations in `codex.initial_context.plugin_recommendations_wait_ms`.
Use named info-level spans for loading recommendations, reading the
tooling change marker, and fetching the recommendation catalog.
GitOrigin-RevId: 67b26f79252f8cba6e770f43df252ec1d73a569f
## What changed
Have `SandboxManager` handle backend selection and shared preparation, then
delegate command wrapping and session setup to the Linux, macOS Seatbelt,
Windows token, and Windows MXC backends.
Centralize Windows managed proxy routing in `codex-sandboxing` so the exec
server and other callers use the same rule for selecting dedicated MXC
listeners.
GitOrigin-RevId: a75886809aefebf6c267bb39dbc104f76bda3409
## Why
A prepared agent fork needs its ancestor's conversation for context.
Treating that conversation as the child's own authorization evidence
can attribute the ancestor's messages and approvals to the child.
## What changed
Allow host-started prepared forks that reference stored history to
inherit the root session ID. Keep ancestor messages as conversation
context and exclude ancestor authorization evidence when starting or
resuming the fork and when reconstructing sender evidence from storage.
Preserve the inherited disabled-plugin settings and the child's own
authorization evidence.
## Testing
Cover prepared forks across startup and resume, including inherited
context, plugin settings, and child-local authorization. Verify that
live and stored sender evidence both contain only the child's messages.
GitOrigin-RevId: 5c5a6547d31fe78dfad3742efb8a41df539173c6
## Why
A realtime call can end with completed speech that has yet to reach a
Codex turn. The next turn needs that context even if the call's transport
has already disconnected.
## What changed
- For V3 calls with realtime frame history enabled, save pending speech
as context for the next turn. Restore it on thread reload and exclude
it from the turn count used by rollback.
- Drain already received transcript events and settle pending handoffs
before saving the call's closing marker. Report recovery required if
shutdown cannot confirm that history was saved.
- Keep transport detach separate from ending a call. Reattaching restores
saved pending speech, and an open call can be ended from persisted
history after a reload. Use the call ID for TUI attachments so successive
calls on one thread have distinct history.
## Testing
Add coverage for queued speech at hangup, reconnect and stop after
reload, retries after an uncertain write, and rollback across saved
session-end context.
GitOrigin-RevId: 657491f1d7e446a1a48e22189758810c8bdd82cb
## Why
Raw response injection bypasses the native mailbox wake policy, so
injected agent messages cannot wake a sleeping thread through that
policy.
## What changed
In native Multi-Agent v2, route batches consisting entirely of
single-text agent messages with valid agent paths through the mailbox
as queue-only mail. Hold a residency pin across the batch so capacity
eviction cannot interrupt delivery between submissions. Mixed batches,
multipart or encrypted messages, and configurations with native tools
disabled continue to use raw response injection.
Only preempt model sampling for pending mail when the matching turn
still accepts mailbox delivery.
## Testing
Extend coverage for waking live and reloaded sleeping threads,
delivering older queued mail before a new task, and retaining mail in
order when a batch exceeds the submission channel capacity and
eviction is attempted.
GitOrigin-RevId: 3df60d2a4a9e7b193ef298e01f31c565ad8a2785
## Why
Realtime history needs to record which transcript frames reached the
coding agent and which turn received them. If a handoff fails or the
conversation reconnects, Codex needs to distinguish speech that was
already used from speech that is still available for the next input.
## What changed
- Route handoffs through normal turn admission to start or steer a turn.
When realtime frame history is enabled, persist the transcript frames
and the receiving turn's input before publishing acceptance or exposing
the input to the model. Attribute only transcript frames represented
in the rendered input.
- Reserve transcript frames across overlapping handoffs and release them
on definite rejection. Retry an uncertain write with the same input
and require history recovery if the write still cannot be confirmed.
- On V3 reconnect, restore persisted speech that has not been consumed
and put it before newly captured speech.
## Testing
Add regression tests for attribution after transcript truncation,
overlapping handoffs, V3 reconnect ordering, and preservation of typed
input when a handoff in the same turn fails before model sampling.
GitOrigin-RevId: 432dd51971f7ced20344ebc7f0c7b007bb849f54
## Why
Managed approval requirements can change while an MCP runtime is still in use.
Later turns need to honor those changes without restarting MCP, while in-flight
MCP actions need to retain the mandatory review requirements of their issuing
turn.
## What changed
- Add `CodexThread::refresh_guardian_policy` to apply managed policy updates to
an existing thread. MCP configuration refreshes preserve the active Guardian
policy, including when a policy update lands while MCP configuration is loading.
- Resolve MCP tool and elicitation reviewers against the issuing turn's policy.
Live requirements can still require Guardian review, and a live policy change
cannot waive mandatory review captured by the turn.
## Testing
Extend coverage for overlapping Guardian and MCP refreshes and for an existing
MCP runtime that must prompt the user on the next turn after a policy update
allows only the `user` reviewer.
GitOrigin-RevId: 5a1649f917313f6fb152a206bc89986fe6345481
## Why
Legacy rollout migration rewrites rolled-back history and can disrupt
the realtime stream. Enroll local threads once they use paginated history
so the stream stays intact.
## What changed
- Add the off-by-default `features.realtime_frames_local` flag for
paginated local threads with a state database. Accept runtime updates
through the app server and keep threads enrolled once they have a
persisted canonical session start.
- Add thread-store APIs to recover a realtime session and look up the
latest session ID from durable history. Route frame completion through
a store seal so completion acknowledges durable writes.
- Add a local seal for accepted model input that writes source frames
before the input and lets callers retry an uncertain flush without
appending the input twice.
## Testing
Cover enrollment for legacy and paginated threads, continued enrollment
after disabling the flag, and retrying a local input seal after a failed
directory sync.
GitOrigin-RevId: 2012feeca3857da90f9b026f077b31a26d15191b
## What changed
Move realtime text routing into `realtime_handoff` and keep it on the shared start-or-steer path. Extract UTF-8-safe range selection for realtime delegation truncation.
Use `RolloutItem` accessors for realtime timestamps and items in recording, clock restoration, and thread history reads. Pass annotated response items to turn-boundary checks in core and migration rollback so callers can work directly with history envelopes.
GitOrigin-RevId: 3dd37cf91ee5abdca84e87b7d7e304749d9baf04
## Why
A first user turn and a concurrent raw response-item injection can both
observe that the session has no reference context. Both can then append
the initial prompt prefix and persist a full world-state snapshot.
## What changed
Allow context preparation to run concurrently, then serialize publication
of the initial prefix and its checkpoints. If injection publishes first,
the user turn computes its context updates against the published baseline.
If the user turn publishes first, injection appends only the
caller-provided items.
## Testing
Add an integration test that forces the overlap in both preparation
orders. It checks the first request's world-state updates, verifies that
the follow-up request contains the initial instructions and injected
content once each, and checks that history contains one full snapshot.
GitOrigin-RevId: b66f9c6ccc5d42a2be0e852b4d83b78adbc9e5b2
## What changed
Move rollout work admission into `RolloutWorkGate` and route compaction
deferral through `ThreadBudgetPolicy`. Use `TurnWork` to check the budget
when accepting a sampling response and to handle checkpoints after stop
hooks, compaction, and sampling errors. Pass sampling charges and response
completion through `ResponseWork`.
The existing budget check still rejects responses after exhaustion. The
new checkpoints leave retry, completion, compaction, and charge handling
behavior unchanged.
GitOrigin-RevId: 7526416b8ce24ca84035494aeb2a23abd8ca3ddc
## Why
Search MCP and native web search produce provider-specific references.
Switching providers after a thread resumes can mix those references and
break follow-up calls that use them.
## What changed
Persist whether a thread has used Search MCP, native web search, or
neither. Restore that state from response history, including compacted
history, and use legacy attribution and fallback markers for older
threads. When resumed history lacks a search state or legacy attribution
checkpoint, withhold native fallback unless a legacy marker identifies
native search.
Require every Search MCP call to claim the thread's search provider
before execution, including calls retained by Code Mode.
## Testing
Cover resuming a thread with Search MCP references after discovery
becomes unavailable, both with a saved search state and with imported
history that lacks search checkpoints.
GitOrigin-RevId: 100d21c92b0bdbf737ec36c3474f0bc020df8efc
## What changed
- Inject the current span's W3C trace headers into WebSocket handshakes.
- Promote `startup_prewarm` to an info span and fall back to the current span when it is disabled, preserving trace context in the spawned task.
## Testing
Add a regression test for `traceparent` and `tracestate` propagation through the handshake, prewarm request, and subsequent turn on the same connection. Verify that prewarm uses the startup trace while the turn uses its own trace, with the prewarm span both enabled and filtered out.
GitOrigin-RevId: 1e196e132a1991206469060ab80a474857fa7909
## What changed
Carry an expected connector identity on hook MCP calls and add a bundled App dispatch path that requires the host Apps server, a matching connector, and current policy permitting execution without user approval.
Prepare hook calls from the current Apps client catalog, including app-only tools, without exposing those tools to the model or starting unrelated required servers. Refresh session MCP state before preparation and recheck admission before dispatch so configuration changes and logout invalidate stale calls. Never retry a dispatched call.
## Testing
Add coverage for refreshed approval and enablement policies, connector mismatches, app-only tool visibility, preparation without unrelated server startup, and admission invalidation on refresh or logout.
GitOrigin-RevId: 965dd7f79baa40d1be0e158e47b2679d8ba98fe5
## Why
Delegated work should retain client attribution such as `cost_center` from the turn that requested it, even when a yielded code-mode cell spawns its child after a newer parent turn starts.
## What changed
Capture client metadata from the originating turn and apply it to the child's initial turn in both legacy and v2 agent spawning. Children and grandchildren retain the captured values when the parent is later steered with updated metadata.
Exclude `misalignment_override`, `parent_response_id`, and `mcp_request_meta` from inheritance, while preserving each child's own thread and turn identifiers.
## Testing
Add coverage for metadata filtering and snapshot isolation, legacy and v2 spawning with fresh or forked history, grandchild inheritance, and spawning from a yielded code-mode cell after the parent advances to another turn.
GitOrigin-RevId: 8c378c49239ccfac03deb2b793fc69aba1d41644
## What changed
Introduce `UploadContent::Image` and `UploadContent::ToolAudio` in `UploadRequest`. Keep image filenames and policy tags on the image variant, and carry tool audio's declared MIME type explicitly instead of encoding its type and MIME metadata in tags.
Update image preparation, image generation, and tool audio callers to use the typed content. Preserve inline bytes for both variants and redact their payloads from debug output. Document that persistent backends must verify the declared audio MIME type against the uploaded bytes.
## Testing
Add coverage for inline tool audio byte preservation and audio debug redaction. Update integration assertions for typed image and audio uploads, and verify that Code Mode does not upload audio when `FileBackedToolAudio` is disabled.
GitOrigin-RevId: 7dbd69922b377aead2dc28d1e5b3938cce6343b7
## Why
Accepted tool outputs may never appear in a later inference request, and request preparation can strip their history IDs. Replay needs to retain these outputs and match them to later snapshots, including trimmed results and outputs with identical wire bodies.
## What changed
- Capture accepted function and custom tool outputs, preserving their acceptance order, identity, and tool provenance during replay.
- Record stripped tool output IDs alongside inference requests so replay can restore identity without changing the captured wire payload. Reuse accepted items and adopt their first model-visible snapshot bodies.
- Record compaction checkpoints for local context-window resets using the selected input and frozen installed history, including goal edits retained during installation.
- Exclude `configuration_update` items from normalized conversation history.
## Testing
Add replay coverage for outputs accepted without subsequent inference, trimmed results, identical outputs with distinct IDs, and acceptance before or after a request snapshot. Extend checkpoint coverage to verify that retained goal edits are captured and later edits do not alter the checkpoint.
GitOrigin-RevId: 70f737782f5000812f389a4e01b9f9690e39549f
## Why
Queued input can outlive its local attachment files. Reading those files only when rendering a model message can lose media submitted while turn admission is pending.
## What changed
- Introduce `ResolvedUserInput` to carry captured image bytes, audio data URLs, or read errors through session queues and agent input.
- Resolve client attachments on the submitting host before queuing, using a blocking task for local file reads.
- Render messages from captured payloads while preserving original paths and text spans for display, along with image position mappings.
## Testing
Add coverage for rendering and serialization after source files are removed, steered audio retained during pending admission, and local audio errors and display content.
GitOrigin-RevId: 4bbb6bda44167439a8cfdae15d3c476a7b1d336b
## Why
Cold resumes warm only base instructions, leaving historical file images out of the WebSocket warm-up.
## What changed
- Add the disabled-by-default `restored_history_prewarm` feature flag.
- Start the WebSocket handshake while history loads, then build the warm-up from restored settings and history when it contains file images.
- Retain the socket and normalized-image cache but discard the image warm-up response ID, so generation resends the full current history and subsequent turns continue from the real response.
- Keep base warm-up for history without file images and defer image preparation to generation when the handshake falls back to HTTP.
## Testing
Add request-history tests and snapshots covering text-only history, interrupted and injected images, resuming with a vision model after image omission, and HTTP fallback without duplicate image resolution.
GitOrigin-RevId: 9a828f44ef0952f7335b5a8c0f7844a069f90d80
## What changed
- Add `UsageAccountingDecision::ExhaustedForTurn` so hosts can fail the current response with `SessionBudgetExceeded` while leaving later turns and peer threads eligible.
- Preserve completed response output and token usage before reporting exhaustion, and track posted charges to avoid accounting twice.
- When steering or mailbox preemption stops a stream, wait for accounting of any completion already observed before starting a follow-up request, and propagate budget errors.
## Testing
Add coverage for preserving output and usage on turn exhaustion, successfully starting a later turn, and reporting turn exhaustion during steering.
GitOrigin-RevId: e673bf30775f27a057fdc39d8429b74ff22121db
## What changed
Move local attachment snapshotting and conversion from `UserInput` to model request content out of `codex-protocol` into a dedicated `codex-user-input` crate. Update core, the TUI, and the queue extension to use the new crate, replacing the `ResponseInputItem` conversion methods with `from_user_input`.
Move the associated attachment and message conversion tests alongside the implementation, preserving coverage for image positions, media labels, serialization, and error placeholders.
GitOrigin-RevId: 77d0f94a4cd4c2edc008b9e2e63a989995aab058
## Why
A nested MCP approval can arrive while its enclosing tool invocation is still running. Follow-up Guardian reviews may use a transcript delta that no longer includes that invocation, leaving out the context in which the nested action was requested.
## What changed
- Add the disabled-by-default `guardian_nested_approval_context` feature to include the host-verified enclosing tool name and arguments in synchronous nested approval requests, while preserving the nested action as the action under review.
- Match the enclosing invocation by call ID and omit ambiguous or unavailable evidence. Exclude Node REPL JavaScript preflight requests.
- Admit enclosing-call context only when it fits the remaining fixed or elastic budget, without displacing ordinary transcript evidence or screenshots.
## Testing
Add MCP elicitation coverage and a request-history snapshot for independent nested reviews and transcript deltas. Add tests for call-ID matching, budget-based omission, and screenshot priority.
GitOrigin-RevId: 9c44a0e8f29f84f84a5322b8362f910f2c91ac55
## What changed
Add `apply_start_responsesapi_client_metadata` and use it in both turn-start paths. The helper delegates to `update_responsesapi_client_metadata`, preserving existing metadata behavior.
GitOrigin-RevId: 6eb677592492bec5847257ef7162d4002834570d
## Why
Child agents configured to interrupt at item boundaries should retain the summary when interrupted during remote compaction. An interrupt during post-turn compaction should also preserve the answer already completed.
## What changed
- Keep sampling interrupt registration active through summary installation, then honor the pending interrupt without running post-compaction hooks.
- Deliver an already completed answer when post-turn compaction is interrupted.
- Keep queued follow-ups for a new turn instead of continuing the interrupted turn.
## Testing
Add a streaming scenario test and context snapshot covering interrupts during mid-turn and post-turn remote compaction. Verify that resumed requests retain the summaries, the completed answer is delivered, and each queued follow-up starts a separate turn.
GitOrigin-RevId: 939eb8b3ed24dbdbff10c9f62226e38a0198fd6f
## What changed
Add the multi-agent v2 setting `interrupt_at_item_boundary`, disabled by default. When enabled, `interrupt_agent` lets a subagent finish and retain its current output item while cancelling tools immediately. Later output items are discarded, and retained tool calls that have not run receive an aborted result.
Wait for the interrupted turn's terminal event before starting follow-up input, and prevent idle contributors from restarting the interrupted child.
## Testing
Add streaming tests for retaining an assistant message or tool call, discarding later output, and preserving history and follow-up input when the child resumes. Update configuration and interrupt-routing tests.
GitOrigin-RevId: 8b2b9b1383bfb4eefea7369a40012bebc5fff07b
## What changed
Add the disabled-by-default `utc_environment_date` feature to compute the model-visible environment date in UTC and render it as `<current_date_utc>`. Preserve local dates when the feature is disabled.
Track the date's time basis in environment snapshots so switching to UTC emits an update even when the date is unchanged. Use the matching date tag when reporting an unavailable clock.
## Testing
Extend coverage for UTC midnight rollover, unchanged dates within a day, legacy snapshot refresh, and date removal and recovery. Update local and remote compaction snapshots to exercise the UTC date tag.
GitOrigin-RevId: 6e983d05ca2914629c9f8575e2efe3ed274a2f77
## What changed
- Add `rollout_trace.max_payload_bytes` and `rollout_trace.max_bytes`, defaulting to 64 MiB per body or separated value and 256 MiB per bundle. Root and child threads share the bundle budget.
- Record explicit truncations and omissions when limits are reached, reserve space for later events, and stop at the last complete event if the event log fills.
- Reuse identical prepared-prompt items and store inline images separately from message structure. Preserve exact JSON bytes for complete composite payloads and surviving content and links in partial captures.
- Let reducers handle partial payloads while retaining lifecycle information and reporting `closed_with_partial_payloads` for closed bundles with incomplete captures.
## Testing
Add coverage for payload reuse and byte-exact reconstruction, truncation, compressed bundle budgets, later events after omissions, readable prefixes after event-space exhaustion, and CLI capture-limit configuration and startup failures.
GitOrigin-RevId: be99a68da427414a7a12bf8209f232c1a0bbe545
## What changed
- Add `transparent_tcp` to network configuration and managed requirements, defaulting to off. When enabled, route outbound TCP from managed Linux sandbox commands through the managed SOCKS5 proxy without requiring an executor startup flag.
- Propagate the setting through local and remote execution, require an enabled SOCKS5 proxy, and check the executor's `networkProxyTransparentTcp` capability before remote launches.
- Refresh the live proxy when switching between permission profiles with different network settings.
## Testing
Add coverage for configuration-driven sandbox capture, rejection of unsupported launch contexts, execution parameter propagation, and live permission profile changes.
GitOrigin-RevId: c4db87056de116f433a128806bef673802f35397
## Why
A steer can restart sampling within the same turn. Recreating the diff tracker loses earlier edits, and changing the working directory can change the meaning of relative diff paths.
## What changed
Keep the diff tracker for the lifetime of the turn and retain each environment's first display root. Refresh cached diff headers when new environments are added. Emit the final aggregate `TurnDiff` before `TurnComplete` instead of at sampling completion.
## Testing
Extend regression coverage for steering during the final flush, with and without additional patches and with a changed working directory. Check final diff ordering across continued sampling and header updates when adding an environment.
GitOrigin-RevId: fbd1ebef072d8486a324190c9125fc1446510802
## What changed
Reuse connected thread tool inventories for paginated `ToolsAndAuthOnly` status requests when registrations, client settings, permissions, environments, and authentication match. Restrict reuse to connections with fixed credentials; discover remaining servers separately and preserve enterprise-managed servers' admitted thread connections.
Bind status configuration to the same environment and permission inputs used by the thread runtime, and limit authentication-failure inspection to the requested servers.
## Testing
Extend status tests to cover fixed-credential reuse, fresh discovery for stored OAuth authority, full resource discovery, and inventories for dormant threads without starting their runtime connections. Verify that paginated lightweight results keep same-named servers in different environments separate.
GitOrigin-RevId: eaca6365fb2a739eaad76eefdc62ec9f796b1024
## What changed
- Centralize generation admission checks before request contributors run for HTTP and non-warmup WebSocket requests.
- Route pending input and inline compaction through dedicated budget checks, and centralize post-compaction budget handling.
- Preserve whether any checkpoint was installed when remote compaction combines a background candidate with foreground compaction.
- Track accepted final answers separately from trailing commentary and encapsulate the response state shared by stop and after-agent hooks.
## Testing
Update the plan-mode contributor test to verify that contributed commentary is tracked separately from final answers, and adapt stream-event assertions to the phase-aware assistant text representation.
GitOrigin-RevId: 43b663e92bfd24ec7e5a0778b711938f16a7fea4
## Why
A budget can be exhausted while another thread waits to start work. New requests, tools, and automatic turns must observe that stop without discarding an already-consumed response whose cost exhausted the budget.
## What changed
- Share a work gate across the rollout tree while preserving native and host accounting ownership.
- Recheck the budget before HTTP and WebSocket requests, hook execution, tool dispatch, and compaction. Prevent automatic wakeups and late input from restarting stopped work, leaving pending input queued.
- Record response costs without rejecting the consumed response solely because its bill exhausts the budget, and stop new work when enforced accounting overflows.
- Expose a thread-registration receipt that remains committed after unload.
## Testing
Extend rollout-budget coverage to verify that accepted response text remains in history after exhaustion and that waiting tools observe the shared stop while completed tools retain their results.
GitOrigin-RevId: e583d657c6f29e374d374cdb014bf23fd6c28614
## Why
Turns stopped by an exhausted rollout budget need a history marker without attributing the interruption to the user.
## What changed
- Record and flush a `<turn_aborted>` marker before the terminal event for `SessionBudgetExceeded`, respecting the interrupt-message setting.
- Use neutral guidance in a `developer` message for automatic budget stops.
- Centralize tool-start budget checks across parallel dispatch, tool handlers, and MCP handoff, retaining the check after tool-start observers finish waiting.
- Share interruption classification and history recording across turn and compaction paths.
## Testing
Extend the rollout-budget integration test to assert that both the budget-crossing turn and a later denied turn persist `developer` interruption markers.
GitOrigin-RevId: 2a49ac9824a4e95e4799f2d0f638f8c46889e8e8
## What changed
Allow successful synchronous `PostModelRequest` MCP hooks to return `extra_codex_rollout_budget_units` in `structuredContent`. Add these charges to rollout spending while preserving provider usage separately, including completed responses without token usage and incomplete responses with reported usage.
Validate prices as finite and nonnegative. Preserve valid sibling charges when another hook reports an invalid price, and surface accounting failures without retrying inference. Carry hook charges and overflow information through host accounting and enforce local budget limits.
## Testing
Extend coverage for hook-driven budget exhaustion, failed hooks, overflow, interrupted responses, and foreground and background compaction accounting.
GitOrigin-RevId: dc54ba53478d82848bcafb55ecef88215019d09f
## What changed
- Add a positive, finite `features.rollout_budget.limit_budget` allowance while retaining `limit_tokens` compatibility. Reject configurations that specify both.
- Preserve fractional balances in reminders and compare thresholds without rounding the balance down.
- Accumulate charges with compensated summation and allow spending exactly the allowance, including floating-point rounding tolerance for cases such as `0.1 + 0.2` against `0.3`.
- Add `reminder_at_context_start`, defaulting to `true`. Set it to `false` to suppress reminders at thread start and after compaction; combine it with an empty threshold list to disable budget reminders entirely.
## Testing
Extend configuration and rollout-budget tests to cover fractional allowances, legacy integer persistence, invalid limits, threshold-only reminders, and enforcement at decimal equality and after overspending.
GitOrigin-RevId: b8e7a2faa8d39e562bcae196364de419698bc67d
## Why
A rollout budget can be exhausted while a tool call waits for an execution slot, approval, or a lifecycle callback. Checking only when scheduling the call can allow new work to start after the budget is exhausted.
## What changed
- Recheck the budget after acquiring an execution slot, immediately before starting a handler, and immediately before handing an MCP request to the server.
- Report refused calls as aborted in tool outputs, lifecycle callbacks, and dispatch traces, while allowing already-running work to complete.
- Track handler start time separately from dispatch waiting and preserve terminal outcomes when cancellation arrives during completion callbacks.
## Testing
Add regression coverage for queued calls and calls paused in start callbacks when the budget is exhausted. Verify MCP requests are blocked before handoff and retain successful results after handoff, and assert budget-stop state during remote compaction.
GitOrigin-RevId: 573730391452256592d3512f15929a2fbdf03c57
## Why
Streaming can dispatch tools before a response finishes and its usage is accounted for. Allow callers to wait for completion and synchronous post-hooks so budget enforcement can block tools from the response that exhausts the budget.
## What changed
- Add `responses.process_mode = "after_complete_response"` to buffer response items and release them in order after completion, synchronous post-hooks, and usage accounting. Keep `streaming` as the default and deliver safety-buffering notifications immediately.
- Track whether response usage has already been charged to avoid duplicate accounting, including during compaction.
- Stop new tools across the agent tree when the rollout budget is exhausted. Coordinate steering with accounting and prevent buffered tool calls from dispatching after steering or cancellation.
- Bound buffered responses to 65,535 events and reject overflow.
## Testing
Add configuration coverage and extend integration tests for buffered output ordering, synchronous hooks, interrupted responses and resume, steering, invalid usage, and budget exhaustion preventing tool dispatch.
GitOrigin-RevId: bd06811cfd50cb701babe6353465c57dfed2a37a
## What changed
- Pair `PreModelRequest` and `PostModelRequest` hooks per sampling or compaction attempt, with distinct lifecycle IDs and cancellation reporting.
- Add `thread_id` and `kind` to hook inputs, distinguishing `sampling`, `foreground_compaction`, and `background_compaction`. Include the provider's `response_id` in post-hook inputs when available.
- Wait for synchronous post-hooks before releasing terminal response events, accounting for usage, or installing compaction results. Allow streaming output and tool execution to proceed before the hook finishes, and cancel synchronous post-hooks when their owning request is interrupted.
- Preserve incomplete-response, budget-exceeded, and hook-denied outcomes across sampling retries and compaction model fallback.
## Testing
Add coverage for streaming and tool ordering, interrupted post-hooks, per-attempt metadata, and foreground and background compaction accounting and installation ordering.
GitOrigin-RevId: 3e808c5b3bf2d5a6a326d9f5be5bbd0359b2d16e
## What changed
- Add `RequestCountry` for host-supplied country codes. Normalize two-letter ASCII codes to uppercase, omit the field by default, and serialize explicit unknown (`XX`) as `null` to prevent fallback to request provenance.
- Carry `request_country` through thread defaults and captured step settings into Codex backend HTTP and WebSocket requests. Allow live country updates without enabling `step_model_switching`, and preserve WebSocket continuation reuse when the country changes.
- Propagate the captured country to subagents, reviews, and compaction requests.
## Testing
Add coverage for country validation and serialization, thread and live-turn update lifetimes, prewarm settings capture, agent inheritance and reloads, compaction and reviews, WebSocket country changes, and HTTP fallback.
GitOrigin-RevId: 787cd1fa7ba5d465a4eb64a92f13c79e93d9bca7
## Why
Selected environments can have different filesystem and network permissions, but context previously described only the primary environment's rules.
## What changed
- Add the disabled-by-default `per_environment_context` feature.
- Group filesystem and network access under each environment ID, including when only one environment is selected. Label shared network requirements separately.
- Scope permission instructions and incremental updates to each environment. Withdraw stale descriptions and use labeled thread defaults when no environment is ready.
- Track approved command prefixes separately so new approvals do not require repeating unchanged permission instructions.
## Testing
Extend rendering and permission snapshots for scoped context, removed scopes, thread defaults, and format transitions. Update the active-turn scenario to cover two environments with different permissions, changing only the second environment's workspace and permissions and restoring its defaults on the next turn.
GitOrigin-RevId: c948089c12da7b15eee378d8c5a23a233d24502b
## What changed
- Record voice transcripts as `frame` items with a `voice_transcript` channel for eligible threads, while retaining legacy transcript support and the existing app-server live and mixed timeline representation.
- Assign first-observed timestamps that never move backward, retain them through completion, and restore the clock floor from history and compaction checkpoints.
- Flush realtime records before completion notifications, including file and initial directory durability barriers for local rollouts.
- Generate a distinct default session ID for each new call, use the call ID when attaching to an existing call, and derive opening record IDs from session IDs.
- Add protocol types for turn-input acceptance and session-end input receipts, excluding those receipts from live notifications and mixed timelines. Update generated schemas and SDK types.
## Testing
Add coverage for frame serialization and required voice payloads, clock rollback and checkpoint restoration, durability barrier failures and retries, per-call session IDs, and persisted transcript availability immediately after completion.
GitOrigin-RevId: 3f6632b517d563861aee085b723475b8945c391c
## What changed
- Consume the optional delivery handle directly when recording inter-agent messages.
- Capture compaction resume metadata before constructing the `CompactedItem`.
- Move the existing inter-agent message rollout and resume test into `mail_publication_tests.rs`, preserving its assertions for turn IDs, timestamps, persisted metadata, and restored history.
GitOrigin-RevId: 761a837922377d5a72266d775622211e43fa87d3
## What changed
Add the token-budget setting `context_window_as_tool_output`, defaulting to `false`. When enabled, render agent identity, context window IDs, and associated hints as an `agent.thread_hint` tool output. Use the same format for agent identity updates in forked threads.
Preserve this setting when applying model token-budget defaults without treating it as an explicit budget override.
## Testing
Update fork scenario snapshots to cover tool output rendering, including a child agent's window hint after its inherited parent context and a prediction fork above the compaction threshold.
GitOrigin-RevId: e1a7089935bd0aed44ffd15f0ae3ec41a2607218
## Why
Hosts need to refresh cloud plugin and skill catalogs without starting a turn or waiting for step preparation.
## What changed
- Add `CodexThread::refresh_cloud_plugins()` and a turn-independent extension callback that bypass cached catalog reuse and failure cooldowns.
- Run catalog contributors concurrently while serializing publication with step snapshot capture. Invalidate MCP resource caches before explicit discovery and schedule MCP reconciliation afterward.
- Accept complete and partial catalogs, report discovery errors, and keep failed or cancelled refreshes retryable.
- Allow hosts to gate cloud plugin discovery through effective configuration.
## Testing
Add coverage for discovery before turn admission, catalog replacement and reuse, immediate retry after failure, concurrent contributors, and cancellation-safe publication and invalidation.
GitOrigin-RevId: 83e847fcab6562581af2c9e831b1d2a310f2b270
## Why
Bundled `turn_ended` hooks can start an unused REPL server solely to clean it up, even though its deferred startup means there is no process to clean up.
## What changed
Allow bundled cleanup calls for `node_repl` and `cua_repl` to return an empty successful result when startup has never been requested. Limit this behavior to configured, unshared local stdio connections using the legacy MCP protocol. Other calls continue to wait for server startup.
## Testing
Add coverage for the connection eligibility checks and extend subagent hook tests to verify that bundled cleanup leaves unused REPL servers dormant while ordinary hooks can still start cached tools hidden from the model.
GitOrigin-RevId: 0a07772fccd670c53348ff7a702b4bee353e263c
## Why
Installing a plugin without connector tools must still refresh a cached cloud skill catalog so its skills are visible to the next inference.
## What changed
- Rely on step preparation for cloud plugin and skill discovery, removing their turn-start callbacks and the `requires_mcp_runtime` lifecycle hook.
- Request an MCP runtime refresh after every completed plugin install, including skills-only installs.
## Testing
Add regression coverage for skills becoming visible immediately after a connector-free install. Update lifecycle tests to cover discovery after MCP reconciliation, prewarm skipping discovery, cancellation allowing subsequent preparation, and reuse of unchanged connections. Use deterministic DNS lookups in network proxy authorization tests.
GitOrigin-RevId: 76036bd29253fb8987e606c3c28411c689590fc4