1474 Commits

Author SHA1 Message Date
Alex Daley
2cfee7de25 Refresh live thread tools through app/installed (#43039)
## Why

Calling `app/installed` with `threadId` and `forceRefresh: true` refreshed a separate runtime snapshot without updating the thread's tools for subsequent turns.

## What changed

Use the thread's current configuration and refresh its live app tools when a thread is specified. Account for the refreshed snapshot's model-visible tools when reporting `callable`. Requests without `threadId` continue to use a separate runtime for refreshes.

## Testing

Add integration coverage verifying that refreshed tools replace previous tools in subsequent model requests and can be called, and that a failed refresh preserves the last working tools. Extend thread configuration coverage to include forced refreshes.

GitOrigin-RevId: fc13e28a59da00af470cf25c0cde356504e1575b
2026-09-05 15:30:18 +00:00
jif
a7a4321593 Preserve the resolved multi-agent version when reverting threads (#43000)
## Why

Reverting a paginated thread can remove the turn context that records its resolved multi-agent version. Preserve that version so a model-selected V2 thread keeps its collaboration tools after reload or a server restart.

## What changed

Pass the live thread's `multi_agent_version` into the thread store and persist it in the replacement rollout's session metadata. When no live version is supplied, retain the existing metadata value. Document this guarantee for `thread/revert`.

## Testing

Add regression tests for model-selected V2 across live reload and cold resume, plus metadata preservation for `V1`, `V2`, and `Disabled` across repeated reverts.

GitOrigin-RevId: bd7d4d76a50d23da16caa2a0631acf10bfa49629
2026-09-05 12:58:26 +00:00
faizan-oai
3921a30d6b Persist Daybreak preferences in thread metadata (#42854)
## Why

Clients need a per-thread Daybreak toggle that survives restarts and can be
restored on resume without changing the access program of an active or future
turn.

## What changed

- Add experimental `daybreakEnabled` support to `thread/metadata/update` and
  expose the saved value on thread responses.
- Store the preference in SQLite, including for threads without a first turn,
  and preserve it through reads, resumes, reconciliation, and restarts.
- Copy the preference when forking a thread while keeping subsequent updates
  independent.
- Keep `daybreakEnabled` separate from the per-turn `cyberAccessProgram` field;
  app-server does not derive one from the other.

## Testing

- Cover persistence across restarts, cold reads, reconciliation, and forks.
- Verify metadata updates do not alter the access program of active or later
  turns.

GitOrigin-RevId: bcf987a9fcd7b0ac8a88b1c8f0df06b33ed8ad6e
2026-09-04 21:17:25 +00:00
efrazer-oai
8e4b7d31de Use jemalloc for Linux musl binaries (#42850)
## What changed

- Configure the CLI and app server to use `tikv-jemallocator` on
  `x86_64-unknown-linux-musl` and `aarch64-unknown-linux-musl`.
- Keep the dependency and global allocator selection scoped to those targets.

GitOrigin-RevId: 93c54c90d9acb7e48edffd032cd8ec685a782210
2026-09-04 20:48:16 +00:00
iceweasel-oai
773f0b081d Preserve executor paths in Guardian approval reviews (#42838)
## Why

Guardian approval actions can contain paths from a remote executor whose path convention differs from the host, such as Windows paths reviewed on a POSIX host. Converting those paths to host-native absolute paths prevents the action from being reviewed.

## What changed

- Render command working directories using the executor's reported path convention, and preserve URI-backed paths for attribution.
- Carry foreign command and patch paths through Guardian events and app-server schemas as legacy path strings.
- Bound remote plugin attribution within the overall review deadline and reject Guardian action payloads that exceed the review byte limit.

## Testing

- Cover Windows and POSIX executor path rendering, foreign patch paths, protocol round trips, oversized payload rejection, and remote Guardian review context.

GitOrigin-RevId: 38be0fcdac897139519e74e077eb5cb4f8f8017e
2026-09-04 19:56:31 +00:00
nmccormack-oai
0f64d70808 Expose managed WebMCP policy through the app server (#42823)
## What changed

- Parse the optional `[browser_use].allow_webmcp` boolean from managed requirements and preserve requirement-layer precedence.
- Return the policy as `browserUse.allowWebmcp` from `configRequirements/read`, including explicit `true`, explicit `false`, and `null` when omitted.
- Update the generated JSON and TypeScript protocol schemas.

## Testing

- Cover parsing, invalid values, layered overrides, and app-server response serialization.

GitOrigin-RevId: a3fd7d1a6f838bb3ab0ac2a644409101a2338ca6
2026-09-04 18:30:26 +00:00
alishobeiri-oai
86b1b359cf Enable staging login issuer overrides in packaged builds (#42811)
## Why

Packaged clients need to pair a staging OAuth client ID with the matching
issuer. The issuer override was previously limited to debug builds.

## What changed

- Apply `CODEX_APP_SERVER_LOGIN_ISSUER` in all builds when it contains a
  non-empty value.
- Keep `CODEX_APP_SERVER_DEV_OPEN_APP_URL` debug-only.

## Testing

Exercise the complete app-server OAuth flow with the issuer and client ID
overrides, including authorization, token exchange, and login completion.

GitOrigin-RevId: 13d290b9dae689cd811361b1b549953a3b52db42
2026-09-04 17:51:32 +00:00
Chris Hayduk
c9fac4dd5a Avoid holding metadata permit during cold resume config load (#42773)
## Why

Cold `thread/resume` configuration loading can call back into the host. Holding the global metadata permit during that work blocks unrelated thread metadata updates and MCP requests.

## What changed

- Release the metadata permit while loading configuration for a cold resume.
- Reacquire the permit and reload the resolved thread history before startup.
- Reload configuration when persisted metadata, settings, or the history working directory changed during the unlocked interval.
- Rejoin a thread that another request resumed concurrently, and avoid reopening threads that were archived or deleted.

## Testing

Add coverage for unrelated metadata and MCP requests during a blocked config load, concurrent resume mutations, and the extra history read required for non-local thread stores.

GitOrigin-RevId: 8cbd3868eeff84968765b1e3dbc7590ebe5fa892
2026-09-04 14:23:27 +00:00
jif
d13aeb77ea Allow trusted symlinks beneath CODEX_HOME on macOS (#42716)
## What changed

- Add the macOS-only `allow_symlinked_codex_home` user setting. When enabled in the execution host's `$CODEX_HOME/config.toml`, writable roots at or beneath that home may traverse symlinks.
- Keep the exception disabled by default and prevent project config, command-line overrides, and ignored user config from enabling it. Other writable roots remain subject to symlink checks.
- Propagate the resolved setting through local, interactive, and exec-server sandbox paths, including `CODEX_HOME` aliases.
- Explain the opt-out in symlink rejection errors, including that it trusts targets outside `CODEX_HOME` and targets that change between commands.

## Testing

- Add macOS coverage for shell commands, patches, filesystem helpers, process execution, and interactive startup with enabled, disabled, aliased, and out-of-scope homes.

GitOrigin-RevId: 99fcdf611200c9e1b7713cf06f7fdea5bfa7f089
2026-09-04 10:12:03 +00:00
ningyi-oai
ea2046f36d Cancel remote control enrollment on stdio shutdown (#42668)
## Why

A pending remote control enrollment could prevent the app server from exiting
after stdio EOF, leaving resources such as thread writers held by the process.

## What changed

- Give remote control its own child shutdown token and cancel it before draining
  RPCs when the stdio connection closes.
- Interrupt enrollment requests that require network access after shutdown has
  begun, while still allowing in-memory or persisted enrollments to be enabled
  and durably saved.

## Testing

- Cover stdio shutdown during a blocked enrollment and verify that another app
  server can acquire the released thread writer.
- Cover durable enablement after shutdown with in-memory, persisted, and missing
  enrollments.

GitOrigin-RevId: ef9ab49672f273a4cf8257188454a154c03088bd
2026-09-04 03:40:37 +00:00
Krish Chainani
03467026f2 Add an injectable attachment store to ThreadManager (#42634)
## What changed

- Add the `codex-attachment-store` crate with storage-neutral attachment metadata, references, errors, and an asynchronous persistence interface.
- Provide an inline implementation that preserves attachment bytes as media-typed base64 data URLs.
- Inject the store into `ThreadManager`, expose it to consumers, and retain inline storage as the default for existing entry points.

## Testing

- Verify inline storage round-trips binary, text, PNG, and JPEG data.
- Verify attachment debug output redacts URLs while retaining file IDs.

GitOrigin-RevId: 7688dcd3c89d7540ed2398f3e7c63881fbfcda97
2026-09-03 23:20:54 +00:00
yansenzhou-oai
f84c9776dc Deprecate detached review delivery (#42602)
## What changed

- Emit a connection-scoped `deprecationNotice` when `review/start` uses
  `delivery: "detached"`, including when validation later rejects the request.
- Preserve detached review behavior while directing callers to use `thread/start`
  followed by an inline review for a separate review thread.
- Document the deprecation and migration options in the app-server protocol and
  README.

## Testing

- Cover the notice for accepted and rejected detached reviews.
- Verify that omitted, null, and inline delivery do not emit the notice.

GitOrigin-RevId: 4234a09d2bb7ef8053091580175dc8cbe8d7512c
2026-09-03 19:36:11 +00:00
victor-openai
8f31b64c7f Report MCP tool discovery errors in server status (#42598)
## Why

An empty tool map does not distinguish a successfully returned empty catalog from a server whose startup or tool discovery failed.

## What changed

- Add nullable `toolsError` to each `mcpServerStatus/list` entry when no catalog is available because startup or tool discovery failed.
- Keep `toolsError` null for returned catalogs, including cached and empty catalogs, and continue returning healthy servers when another server fails.
- Update the protocol schemas and generated TypeScript type.

## Testing

- Extend the app-server status integration test with a broken MCP server and verify its error without losing the healthy server's inventory.

GitOrigin-RevId: 30b4ca4d9a45cec6998f5f626d3fddbee90a525d
2026-09-03 18:36:58 +00:00
victor-openai
2387310b52 Reload user config after local plugin installation (#42593)
## Why

Loaded threads can retain their previous configuration after a local plugin is
installed, preventing the plugin's bundled MCP servers and pending user-config
changes from taking effect in the current session.

## What changed

- Reload user configuration for loaded threads after installing a local plugin.
- Refresh MCP and hook runtimes only after the new configuration is applied.
- Keep installation successful if configuration reload fails, while logging the
  failure.

## Testing

- Verify an installed plugin's MCP tool can be called from a thread that was
  started before installation.
- Update the hook runtime test to verify installation applies a staged hook
  configuration change to the loaded session.

GitOrigin-RevId: 63f5a5c7f16303e51cf940e8d9dc3b45c50ae2a9
2026-09-03 18:20:59 +00:00
iceweasel-oai
7a7c188682 Preserve target-native paths in command approvals (#42577)
## What changed

- Pass the selected executor's `PathUri` through user command approval requests instead of converting the working directory to a host-native path.
- Make native-path permission helpers explicitly local and require executor-aware permission transforms to receive a `FileSystemSandboxPolicyContext`.
- Cover approved remote commands to verify that the approval request reports the selected remote working directory and execution resumes after approval.

GitOrigin-RevId: 0aa3042f2d7594af6c7d0abf31d7f99cf67d5556
2026-09-03 16:21:10 +00:00
Can Sar
728cb12fe5 Expose thread originators through the app-server API (#42458)
## What changed

- Add the creation-time `originator` to app-server thread responses and `thread/started` notifications.
- Persist originators in thread metadata and preserve the first recorded value across list, read, resume, rollout, and SQLite paths.
- Add an `originators` allowlist to `thread/list` for hosted backends. The local app-server accepts omitted or empty values but rejects nonempty filters.

## Testing

- Cover originator persistence across server restarts and list, read, and resume requests.
- Verify local `thread/list` handling for nonempty, omitted, null, and empty originator filters.
- Heap-allocate large TUI dispatcher futures in affected tests to keep them within the Windows test-thread stack.

GitOrigin-RevId: 73ad6e61b8fdd2d93a22d1f971723a19ec7be3fc
2026-09-03 06:02:25 +00:00
acrognale-oai
b27a6321fa Expose managed application network requirements (#42417)
## What changed

- Add `application.network` managed requirements with exact-domain allow/deny
  rules, default-enabled behavior, domain normalization, and normal managed TOML
  precedence.
- Return the policy separately from agent network requirements through the
  experimental `configRequirements/read` API. The endpoint reports the policy
  but does not enforce it.
- Export the new protocol types and schemas, and document the TOML format.

## Testing

- Cover parsing, validation, normalization, layered precedence, and cloud
  requirement composition.
- Verify app-server responses, defaults, separation from agent policy, and
  rejection of invalid domains.

GitOrigin-RevId: 563eeed296d9748430b819797204a44a8db92f3b
2026-09-03 02:09:10 +00:00
Anton Panasenko
2b554fd3f9 Expose loaded thread environments in app-server responses (#42386)
## What changed

- Add the experimental `Thread.environments` field with each selected environment's ID, working directory, and runtime workspace roots.
- Populate the field from live thread state in start, resume, read, list, and unarchive responses. Use `null` for unloaded threads and an empty list when a loaded thread has no environment selection.
- Document that the field reports selection rather than connection status and does not affect executor selection or resume behavior.

## Testing

- Cover selection updates, unloaded and resumed threads, loaded pathless unarchives, and clients that subscribe after environment connection notifications.

GitOrigin-RevId: a6daa06aff7089d7c5a1e4c7d03109b41f12fa3c
2026-09-02 23:41:14 +00:00
guinness-oai
e1d0ef995f Make app-server realtime sessions always available (#42377)
## What changed

- Remove the per-thread `RealtimeConversation` feature check when starting a realtime session.
- Retain `features.realtime_conversation` as a removed compatibility setting that has no effect, even when set to `false`.
- Document the always-available behavior for `thread/realtime/start`.

## Testing

- Cover realtime startup on forked and cold-resumed threads with the legacy setting absent, disabled, or enabled.

GitOrigin-RevId: d9cd9aa3898d1c2efb9414a8f40c86be8951e210
2026-09-02 22:30:30 +00:00
dhruvgupta-oai
5037919777 Add Luna Reserve usage fallback to the TUI (#42372)
## Why

When ordinary included usage is exhausted, eligible users need a way to keep working with the backend-provided Luna Reserve quota and return to their previous model once ordinary usage recovers.

## What changed

- Automatically switch eligible TUI tasks to Luna Reserve after an authoritative account usage read, preserving the prior model and reasoning effort per task.
- Restrict model selection while on Reserve to its supported reasoning levels, keep queued turns on the accepted model, and restore the saved model after a fresh read confirms recovery.
- Surface Reserve usage in the composer and `/status`, and expose `normalModelSlug` in app-server rate-limit snapshots so clients can use the associated model's display metadata without changing the request model.
- Poll account limits more frequently near exhaustion and retain compatibility with app servers that only accept the legacy null request parameters.

## Testing

- Added coverage for Reserve entry, queued-turn handling, task reconstruction, recovery authorization, account changes, model selection, usage rendering, and banner dismissal.

GitOrigin-RevId: 46a435e9531051f8cec3f6a46c4b9f7cfa479747
2026-09-02 21:50:51 +00:00
Eric Traut
10aca93f18 Support graceful daemon shutdown on Windows (#42364)
## Why

Detached Windows processes cannot receive console signals, so app-server daemons
need another way to enter the existing graceful and forced shutdown flow.

## What changed

- Watch the path in `CODEX_DAEMON_SHUTDOWN_FILE` for a request addressed to the
  current process, and consume only a matching PID.
- Race daemon shutdown requests with Ctrl-C on Windows while leaving unmanaged
  launches on the existing console-signal path.
- Exercise the SIGTERM-equivalent graceful and forced WebSocket shutdown cases
  on Windows.

## Testing

Added unit coverage ensuring inherited control paths and malformed requests
cannot consume another process's shutdown request.

GitOrigin-RevId: 426a3c12edc344802395d4d26288f2bb015c484f
2026-09-02 21:20:03 +00:00
dhruvgupta-oai
577a4fcd06 Extend rate limit reads with usage capabilities (#42358)
## What changed

- Accept optional `account/rateLimits/read` capabilities for Luna Reserve support
  and lightweight background polling while preserving omitted and `null` params.
- Forward the Luna Reserve capability only for eligible ChatGPT sessions, and let
  lightweight polls skip the separate reset-credit detail request.
- Return the backend's `ordinaryUsageAllowed` decision only when its account and
  user identity match the active session.

## Testing

- Cover capability defaults, eligible and restricted authentication modes,
  lightweight polling, identity filtering, and backend permission handling.

GitOrigin-RevId: f407a3ae1e70e411fdf245f072a16e453f59cd87
2026-09-02 21:01:04 +00:00
johnl-oai
830363bd7c Add experimental Windows sandbox service provisioning (#42353)
## What changed

- Add the default-off `windows_sandbox_service` feature and expose it through
  app-server experimental feature enablement.
- When enabled, attempt service provisioning during elevated Windows sandbox
  setup, using the effective network proxy ports and listener roles. Continue
  through the existing setup path when the service is unavailable or the
  configuration is unsupported.
- Report unsupported Codex home drives as service unavailability so the client
  can fall back to the elevated helper.

## Testing

- Add a Windows-only unit test covering HTTP and SOCKS listener derivation from
  the effective proxy configuration.

GitOrigin-RevId: 40b119cf51f84e5d0e94d6a0a8d5b506d1123526
2026-09-02 20:30:45 +00:00
felixxia-oai
0d502a4230 Support durable reasoning configuration updates (#42328)
## Why

Reasoning configuration changes need to retain their position and trusted provenance when model history is persisted and replayed. Client-injected history must not be able to forge these controls.

## What changed

- Add a typed `configuration_update` response item carrying reasoning effort, including custom model-defined values.
- Persist harness-authored updates with provenance and preserve them across history reconstruction, thread resume, raw response notifications, and agent forks.
- Exclude untrusted configuration updates from model history, strip client-supplied provenance metadata, and reject configuration updates supplied as turn input.
- Export the new item through the JSON and TypeScript app-server schemas and classify it in telemetry and persistence metrics.

## Testing

- Cover serialization, provenance persistence, history filtering and rollback, resume reconstruction, and injection attempts before and after restart.

GitOrigin-RevId: eb5559d2b52b7a931621e7c9812f009ff9fb8939
2026-09-02 18:52:44 +00:00
Eric Traut
5e26f7621c Make the app-server thread unload delay configurable (#42320)
## What changed

- Add the top-level `thread_unload_delay_secs` configuration key for the
  app-server, with a 60-second default instead of the previous 30-minute
  fixed delay.
- Allow zero-delay unloading and reject values that cannot fit in a
  monotonic-clock deadline.
- Reset the unload countdown when a thread gains a subscriber or becomes
  active, and preserve active turns even when the configured delay is zero.
- Document that unloading ephemeral threads discards their in-memory state.

## Testing

- Cover configuration parsing, defaults, overrides, and overflow rejection.
- Cover unsubscribe, resubscribe, delayed and immediate unloading,
  notifications, persisted-thread resume, and WebSocket disconnect behavior.

GitOrigin-RevId: edd46f6b49bbdafbf606bff74378e8f569e95977
2026-09-02 18:18:54 +00:00
iceweasel-oai
eb078b4f44 Preserve target-native cwd in permission approval requests (#42314)
## Why

Permission requests can originate in an environment whose path convention differs from the Codex host. Requiring the request working directory to be host-native prevents those requests from reaching interactive approval.

## What changed

- Carry the request `cwd` as a `LegacyAppPathString` through core events and the app-server protocol so the target environment's native representation is preserved.
- Convert the preserved value back to a `PathUri` when materializing permission grants.
- Regenerate the JSON and TypeScript protocol schemas for the updated `cwd` type.

## Testing

- Exercise the app-server permission request round trip with a target-native working directory across host path conventions.
- Verify remote permission requests retain their environment working directory and granted access still unblocks later execution.

GitOrigin-RevId: 97dc9707d9048883d20bab1b69c93871039f3188
2026-09-02 17:27:50 +00:00
rka-oai
2c79ee6dac Add structured asynchronous user input requests (#42178)
## What changed

- Replace `send_user_message_async` with `request_user_input_async`, accepting one or more questions with optional suggested answers while allowing the turn to continue.
- Attach structured question metadata to asynchronous agent messages while retaining readable fallback text, and preserve it through app-server events, thread history, and generated schemas.
- Continue enabling the new tool for model catalogs that advertise either the old or new tool name.

## Testing

- Cover tool registration, question validation, emitted items, continued turn execution, history preservation, and backwards-compatible deserialization.

GitOrigin-RevId: ffc49aebde2e854c3c50a122aa52805fec3fc6b3
2026-09-02 02:09:35 +00:00
Brent Traut
986ff1cc7c Expose model settings in app-server thread metadata (#42151)
## What changed

- Add nullable `model` and `reasoningEffort` fields to the shared app-server `Thread` object and generated schemas.
- Report current settings for loaded threads and the latest persisted settings for unloaded threads across thread read, list, start, resume, rollback, metadata update, and notification paths.
- Keep unavailable legacy or filesystem-only settings nullable, and allow metadata reads without loading a thread or dispatching queued work.

## Testing

- Cover live-setting precedence, persisted settings after restart, null legacy values, and model metadata returned by thread lifecycle operations.

GitOrigin-RevId: 22ebe8a8d1910a820d90a97730d812a00d8c1372
2026-09-01 22:56:18 +00:00
willwang-openai
6b59cefcbb Support remote marketplaces in the plugin CLI (#42150)
## What changed

- Include remote catalog entries in `codex plugin list`, including their source,
  version, install policy, and authentication policy in JSON output.
- Support adding and removing remote plugins through the existing plugin CLI.
- Cache remote catalogs by scope and collection. Prefer fresh cached results, and
  refetch once when an add request misses a plugin in the cache.
- Preserve the local curated catalog when an unfiltered remote listing fails,
  while surfacing errors for explicitly selected remote marketplaces.

## Testing

- Cover remote listing, installation, removal, catalog fallback, cache refresh,
  collection isolation, and install failure behavior.

GitOrigin-RevId: 09796b2c393d102e00ba9289f784d78a2e166a54
2026-09-01 22:51:14 +00:00
willwang-openai
68c9556cdf Upgrade Git marketplaces from merged configuration (#42149)
## Why

Configured Git marketplaces may be defined outside the user config, but those definitions could not download or update their snapshots.

## What changed

- Select marketplace source, ref, and sparse-path settings from the effective merged configuration for startup synchronization and explicit upgrades.
- Preserve the initiating operation's configuration loader and overrides when reloading before activation.
- Roll back activation if the marketplace definition changed or configuration can no longer be loaded, without copying settings into the user config.

## Testing

- Cover system-defined marketplaces, CLI overrides, startup fallback after invalid user configuration, and rollback after configuration changes.

GitOrigin-RevId: 53d1eecf68a91ce2aa8430e5749d78697bfcd821
2026-09-01 22:37:26 +00:00
jif
e576993911 Skip Guardian reviews in Full Access (#42147)
## Why

Full Access already combines `approvalPolicy: "never"` with unrestricted
permissions, so confirmation-only actions do not require a model review.

## What changed

- Detect Full Access consistently across the thread and every selected
  environment. Pending, failed, or restricted environments are not treated as
  Full Access.
- Approve confirmation-only Guardian and MCP requests without synchronous
  review, sampler prewarming, or background scoring. Cancellation, explicit
  denials, and forms that require user input keep their existing behavior.
- Re-evaluate the active permission state on each turn so an existing thread
  can enter or leave Full Access safely.

## Testing

Added coverage for switching approval modes, strict sensitive MCP
confirmations, failed and pending environments, and suppression of Guardian
requests and background-scoring connections.

GitOrigin-RevId: 089ab4296dde473b8e33ab8324be79c5446c46f6
2026-09-01 22:16:54 +00:00
iceweasel-oai
cd8bd62c6e Resolve permission requests in the executor context (#42146)
## Why

`request_permissions` paths and grants need to be evaluated against the selected executor environment, including its path convention, home directory, workspace roots, and temporary directories.

## What changed

- Resolve relative and home-relative permission paths using the executor context, reject mismatched path conventions and lossy paths, and support legacy `read` and `write` path lists.
- Move grant intersection into core so requested and granted permissions use the originating environment's sandbox context. Preserve deny entries conservatively when a special path cannot be resolved.
- Keep the full originating environment with pending permission requests so delayed responses are normalized against the same context.

## Testing

- Cover POSIX, Windows, UNC, relative, and home-relative path resolution and invalid path contexts.
- Verify end-to-end app-server grants are limited to the requested workspace scope and unresolved temporary-directory denies are preserved.

GitOrigin-RevId: 730a2aacd391262e92a6314f3a5b6c262e3dca10
2026-09-01 22:08:08 +00:00
jif
9112564114 Allow updating the approval reviewer for active turns (#42121)
## What changed

- Add `approvalsReviewer` to the experimental `turn/settings/update` API.
- Apply reviewer changes to subsequently captured steps and new background approval requests while preserving pending approvals and future-thread defaults.
- Allow reviewer-only updates without `step_model_switching`, while continuing to enforce managed reviewer restrictions and model-required auto review.
- Use an explicit live reviewer update for MCP approvals while retaining refreshed thread defaults for clients that have not set one.

## Testing

- Cover switching between user and automatic review during a live turn, future-turn isolation, and managed-authority rejection.

GitOrigin-RevId: e1216b09c6a7972c2c9eaf4955d8d57d60604ca1
2026-09-01 19:19:52 +00:00
willwang-openai
ef76e6ac30 Centralize remote plugin mutations in PluginsManager (#42114)
## What changed

- Move remote plugin install and uninstall orchestration from the app server into shared `PluginsManager` APIs.
- Keep cache and backend mutations coordinated by the installed-plugin sync gate, and retain install outcomes long enough to protect newly materialized bundles during downstream setup.
- Return structured operation errors and outcomes so callers can preserve JSON-RPC error mapping, telemetry, cache refreshes, and OAuth setup.

## Testing

- Add regression coverage that verifies uninstall holds the mutation gate, preserves the local cache when the backend operation fails, and refreshes installed state after a successful uninstall.

GitOrigin-RevId: de39f19a4e61c6e9c76ddc2c65d2ac130a4b7f88
2026-09-01 18:35:00 +00:00
teddywyly-oai
c7c824dce4 Treat bundled cleanup hooks as built-ins (#42110)
## What changed

- Centralize the allowlist for bundled MCP cleanup hooks and use it for both local and executor-discovered plugins, including `unified-computer-use` cleanup through `cua_repl`.
- Mark matching cleanup hooks as trusted built-ins so they run without saved hook trust and remain active when regular hooks or their per-hook state are disabled. Plugin enablement and managed-only policy still apply.
- Hide built-in cleanup hooks from hook listings and lifecycle notifications while retaining their metrics. Keep the built-in classification out of serialized protocol data.

## Testing

- Cover allowlist boundaries, trust and enablement behavior, inline and file-based hook declarations, MCP success and error responses, hook listing, lifecycle notifications, metrics, and protocol serialization.

GitOrigin-RevId: f93b7bc99f4ed9694f529def8ec383b45f31430e
2026-09-01 18:02:27 +00:00
Jiwon Kim
b6ab99ed87 Prefer remote Sites over the bundled plugin (#42100)
## Why

When the remote Sites plugin is installed and its local bundle is available, exposing the bundled copy as well creates duplicate catalog entries and can load the wrong skills.

## What changed

- Persist an account- and backend-scoped exclusion for `sites@openai-bundled` once the remote replacement is installed and loadable.
- Apply the exclusion to plugin catalogs, search, direct reads and installs, runtime loading, hooks, and skill caches while preserving the remote plugin's server-owned enabled state.
- Restore the bundled fallback when the remote plugin is absent or its local files are unavailable, and throttle repeated availability checks for 60 seconds.

## Testing

- Added manager tests for persistence across restarts, account/backend isolation, fallback restoration, concurrent checks, and refresh throttling.
- Added app-server and agent-turn tests confirming that catalog, search, and skill loading prefer remote Sites.

GitOrigin-RevId: bc1154f79d3107910fee9fa27389a0ddb48ce6cf
2026-09-01 16:58:54 +00:00
chess
a17ee5705c Make diagnostic report uploads resilient to slow networks (#42096)
## Why

Diagnostic reports can span several envelopes, and the previous 10-second shared
network budget could expire before slow uploads and their attachments completed.

## What changed

- Give each diagnostic report a single five-minute deadline shared by the event,
  attachments, retries, and retry backoff.
- Stop reading or sending later attachments once the deadline or a Sentry rate
  limit is reached.
- Limit the app server to three concurrent report uploads and return an
  overloaded JSON-RPC error for additional requests until a slot is released.

## Testing

Add coverage for slow multi-envelope reports, deadline-aware retries, skipped
attachments, rate-limit handling, and concurrency-slot release after failures.

GitOrigin-RevId: bdacf6c9731df16d2763e204565986eb6d540233
2026-09-01 16:49:16 +00:00
Alex Zamoshchin
0ec375eb70 Add per-account approval settings for apps (#42047)
## What changed

- Add `apps.<app_id>.links.<link_id>` configuration for overriding
  `approvals_reviewer` and `default_tools_approval_mode` per connected account.
- Expose link settings through the app-server protocol and generated JSON and
  TypeScript schemas.

## Testing

- Extend `config/read` coverage for populated, empty, and absent `links`
  sections.

GitOrigin-RevId: 43004d2722439060fdadc5e5cd9ed3108774ecaf
2026-09-01 13:07:56 +00:00
jif
90ae0c4ef9 Tag Codex home size metrics with compression state (#42043)
## What changed

Add a `compression_enabled` attribute to each
`codex.app_server.codex_home.size_bytes` sample. The value reflects whether
`LocalThreadStoreCompression` is enabled in the effective startup configuration.

GitOrigin-RevId: c087d36b4e578245aee6cfe5257075dfd3bdd025
2026-09-01 12:41:37 +00:00
jif
2e5ee418ad Improve Guardian report diagnostics (#42033)
## Why

Reports from a large thread tree can exceed the rollout attachment limit, making
the threads involved in a failed Guardian review harder to diagnose.

## What changed

- Prioritize descendants with retained failed reviews when selecting bounded
  report rollouts, while always preserving the reported thread.
- Include each selected thread's available Guardian trunk rollout alongside its
  conversation rollout.
- Add a thread index attachment with selected filenames, bounded omission details,
  retained failure threads, and the process-wide discarded-record count.
- Link failed-review records to their reviewed turn and target item when available.

## Testing

- Cover failed-review prioritization, bounded omission metadata, discarded-record
  accounting, and turn/item linkage in Guardian report records.

GitOrigin-RevId: ae7916c27a3c279e899cd5a6ead8a4b7e0cc26a1
2026-09-01 11:14:20 +00:00
Matthew Zeng
bfa9646787 Add plugin reconciliation app-server API (#41949)
## What changed

- Add the `plugin/reconcile` JSON-RPC method to synchronize installed remote plugin bundles and wait for required hook updates.
- Return affected plugin IDs with MCP, Apps, hooks, and skills refresh hints, plus remote update and materialization failures.
- Refresh loaded hook runtimes after relevant updates and return an empty result when plugins or backend authentication are unavailable.

## Testing

- Cover workspace and global bundle installs, unchanged passes, enablement changes, updates, removals, materialization failures, hook refreshes, and disabled plugins.

GitOrigin-RevId: 45c02518d71990d13eb09d56ed51505c91c66956
2026-09-01 00:50:11 +00:00
xli-oai
e39ab0c185 Emit turn cost telemetry for ChatGPT sessions (#41944)
## What changed

- Query workspace-visible turn estimates for ChatGPT-authenticated sessions through the appropriate Codex or ChatGPT endpoint.
- Track completed response IDs and emit `codex.turn.cost_microusd` only when the estimate is nonnegative, visible, and covers every observed response.
- Keep error response bodies out of turn-cost worker logs.

## Testing

- Cover both endpoint styles, nullable estimates, settlement validation, exact micro-USD conversion, and response-ID tracking.
- Add an app-server integration test that verifies a settled ChatGPT turn reaches the OTLP metrics exporter with its turn, conversation, and auth-mode attributes.

GitOrigin-RevId: 6ae3f8df729fad52984a0c6efafd8c96c7214e55
2026-09-01 00:30:55 +00:00
jif
13d75cd1c3 Attach failed Guardian reviews to diagnostic reports (#41936)
## What changed

- Retain bounded, process-local records for failed Guardian reviews, including the reviewed action, decision, status, model, instructions, and reviewer history.
- Add recent records from the reported thread and its descendants to log-enabled report uploads as `auto-review-failures.jsonl`.
- Preserve the action and decision while omitting oversized reviewer context, and exclude successful, ephemeral, and capture-disabled reviews.

## Testing

- Cover denied and invalid decisions, cleaned-up ephemeral reviewers, descendant-thread selection, record count and byte limits, and oversized-context fallback.

GitOrigin-RevId: 5f12f7605041c3c84e826e6bac1cf06b1518ab24
2026-08-31 23:44:41 +00:00
guinness-oai
64c9cde458 Record realtime conversation history in Core (#41924)
## Why

Realtime history should be recorded consistently for every Core host, including
when no app-server event listener is attached.

## What changed

- Move transcript segmentation, session boundaries, and backing-agent artifact
  promotion into Core for paginated threads.
- Persist canonical realtime items through the thread store in event order and
  emit dedicated history lifecycle events for hosts to present.
- Translate those Core events into the existing app-server realtime item
  notifications without app-server persisting the items a second time.

## Testing

- Cover Core-only persistence across repeated sessions, ephemeral sessions,
  accepted and rejected steering, typed input ordering, and artifact promotion.
- Verify app-server notifications correspond to the persisted timeline.

GitOrigin-RevId: 7cbef14129d77f6d6d7099b733be91f5279c55f5
2026-08-31 22:38:23 +00:00
Zahan Malkani
34c4f7e72d Allow per-call sideband endpoints for existing realtime calls (#41923)
## What changed

- Add an in-process `sideband_base_url` override to `ConversationStartTransport::ExistingCall`, while keeping app-server requests on the configured or default endpoint.
- Prefer the per-call endpoint when attaching and reconnecting a sideband, falling back to `experimental_realtime_ws_base_url` when no override is supplied.
- Preserve runtime authentication headers on the selected endpoint without adding bearer authorization.

## Testing

- Cover configured and per-call endpoint selection, authentication headers, call-specific handshake paths, and reconnect behavior.

GitOrigin-RevId: 16c439fe0a9ff8bcdda4ec615bb9983e30935052
2026-08-31 22:29:40 +00:00
Owen Lin
5f79a92e39 Persist response token usage in rollout history (#41912)
## Why

Resumed threads need to continue per-turn and per-thread token totals without scanning arbitrarily far beyond the latest compaction checkpoint.

## What changed

- Add durable `TokenUsageRecord` rollout items with response, turn, thread, session, and root-turn attribution.
- Restore accumulated usage on resume and snapshot the latest record plus the compaction response ID in compaction checkpoints.
- Preserve root-turn lineage in persisted turn context, while ensuring forked child threads start with their own usage totals.

## Testing

- Cover usage accumulation across multiple responses and resumed turns.
- Cover local and remote compaction checkpoints, invalid remote compaction output, rollout reconstruction, and fork isolation.

GitOrigin-RevId: ef9e0c4a9102a08a2c382be4cdac68c84353c90a
2026-08-31 21:15:38 +00:00
stefanstokic-oai
79b04f1ab5 Show actionable rate-limit banners in the TUI (#41742)
## What changed

- Carry optional backend-owned banner and account identity data through
  `account/rateLimits/read`, filtering banners that do not match the authenticated
  account and user.
- Render supported rate-limit notices above the composer with actions for usage,
  credits, resets, owner notifications, and plan management while preserving the
  existing fallback UI for absent or unsupported banners.
- Refresh usage after limit errors, reject stale responses, and keep queued input
  paused until recovery completes. When instructed by the banner, switch to the
  first available fallback model without changing unrelated thread settings.

## Testing

- Add protocol, banner parsing and rendering, CTA, identity filtering, refresh
  ordering, fallback-model, account-change, and queued-input recovery coverage.

GitOrigin-RevId: e03d75a82e425deb87f4b120a71cf2286c0ef6cc
2026-08-31 00:20:06 +00:00
chess
aaa7ed042e Harden diagnostic report uploads (#41569)
## What changed

- Send the core report event before its attachments, then upload each attachment in a separate gzip-compressed envelope linked to that event.
- Bound encoded and decoded payload sizes, truncate oversized attachment copies with format-aware handling for JSONL, and preserve attachment priority when applying size limits.
- Retry transient attachment failures within a shared upload-time budget while honoring Sentry rate-limit and retry headers without replaying the core event.
- Add APIs to prepare and send persisted report events and attachments using a stable report ID, explicit delivery outcomes, and caller-controlled retries.

## Testing

- Cover attachment retries, truncation, rate limits, rejected responses, transport failures, redirect handling, content types, diagnostic consent, and report tags.

GitOrigin-RevId: 5eacd384843795d05d1c024b76e1c6d0c1c4b8d7
2026-08-29 20:26:42 +00:00
rhan-oai
f5636bb733 Restore thread cwd from owned settings snapshots (#41567)
## Why

Resuming a thread without an explicit `cwd` should restore that thread's latest
retained setting. Forked history can contain settings copied from another
thread, while compaction can move the latest setting outside the replay window.

## What changed

- Record the owning thread ID on new settings snapshots and only use snapshots
  owned by the resumed thread when restoring `cwd`. Older snapshots without an
  owner remain readable but do not override the startup `cwd`.
- Checkpoint the current settings after compaction and serialize checkpoints
  with settings updates so the retained history contains an accepted, current
  snapshot.
- Cover resume behavior across compaction, forks, reverts, legacy histories,
  and concurrent settings updates.

GitOrigin-RevId: 1efc9cf55472d6b88c465c4efe44672a232dbf64
2026-08-29 19:57:06 +00:00
Krish Chainani
2008d27e98 Filter media from function call output notifications (#41427)
## What changed

Strip inline image and audio content from function call output thread items when
filtering app-server notifications. Preserve text and encrypted content, and
leave text-only function call outputs unchanged.

GitOrigin-RevId: ca3ad70e843aafbed49c693aa8963bea86cf95dc
2026-08-28 22:09:28 +00:00