Commit Graph

8456 Commits

Author SHA1 Message Date
jif
681c82f497 Move shell snapshot scripts into codex-shell-command (#39281)
## What changed

- Add a public `snapshot_script` helper to `codex-shell-command` for Bash,
  Zsh, POSIX shell, and PowerShell, returning `None` for Command Prompt.
- Update `codex-core` and its shell snapshot tests to use the shared helper
  without changing snapshot behavior.

GitOrigin-RevId: 779b9dc964635b717922ea9f5646b94c4dbb0da1
2026-08-18 21:11:30 +00:00
iceweasel-oai
88c39c4578 Propagate Windows sandbox ACL update failures (#39279)
## Why

Windows sandbox preflight could report success when applying a deny ACE failed,
leaving a detected world-writable path without the intended capability
restriction.

## What changed

- Return errors from `SetEntriesInAclW` and `SetNamedSecurityInfoW`, including the
  affected path in ACL API errors.
- Attempt every flagged path, aggregate deny-ACE failures, and fail preflight
  after logging them.
- Preserve cleanup of security descriptors and newly allocated ACLs on failure.

## Testing

Added tests that verify ACL API failures are returned and that preflight keeps
processing remaining paths before propagating an error.

GitOrigin-RevId: e2be1c70f72840046dc55760364de7bcf3b1bdc9
2026-08-18 20:56:10 +00:00
sayan-oai
392328ed5d Preserve owner-provided environment configuration (#39278)
## Why

Thread settings could replace an owner-provided environment configuration with
`FromThread`, allowing the thread to take ownership of that configuration.

## What changed

Reject environment settings updates that change an existing owner-provided
configuration to `FromThread`.

## Testing

Cover preview and turn settings updates for pending, ready, and failed
owner-provided environments.

GitOrigin-RevId: c516954819447ceb29e2ff9f29fe781ca101ae54
2026-08-18 20:49:36 +00:00
alexsong-oai
884a193b78 Declare experimental Amazon Bedrock setup APIs (#39277)
## What changed

- Add experimental `account/bedrock/discover` and `account/bedrock/setup`
  requests to the app-server protocol.
- Define discovery results for AWS profiles and environment credentials, plus
  setup inputs for profiles, environment credentials, and access keys.
- Export the new types in the experimental protocol schema. The app server
  currently returns `method not found` for both requests because setup is not
  yet implemented.

GitOrigin-RevId: 656b4bc11231a417e97041068cecc5dc692786e3
2026-08-18 20:44:19 +00:00
alexsong-oai
22b860e80b Add provider-owned authentication recovery (#39274)
## What changed

- Let model providers identify recoverable authentication errors and refresh their own authentication state before falling back to `AuthManager` recovery.
- Apply provider recovery to both HTTP and WebSocket response requests, with at most one provider-owned recovery attempt per request.
- Preserve existing `401 Unauthorized` handling as the default for providers that do not customize recovery.

## Testing

- Add coverage for successful and failed provider recovery, including the single-attempt bound and preservation of the original unauthorized error.

GitOrigin-RevId: 9a737e3be96354699586f97dd88e544a45082969
2026-08-18 20:14:17 +00:00
Owen Lin
f950a1ba0b Preserve thread names during rollout migration (#39273)
## Why

Legacy threads and paginated threads read their displayed names from different metadata. Moving a rollout to paginated history must carry over its legacy-visible name so renamed threads do not lose it.

## What changed

- Load legacy indexed names once for an apply run.
- When promoting a thread, preserve an existing canonical name or copy its distinct legacy title, falling back to the legacy name index.
- Repair missing names when migration encounters an already-paginated rollout.

## Testing

Added migration tests covering preservation from both legacy name sources and repair on a rerun.

GitOrigin-RevId: 5fc526570b1cf358a159ef174c159ac091ccc40f
2026-08-18 20:07:26 +00:00
olliem-oai
4a3e829c56 Inject Node REPL policy into Guardian review sessions (#39267)
## What changed

- Add a dedicated developer policy for Guardian reviews of Node REPL browser and computer-use actions.
- Inject the policy once before the first eligible Node REPL approval and retain it when the reviewer session is reused.
- Include Node REPL policy eligibility in the reviewer reuse key so sessions are not reused across incompatible model settings.
- Keep the approval request itself on the generic planned-action format.

## Testing

- Cover first-action injection, reuse after a shell review, repeated Node REPL reviews, and ineligible parent models through the production approval path.

GitOrigin-RevId: bfce190ff8599788aa85e388cc6a959d27fb489c
2026-08-18 19:22:31 +00:00
Dylan Hurd
d68b85a097 Require fresh approval beneath denied permission paths (#39266)
## Why

A stored permission grant may allow access to a parent while explicitly denying
a child path. A later request for that child must not be treated as already
approved by the broader parent grant.

## What changed

- Compare materialized permission profiles without intersecting away denied or
  reopened paths before deciding that a request is preapproved.
- Execute preapproved commands with the stored grant itself so its denied paths
  remain enforced.
- Fail closed when permission profiles cannot be materialized.

## Testing

Added unit and integration coverage for turn and session grants across
`exec_command`, `shell_command`, and `apply_patch`, including approval-disabled
and `Never` approval modes.

GitOrigin-RevId: 5455880328a89c7958f859c7ce87805dff9704fb
2026-08-18 19:17:09 +00:00
olliem-oai
846a16852f Improve Guardian v2 risk classification (#39264)
## What changed

- Replace the minimal default classifier prompt with predictive security-review guidance covering authorization, action risk, untrusted evidence, and browser or computer use.
- Trigger full Guardian review at an `action_risk` score of `0.5` or higher for the new default prompt, while retaining the `0.8` calibration for custom and model-provided prompts unless they specify a threshold.
- Render security policy configuration into prompt templates before enforcing the classifier instruction token limit. Prompts without the policy placeholder retain the existing append-and-truncate behavior.

## Testing

- Cover default, custom, and model-provided prompt thresholds and precedence.
- Verify policy substitution, truncation, sampling requests, and full review at the threshold boundary.

GitOrigin-RevId: 7aad9e2d8c9fbea453dc52147a3d0a46bf191aec
2026-08-18 19:12:30 +00:00
iceweasel-oai
726ec7ecbf Prevent ConPTY DLL loading from the current directory (#39262)
## Why

The Windows PTY implementation probed `conpty.dll` by bare name. Windows could
resolve that lookup to a DLL in the process current directory and load it when
creating a pseudoconsole.

## What changed

Resolve the ConPTY entry points from `kernel32.dll` without probing
`conpty.dll`.

## Testing

Add a Windows regression test that places a compatible `conpty.dll` in the
current directory, creates a ConPTY, and verifies that the DLL was not loaded.

GitOrigin-RevId: be78974362a99dce0c18186cf3e7bbd86a8de73c
2026-08-18 19:09:33 +00:00
Eric Traut
785ecd7452 Stop TUI chats on misalignment policy violations (#39261)
## Why

When the app server reports a misalignment policy violation, the TUI must stop the affected chat rather than allow more work to continue in it.

## What changed

- Finalize the active turn, clear queued and draft input, disable the composer, and reject further operations and interactive requests for the stopped chat.
- Interrupt an active side conversation when its parent reports the violation, and prevent queued turns, forks, approvals, or goal resumption from restarting work.
- Show a non-dismissible precaution view that directs users to start a new chat or resume another one, with agent command center navigation for remote sessions.

## Testing

Added coverage for stopped-chat behavior, parent/side-thread handling, blocked goal resumption, navigation actions, and narrow and remote-session rendering.

GitOrigin-RevId: 0268c46a19294a17765ea4099f389f15ffaaf030
2026-08-18 18:50:58 +00:00
Tamir Duberstein
3006151ad4 Simplify unified exec output snapshots (#39259)
## What changed

- Return retained unified-exec output as one contiguous byte buffer.
- Use the buffer directly for sandbox-denial checks, removing intermediate
  chunk aggregation and an unnecessary owned string conversion.
- Update the output-retention test to assert the flattened snapshot.

GitOrigin-RevId: 84eacee0166b86d3cb2d6a37e96125977fad0267
2026-08-18 18:46:44 +00:00
Peter Bakkum
ecb8013dfa Reconnect WebRTC Realtime sideband transports (#39257)
## What changed

- Reconnect frameless bidirectional WebRTC sideband sockets after unexpected transport loss with capped exponential backoff.
- Preserve pending text or handoff output and bounded transcript state across reconnects.
- Treat `404 Not Found` and `410 Gone` handshake responses as terminal session completion, and preserve HTTP status information from failed WebSocket handshakes.
- Bound Realtime delegation input and transcript fields while retaining the most relevant portion of each.

## Testing

- Add unit coverage for reconnect backoff, terminal status handling, transport error classification, transcript continuity and truncation, and pending outbound messages.
- Add an end-to-end WebRTC conversation test covering an unclean disconnect, reconnect, transcript reconciliation, outbound progress during sustained inbound traffic, and terminal session completion.

GitOrigin-RevId: 544fd7e542c3434d0bb42cfbcc7143604419a037
2026-08-18 18:41:40 +00:00
Jeremy Rose
fa9a05f2d2 Deduplicate rollout moves when archiving threads (#39256)
## Why

SQLite metadata can identify a rollout through a non-canonical path. When that
path resolves to a rollout already found on disk, archive and unarchive
operations could schedule the same source file to be moved twice.

## What changed

- Deduplicate archive and unarchive moves by canonical source path.
- Cover both operations with metadata-backed tests that use equivalent rollout
  paths.

GitOrigin-RevId: d190915264214413667fc2c83d360a7e8504d0aa
2026-08-18 18:38:12 +00:00
pakrym-oai
77e6889601 Add exec-server forwarding mode (#39249)
## What changed

- Add `codex exec-server forward --connect ws://HOST:PORT` to register an
  existing WebSocket exec-server as a remote environment.
- Open a separate destination WebSocket for each authenticated Noise relay
  stream and forward complete payloads unchanged in both directions.
- Preserve large messages through WebSocket fragmentation and coordinate
  disconnects, close acknowledgements, and pending output delivery.

## Testing

- Cover CLI validation, opaque payload forwarding, disconnect handling, and
  destination close behavior.
- Verify commands and large file transfers through the complete relay and
  forwarding path.

GitOrigin-RevId: 6e2dccff05b9e3571865611f4d432b0e2b4cdbac
2026-08-18 18:15:21 +00:00
Dylan Hurd
8193c56a59 Give Guardian classifier connections distinct thread identities (#39246)
## Why

Guardian sampling uses a pool of WebSockets, while the bridge routes each
connection by thread ID. Each socket therefore needs its own identity instead
of reusing the source thread ID across the pool.

## What changed

- Generate a classifier thread ID for every pooled connection and use it for
  request, window, and subagent attribution.
- Preserve the originating thread ID in turn metadata alongside the Guardian
  classifier request kind.
- Build request metadata after leasing a connection so retries use the identity
  of the socket that carries the request.

## Testing

- Cover unique identities across pooled and replacement connections.
- Verify classifier attribution metadata for extension requests and retries.

GitOrigin-RevId: 1c36207125157ff05cab9487a2fa37bf85e5fdd8
2026-08-18 18:08:17 +00:00
victor-openai
a1dc95d5af Scope MCP resource reads by connector (#39244)
## What changed

- Add an optional `connectorId` to `mcpServer/resource/read`.
- Forward the selected connector through `x-codex-turn-metadata` for threaded and threadless resource reads, restricting hosted app resources to that connector.
- Update the generated protocol schemas and app-server documentation.

GitOrigin-RevId: 5cc94d703abbbb6086665910c1c9ed5dc7075210
2026-08-18 18:01:39 +00:00
jif
19d185fec8 Add safe permission profile intersection (#39242)
## What changed

- Add `intersect_effective_permission_profiles` to derive the permissions shared by an authority profile and a requested profile.
- Preserve the more restrictive filesystem access, read denials, protected metadata paths, temporary-directory access, and network policy.
- Canonicalize concrete paths so symlinks cannot expand authority, and fail closed for policy shapes that cannot be intersected safely.

## Testing

Add coverage for workspace intersections, nested carveouts, deny patterns, unsupported policies, temporary-directory restrictions, symlink escapes, and macOS path aliases.

GitOrigin-RevId: a35bdc47e41afad13630f92c032514b300c14a0d
2026-08-18 17:53:36 +00:00
felixxia-oai
e683c3118b Record Guardian v2 classification metrics (#39241)
## What changed

- Emit a `codex.guardian_v2.classification` counter for each classification.
- Record classification latency in `codex.guardian_v2.classification.duration_ms`.
- Tag both metrics with `success`, `failure`, or `superseded` outcomes.

## Testing

- Verify metrics for successful classification and fail-closed handling.

GitOrigin-RevId: 021702f3b26565d6da5708d2b8f1f8881942a441
2026-08-18 17:48:35 +00:00
Matthew Zeng
a998c7a1ce Deduplicate remote plugin bundle syncs with shared semaphores (#39240)
## What changed

- Give plugin managers for the same cache root a shared semaphore that permits
  only one background installed-plugin bundle sync at a time.
- Hold the permit for the lifetime of the spawned sync task and refresh the
  installed-plugin cache after a successful local cache change.

## Testing

- Add a test that starts bundle syncs from two plugin managers sharing a Codex
  home and verifies that only one request is made.

GitOrigin-RevId: 86c39476c3a9015b9862ab75e8f11f110b0284fc
2026-08-18 17:42:48 +00:00
pakrym-oai
3df5087f75 Decouple Noise relay streams from JSON-RPC processing (#39235)
## What changed

- Add a `NoiseStreamHandler` abstraction that owns payload encoding, decoding,
  and connection processing while the virtual stream handles framing,
  encryption, and multiplexing.
- Reassemble authenticated payloads as opaque bytes, with the existing
  JSON-RPC processor supplied as a handler implementation.
- Have the physical relay send a reset after the current stream instance
  closes, including when its processor exits before the writer task.

## Testing

- Verify local JSON-RPC decoding creates the queued request span before queue
  admission.
- Verify a processor exit resets the corresponding Noise harness stream.

GitOrigin-RevId: 270befcc8bfbf27e46c84d6a2c6e349cb98ea3f8
2026-08-18 17:18:50 +00:00
jif
9b9b614b02 Include node_repl screenshots in Guardian v2 reviews (#39227)
## Why

`node_repl` screenshots are nested tool results and do not appear in the parent
conversation history, so Guardian v2 transcript image collection could miss
them.

## What changed

- Allow Guardian v2 to enable bounded, thread-scoped `node_repl` image capture
  when transcript images are configured.
- Add retained `node_repl` screenshots to review requests when transcript
  sources include tool outputs, while deduplicating images and keeping them out
  of the parent turn input.

## Testing

- Add an integration test covering screenshot capture without the synchronous
  Guardian transcript feature flags and verifying that screenshots stay out of
  the parent request.

GitOrigin-RevId: 5f70c5f2e80389aa8b2a286c3b7f9b1104865486
2026-08-18 16:38:52 +00:00
Dylan Hurd
e7e13c68e2 Add Guardian v2 approval review metrics (#39224)
## What changed

- Pass metrics bound to the active turn's model to approval-review contributors.
- Add counter support to `ExtensionMetrics` while preserving host session attribution.
- Record Guardian v2 tool-call score lag and count stale-score fallbacks with the `score_lag` reason.

## Testing

- Cover counter forwarding and session metadata tags.
- Verify Guardian v2 metric samples for current and stale scores.

GitOrigin-RevId: 0ec34736d29d2e37ed217a27e773b4f6230ae38a
2026-08-18 16:27:54 +00:00
jif
2a30972fcb Skip redirected external-agent migration destinations (#39221)
## Why

Repository-scoped imports must not follow redirected Codex paths and write
generated configuration outside the repository.

## What changed

- Reject repository migration scopes when generated configuration paths are
  symlinks or, on Windows, reparse points.
- Recheck hook and subagent destinations during import, skipping redirected
  directories, files, and dangling links without reporting them as imported.

## Testing

Add service and app-server coverage for redirected generated destinations,
including a repository path replaced with a symlink after detection.

GitOrigin-RevId: 3afb521ead9d76250f0e967eccfdd1dc194f027a
2026-08-18 16:05:51 +00:00
Dylan Hurd
76ceaddb29 Reconnect Guardian sampling WebSockets after auth changes (#39220)
## Why

Guardian sampling WebSockets authenticate when the connection is opened. Reusing
a pooled connection after credentials change can therefore keep using the old
authorization.

## What changed

- Track authentication changes on each pooled sampling connection.
- Discard stale connections after an auth change and reject connections whose
  authentication changes while the handshake is in progress.

## Testing

- Verify the sampler reconnects with the refreshed bearer token instead of
  reusing its existing connection.
- Verify the installed Guardian extension reconnects after an external auth
  refresh.

GitOrigin-RevId: 6d2e7df776fd21c78be0928f71162f5419a8b8f0
2026-08-18 16:00:39 +00:00
viyatb-oai
e13c1d569d Prevent custom providers from inheriting ambient auth (#39214)
## Why

Custom model providers that do not require OpenAI authentication could inherit
ambient authentication headers, including the bearer token and
`ChatGPT-Account-ID`, and send them to the custom provider endpoint.

## What changed

- Resolve providers without `requires_openai_auth` or configured `auth` as
  unauthenticated.
- Continue to honor an explicit `experimental_bearer_token` or command-resolved
  provider authentication.
- Preserve ambient authentication for OpenAI providers.

## Testing

Added unit and request-level coverage for custom, explicitly authenticated, and
OpenAI provider authentication behavior.

GitOrigin-RevId: d89a79604338bc660a3edb2af0068cfa9b694fa2
2026-08-18 15:06:09 +00:00
iceweasel-oai
bb701f1e8c Add a fail-closed Tree-sitter PowerShell lowerer (#39213)
## What changed

- Add a Tree-sitter-based lowerer that converts a conservative subset of literal PowerShell commands into argument vectors.
- Reject dynamic expressions, parse recovery, unsupported value conversions, directives, and source outside recognized command nodes instead of guessing their meaning.
- Keep the lowerer alongside the existing production parser for later adoption.

## Testing

- Add fixture-driven coverage for supported literal commands and unsupported or ambiguous syntax, including a dedicated `#requires` rejection test.

GitOrigin-RevId: a6e7acc264ca40df264db4b271e38ae7d89e1ec4
2026-08-18 14:59:43 +00:00
jif
a04940cb12 Reject symbolic links in memory workspaces (#39205)
## What changed

- Reject a symbolic link used as the memory root.
- Recursively remove symbolic links before preparing or seeding the memory workspace.
- Remove and reject symbolic links created during consolidation, including when the worker fails, so they cannot affect files outside the workspace.

## Testing

Add Unix startup tests covering pre-existing extension links and links created by both successful and failed consolidation workers.

GitOrigin-RevId: f96e03812773f7beaa16455dd77370ee47d8a71f
2026-08-18 14:14:57 +00:00
jif
b5ea64a203 Add a symlink-safe reader for sensitive files (#39200)
## What changed

- Export `read_sensitive_file_to_string` from `codex-exec-server`.
- Require the opened path to be a regular disk file and avoid following its
  final symlink component on Unix or reparse point on Windows.
- Read valid UTF-8 file contents asynchronously and return I/O errors for
  unsupported inputs.

## Testing

Add tests covering regular files, directories, and symlinks.

GitOrigin-RevId: 68809e94c0d3719e5685c064f9610a0455ffd8d7
2026-08-18 13:36:16 +00:00
jif
a397079287 Preserve MCP resource origins across compaction (#39192)
## Why

Compaction can remove the tool-call events that associate an MCP app widget with
the tool, account, and URI needed to authorize later resource reads.

## What changed

- Store a bounded MCP resource-origin checkpoint with each compacted rollout.
- Restore the checkpoint when resuming a session so existing widgets remain
  readable after compaction and restart.
- Discard saved origins when rollback rewrites history across the compaction
  boundary, and reject oversized or invalid checkpoints during restoration.

## Testing

- Extend the app-server MCP resource-origin test to compact a paginated thread,
  continue the conversation, and read the original widgets before and after a
  restart.
- Verify rollback clears provenance that no longer matches retained history.

GitOrigin-RevId: 7f91c6202fe8d9be21c78dda42fa205937c44263
2026-08-18 12:37:41 +00:00
jif
880f1135ea Scope MCP app resource reads to their originating call (#39187)
## Why

App widgets need to read resources using the app and account context of the
tool call that produced them, including after a thread is restored.

## What changed

- Add an optional `originCallId` to `mcpServer/resource/read` requests and
  return it on successful scoped reads.
- Track bounded provenance for successful app tool calls in thread history and
  use the current tool binding, account link, and app policy when reading the
  associated widget resource.
- Reject missing, mismatched, failed, or ambiguous origins, while keeping
  app-only tools available for widget reads without exposing them to the model.

## Testing

Add app-server coverage for scoped widget reads across both history modes,
ephemeral and persistent threads, server restarts, app-only visibility, and
invalid origin cases.

GitOrigin-RevId: 11eaefc066b2a3b639599e4cbdef680233d150a2
2026-08-18 11:51:21 +00:00
jif
711a5f8b3a Drop descendant progress updates after remote compaction (#39176)
## What changed

- Exclude descendant-authored `MESSAGE` progress updates from the history retained after remote compaction v2.
- Continue retaining descendant-authored tasks while omitting progress updates and final answers from subsequent requests.

## Testing

- Extend the remote compaction follow-up test to cover descendant progress updates and descendant-authored tasks.

GitOrigin-RevId: 3e3e60bb108d27e99e2a4c222eed4b9d02fd3829
2026-08-18 09:38:27 +00:00
jif
63b268c81b Skip empty user messages for automatic idle turns (#39174)
## What changed

Start sampling for automatic idle `UserInput` requests without adding an empty
message to the input queue. Continue queuing automatic response-item input.

GitOrigin-RevId: 5d304aed9e7e165380b29b5b59d9245e97b40659
2026-08-18 09:25:02 +00:00
Eric Traut
0acf302db5 Prevent marketplace identity spoofing (#39165)
## Why

Repository manifests and user-configured sources must not be able to claim names reserved for managed or remote marketplaces.

## What changed

- Reject reserved marketplace names from unmanaged sources during discovery, installation, configuration projection, and configured marketplace upgrades, even when source restrictions are disabled.
- Recognize managed marketplaces only at their expected paths. Preserve the required macOS and Windows path equivalences without allowing symlink aliases to inherit managed provenance.

## Testing

- Cover reserved-name rejection for plugin list and install RPCs, configured upgrades, unrestricted policy, and remote marketplace names.
- Cover symlink spoofing and Windows managed-path normalization.

GitOrigin-RevId: a610bdc382857f306dd3e244f0992de2ec279673
2026-08-18 07:56:41 +00:00
rhan-oai
e2eea07140 Refresh collaboration instructions when their content changes (#39163)
## Why

Collaboration guidance can change without changing the active mode or model, such as after a model catalog refresh. Tracking only the mode and model leaves the earlier guidance in retained history.

## What changed

- Include a hash of the rendered collaboration instructions in the world-state snapshot so changed guidance is appended to retained history once.
- Emit one empty collaboration fragment when guidance is removed, preventing stale instructions from remaining active without repeatedly clearing them.
- Refresh legacy snapshots that lack an instruction hash once on resume.

## Testing

Cover same-mode catalog updates, clearing missing or explicitly empty guidance, retained-history behavior, and cold resume from legacy snapshots.

GitOrigin-RevId: 69f690adeccd1fb9794a6b15647e6efae3fec4f6
2026-08-18 07:32:03 +00:00
Dylan Hurd
4216123b3d Require approval for commands with dynamic shell words (#39159)
## Why

Tree-sitter can represent brace expansions, globs, and escaped text as plain
words even though the shell changes them at runtime. Treating their source text
as literal argv could let a command match a safe-command check or allow rule
that does not match what will actually execute.

## What changed

- Reject unquoted Bash and Zsh words containing expansion, glob, or escape
  syntax from literal command parsing, including heredoc command prefixes.
- Reject double-quoted escape sequences that the shell removes or interprets,
  while continuing to accept quoted metacharacters that remain literal.
- Require approval for affected commands under `UnlessTrusted`, even when a
  policy contains an allow rule for the unexpanded source text.

## Testing

Add parser and approval scenarios covering brace expansion, globs, escapes,
Zsh-specific syntax, heredocs, and quoted literals.

GitOrigin-RevId: 31f2c6062680c42ac65362e3f3eebfaaf4eb71da
2026-08-18 07:26:21 +00:00
Shijie Rao
f5e9d66851 Notify clients when Guardian requires strict review (#39157)
## What changed

- Add the experimental `autoApprovalReview/strictReviewRequired` app-server notification with the review's `threadId`, `turnId`, and `startedAtMs`.
- Emit it when Guardian v2 leaves an approval review in progress because the action risk is elevated or its score is stale.
- Export the notification through the Rust, TypeScript, and JSON schema surfaces and route it to the associated thread.

## Testing

- Cover strict-review reason tracking for elevated and stale risk scores.
- Verify that high-risk approval routing emits one notification whose identifiers and timestamp match the review-started event.

GitOrigin-RevId: e65352894520bfb756c75b2c95e2e149f9767bb2
2026-08-18 06:48:12 +00:00
Eric Traut
3d47dc40be Box the TUI future to bound CLI stack usage (#39154)
## Why

The TUI startup future is large enough to inflate the CLI dispatcher's stack
frame.

## What changed

- Heap-pin the TUI startup future before awaiting it.
- Add a regression test that keeps the `run_interactive_tui` future below 64
  KiB.

GitOrigin-RevId: 1f977928117537a5188c4d801517fb4a42e39e15
2026-08-18 06:25:56 +00:00
Shijie Rao
539a09cb28 Restore permission profiles when resuming threads (#39153)
## Why

Cold resumes and forks could lose the thread's active permission profile and
fall back to the current configured default.

## What changed

- Restore the latest persisted approval policy, approvals reviewer, and active
  permission-profile ID when resuming or forking a thread.
- Re-resolve persisted profile IDs through current configuration and
  requirements. Missing or invalid profiles fall back to the configured
  default, while threads without a persisted profile continue to use current
  configuration.
- Keep explicit permission and approval overrides ahead of persisted settings.

## Testing

Added coverage for legacy and paginated histories, settings updates, explicit
overrides, removed or changed profiles, requirement fallbacks, and forks.

GitOrigin-RevId: 2289af2f3206bf131a6ffe0e8447e8d402e76c47
2026-08-18 06:22:04 +00:00
Shijie Rao
bc7a487039 Centralize persisted resume settings lookup (#39147)
## What changed

- Add a shared helper for recovering the latest persisted approvals reviewer from turn context and thread settings history.
- Use the helper when resuming and forking threads while continuing to honor explicit request overrides.
- Fall back to an older persisted reviewer when the latest turn context omits the field.

## Testing

- Add unit coverage for settings snapshot precedence, turn context precedence, and fallback to an older reviewer.

GitOrigin-RevId: dfc0332b0f1410a4c9a550236eb32624f5133baa
2026-08-18 06:00:00 +00:00
Shijie Rao
230791fd1f Persist active permission profiles in turn context (#39145)
## What changed

- Add the optional `active_permission_profile` field to `TurnContextItem` to record the built-in or named profile that produced the effective permission profile.
- Populate the field when serializing a turn context while preserving compatibility with records where it is absent.

## Testing

- Add coverage verifying that turn-context serialization stores the active permission profile.

GitOrigin-RevId: d69142ab1b26595ab406235f89818ef41370e963
2026-08-18 05:46:08 +00:00
Matthew Zeng
de7bbb0481 Hydrate recommended plugin metadata on selection (#39143)
## What changed

- Fetch recommendations from the Codex-specific `/ps/plugins/suggested/codex` endpoint and parse its compact response shape.
- Fetch the selected plugin's details before presenting an install request, using them to verify availability and populate connector metadata.
- Skip install elicitation when the selected recommendation is no longer available, and return a retryable response when its metadata cannot be verified.

## Testing

- Cover the new recommendation route and response shape.
- Cover metadata hydration for available plugins and rejection of unavailable plugins.

GitOrigin-RevId: 2b0e2d70572aae2b7cd8e458b42e9dd14be3dbaf
2026-08-18 05:42:39 +00:00
Eric Traut
f47f77ada6 Add configurable shortcuts for the agents dashboard (#39142)
## What changed

- Add `tui.keymap.global.open_agents`, defaulting to `alt-a`, to open the shared agents overview.
- Add an `agents` keymap context for search, new task, rename, stop, and grouping actions.
- Expose the new actions in the keymap picker and render dashboard hints from the resolved bindings.
- Preserve existing custom `alt-a` bindings by disabling the new default when it would conflict.

## Testing

- Cover remapping, reserved keys, conflicts, and compatibility with existing bindings.
- Verify that configured dashboard shortcuts act on the selected filtered task.

GitOrigin-RevId: 98c48a332e06cb96dbf0e59647ce7959d45b9988
2026-08-18 05:30:11 +00:00
Adam Perry @ OpenAI
9a254ba1fa Redact auth tokens from app-server response logs (#39141)
## Why

App-server response diagnostics can include access tokens returned by the ChatGPT auth refresh flow.

## What changed

- Log successfully parsed server responses instead of raw JSON-RPC response payloads.
- Redact `access_token` from the `Debug` representation of `ChatgptAuthTokensRefreshResponse`.
- Avoid formatting callback send errors that can retain the original response payload.

GitOrigin-RevId: fd47485b38ed89527b25937c759b3273581f6ae6
2026-08-18 05:25:22 +00:00
xl-openai
5ee6baee2f Validate identifiers in plugin creator workflows (#39131)
## Why

Plugin and marketplace names can flow into generated install commands, so the
plugin creator must reject names outside the supported identifier syntax before
using them or changing files.

## What changed

- Centralize validation for plugin names, including dotted names, and marketplace
  names.
- Apply validation when reading marketplaces, validating manifests, updating
  cachebusters, and scaffolding plugins.
- Validate existing marketplace state before scaffold writes so invalid or
  duplicate entries leave plugin and marketplace files unchanged.

## Testing

Add regression tests for accepted identifiers, unsafe and malformed names,
dotted plugin names, and failure paths that must not modify files.

GitOrigin-RevId: 9db68c2313a1539c5ab44d777966e33b460ceb71
2026-08-18 03:31:06 +00:00
Charlie Marsh
f97e775693 Fail closed on deeply nested command wrappers (#39122)
## Why

Dangerous-command inspection has a bounded wrapper depth. Returning no match
after that limit could let a nested dangerous payload escape policy detection.

## What changed

- Classify commands beyond the wrapper-depth limit as dangerous.
- Cover the boundary and overflow cases in the command-safety unit tests.
- Verify that exec policy rejects a deeply `env`-wrapped forced `rm` before it
  can delete a sentinel file when approvals are disabled.

GitOrigin-RevId: a6cdbbb7bdc6274a62745f668189fabaaf46745f
2026-08-18 02:23:57 +00:00
Eric Traut
ede5247893 Reject lossy legacy permission projections (#39117)
## Why

Some managed filesystem permission profiles cannot be represented by the
legacy app-server sandbox policy without changing which paths are accessible.

## What changed

- Require legacy sandbox conversion to preserve the filesystem policy's
  semantics, and reject unsupported profiles with an actionable error.
- Keep queued follow-up messages and safety-buffered retries intact when
  permissions are rejected, resuming queued input only after a compatible
  profile is selected.
- Cover compatible profiles, lossy restrictions and write roots, turn-start
  handling, and safety-buffered retries with regression tests.

GitOrigin-RevId: 345cc2a839206b2b1997e8981feb59f91b6975cc
2026-08-18 01:00:48 +00:00
Eric Traut
ca08a58ab4 Remove the experimental thread config endpoint (#39115)
## What changed

- Remove `experimental_thread_config_endpoint` from the configuration model and schema.
- Stop app-server and the in-process client from constructing a remote thread config loader from local configuration.
- Keep the thread config loader supplied at app-server startup fixed for the lifetime of the config manager.

GitOrigin-RevId: e7907fee2d631e7ecf89ec6bac8f22bc2c221350
2026-08-18 00:45:00 +00:00
Eric Traut
fd5018e044 Add a dedicated codex agents dashboard command (#39114)
## What changed

- Add `codex agents` to open the shared agents overview without creating a new session.
- Start the local background app server automatically on Unix, or connect to a server supplied with `--remote`.
- Reject invocation-specific session overrides that cannot apply to shared sessions.
- When the overview is opened from an embedded session, offer to start the background server without moving or interrupting the current session.

## Testing

- Cover command-line parsing and rejection of incompatible overrides.
- Snapshot the embedded-session background-server prompt.

GitOrigin-RevId: 60845dfebc48d820dc4ff090626d30452127f062
2026-08-18 00:31:51 +00:00
guinness-oai
13dfaab446 Surface interactive requests in realtime conversations (#39113)
## What changed

- Mirror execution, permission, and patch approval requests into active realtime conversations with a prompt to review them in the app.
- Mirror user-input and elicitation requests with a prompt to respond in the app.
- Include the serialized request event so the realtime handoff retains the request details.

GitOrigin-RevId: 56fefa70b9ecaaad2fcf83592f20e8b4514a004a
2026-08-17 23:54:51 +00:00