Commit Graph
12418 Commits
Author SHA1 Message Date
Michael Bolin c13557ea86 merge commit for archive created by Sapling 2026-04-22 00:02:27 -07:00
Michael Bolin 89a0761d67 app-server: accept permission profile overrides 2026-04-22 00:02:08 -07:00
Michael Bolin 8c4cf9f5fd merge commit for archive created by Sapling 2026-04-21 23:53:38 -07:00
Michael Bolin 72268ce2b6 tests: isolate approval fixtures from host rules 2026-04-21 23:53:01 -07:00
Michael Bolin 8d03956fdf shell-escalation: carry resolved permission profiles 2026-04-21 23:53:01 -07:00
Michael Bolin a345397ed2 mcp: include permission profiles in sandbox state 2026-04-21 23:53:01 -07:00
Michael Bolin 146bdb59fd tui: carry permission profiles on user turns 2026-04-21 23:53:01 -07:00
Michael Bolin c673808049 tui: sync session permission profiles 2026-04-21 23:53:01 -07:00
Michael Bolin 8760941be0 app-server: accept command permission profiles 2026-04-21 23:53:01 -07:00
Michael Bolin ab3987613b protocol: report session permission profiles 2026-04-21 23:53:01 -07:00
Michael Bolin 464da1097e rollout: persist turn permission profiles 2026-04-21 23:53:01 -07:00
Michael Bolin bcb731bb66 clients: send permission profiles to app-server 2026-04-21 23:53:01 -07:00
Michael Bolin 7793879e04 app-server: accept permission profile overrides 2026-04-21 23:53:01 -07:00
Michael Bolin 5eab9ff8ca app-server: expose thread permission profiles (#18278)
## Why

The `PermissionProfile` migration needs app-server clients to see the
same constrained permission model that core is using at runtime. Before
this PR, thread lifecycle responses only exposed the legacy
`SandboxPolicy` shape, so clients still had to infer active permissions
from sandbox fields. That makes downstream resume, fork, and override
flows harder to make `PermissionProfile`-first.

External sandbox policies are intentionally excluded from this canonical
view. External enforcement cannot be round-tripped as a
`PermissionProfile`, and exposing a lossy root-write profile would let
clients accidentally change sandbox semantics if they echo the profile
back later.

## What changed

- Adds the app-server v2 `PermissionProfile` wire shape, including
filesystem permissions and glob scan depth metadata.
- Adds `PermissionProfileNetworkPermissions` so the profile response
does not expose active network state through the older
additional-permissions naming.
- Returns `permissionProfile` from thread start, resume, and fork
responses when the active sandbox can be represented as a
`PermissionProfile`.
- Keeps legacy `sandbox` in those responses for compatibility and
documents `permissionProfile` as canonical when present.
- Makes lifecycle `permissionProfile` nullable and returns `null` for
`ExternalSandbox` to avoid exposing a lossy profile.
- Regenerates the app-server JSON schema and TypeScript fixtures.

## Verification

- `cargo test -p codex-app-server-protocol`
- `cargo test -p codex-app-server
thread_response_permission_profile_omits_external_sandbox --
--nocapture`
- `cargo check --tests -p codex-analytics -p codex-exec -p codex-tui`
- `just fix -p codex-app-server-protocol -p codex-app-server -p
codex-analytics -p codex-exec -p codex-tui`

---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/18278).
* #18279
* __->__ #18278
2026-04-21 23:52:56 -07:00
iceweasel-oai 3a451b6321 use long-lived sessions for codex sandbox windows (#18953)
`codex sandbox windows` previously did a one-shot spawn for all
commands.
This change uses the `unified_exec` session to spawn long-lived
processes instead, and implements a simple bridge to forward stdin to
the spawned session and stdout/stderr from the spawned session back to
the caller.

It also fixes a bug with the new shared spawn context code where the
"no-network env" was being applied to both elevated and unelevated
sandbox spawns. It should only be applied for the unelevated sandbox
because the elevated one uses firewall rules instead of an env-based
network suppression strategy.
2026-04-22 06:39:29 +00:00
Michael Bolin a062b83528 Merge e0e66afecf into sapling-pr-archive-bolinfest 2026-04-21 23:34:16 -07:00
Michael Bolin e0e66afecf app-server: accept permission profile overrides 2026-04-21 23:33:21 -07:00
Michael Bolin 05d2a66014 merge commit for archive created by Sapling 2026-04-21 23:22:59 -07:00
Michael Bolin c87677374c app-server: expose thread permission profiles 2026-04-21 23:22:33 -07:00
Michael Bolin 2305a53103 Merge cf92f0c00a into sapling-pr-archive-bolinfest 2026-04-21 23:02:57 -07:00
Michael Bolin cca4499a7c merge commit for archive created by Sapling 2026-04-21 23:01:01 -07:00
Michael Bolin cf92f0c00a tests: isolate approval fixtures from host rules 2026-04-21 23:00:44 -07:00
Michael Bolin e0369a052c app-server: expose thread permission profiles 2026-04-21 23:00:44 -07:00
Michael Bolin e42d384c51 shell-escalation: carry resolved permission profiles 2026-04-21 23:00:44 -07:00
Michael Bolin 0d902603a0 mcp: include permission profiles in sandbox state 2026-04-21 23:00:44 -07:00
Michael Bolin 60b4fdf496 tui: carry permission profiles on user turns 2026-04-21 23:00:44 -07:00
Michael Bolin f8c3ebfc9e tui: sync session permission profiles 2026-04-21 23:00:44 -07:00
Michael Bolin f16904c5a1 app-server: accept command permission profiles 2026-04-21 23:00:44 -07:00
Michael Bolin bbabb69883 protocol: report session permission profiles 2026-04-21 23:00:44 -07:00
Michael Bolin 0b01c37835 rollout: persist turn permission profiles 2026-04-21 23:00:44 -07:00
Michael Bolin 6e301e142f clients: send permission profiles to app-server 2026-04-21 23:00:44 -07:00
Michael Bolin 7a8de58955 app-server: accept permission profile overrides 2026-04-21 23:00:44 -07:00
Michael Bolin c616f50215 Merge 1065304e68 into sapling-pr-archive-bolinfest 2026-04-21 22:52:45 -07:00
Michael Bolin 1065304e68 app-server: expose thread permission profiles 2026-04-21 22:52:33 -07:00
Michael Bolin b514915a33 merge commit for archive created by Sapling 2026-04-21 22:44:55 -07:00
Michael Bolin 118628e4d3 fix(exec-server): retain output until streams close 2026-04-21 22:44:41 -07:00
Michael Bolin d78c3dd6cd Merge 5e894bf599 into sapling-pr-archive-bolinfest 2026-04-21 22:37:03 -07:00
Michael Bolin 5e894bf599 fix(exec-server): retain output until streams close 2026-04-21 22:36:57 -07:00
efrazer-oai 69c8913e24 feat: add explicit AgentIdentity auth mode (#18785)
## Summary

This PR adds `CodexAuth::AgentIdentity` as an explicit auth mode.

An AgentIdentity auth record is a standalone `auth.json` mode. When
`AuthManager::auth().await` loads that mode, it registers one
process-scoped task and stores it in runtime-only state on the auth
value. Header creation stays synchronous after that because the task is
initialized before callers receive the auth object.

This PR also removes the old feature flag path. AgentIdentity is
selected by explicit auth mode, not by a hidden flag or lazy mutation of
ChatGPT auth records.

Reference old stack: https://github.com/openai/codex/pull/17387/changes

## Design Decisions

- AgentIdentity is a real auth enum variant because it can be the only
credential in `auth.json`.
- The process task is ephemeral runtime state. It is not serialized and
is not stored in rollout/session data.
- Account/user metadata needed by existing Codex backend checks lives on
the AgentIdentity record for now.
- `is_chatgpt_auth()` remains token-specific.
- `uses_codex_backend()` is the broader predicate for ChatGPT-token auth
and AgentIdentity auth.

## Stack

1. https://github.com/openai/codex/pull/18757: full revert
2. https://github.com/openai/codex/pull/18871: isolated Agent Identity
crate
3. This PR: explicit AgentIdentity auth mode and startup task allocation
4. https://github.com/openai/codex/pull/18811: migrate Codex backend
auth callsites through AuthProvider
5. https://github.com/openai/codex/pull/18904: accept AgentIdentity JWTs
and load `CODEX_AGENT_IDENTITY`

## Testing

Tests: targeted Rust checks, cargo-shear, Bazel lock check, and CI.
2026-04-21 22:33:24 -07:00
Michael Bolin 37faa8f734 merge commit for archive created by Sapling 2026-04-21 22:33:01 -07:00
Michael Bolin 08584abbd0 fix(exec-server): retain output until streams close 2026-04-21 22:32:47 -07:00
Michael Bolin d6cbb3cf37 Merge e4889afbd6 into sapling-pr-archive-bolinfest 2026-04-21 22:21:09 -07:00
Michael Bolin e4889afbd6 app-server: expose thread permission profiles 2026-04-21 22:20:58 -07:00
Michael Bolin 9026c3328e merge commit for archive created by Sapling 2026-04-21 22:19:56 -07:00
Michael Bolin a838006c97 fix(exec-server): retain output until streams close 2026-04-21 22:19:41 -07:00
Michael Bolin 42c075308a Merge a708aa4c07 into sapling-pr-archive-bolinfest 2026-04-21 22:15:47 -07:00
Michael Bolin a708aa4c07 tests: isolate approval fixtures from host rules 2026-04-21 22:15:15 -07:00
Michael Bolin d9e23552bf shell-escalation: carry resolved permission profiles 2026-04-21 22:15:15 -07:00
Michael Bolin b88c653165 mcp: include permission profiles in sandbox state 2026-04-21 22:15:15 -07:00
Michael Bolin 1038aae0b5 tui: carry permission profiles on user turns 2026-04-21 22:15:15 -07:00