Commit Graph
13765 Commits
Author SHA1 Message Date
Michael Bolin 1cfeb5020c Merge 293cd35d55 into sapling-pr-archive-bolinfest 2026-04-27 22:07:04 -07:00
Michael Bolin 293cd35d55 permissions: add built-in default profiles 2026-04-27 22:06:53 -07:00
Michael Bolin 4f36ff27e5 app-server-protocol: mark permission profiles experimental 2026-04-27 22:06:53 -07:00
Michael Bolin 6c6150cfc8 permissions: store thread sessions as profiles 2026-04-27 22:06:53 -07:00
Michael Bolin 5e966fd4b2 permissions: derive snapshot sandbox projections 2026-04-27 22:06:53 -07:00
Michael Bolin bf38def44e permissions: make SessionConfigured profile-only (#19774)
## Why

`SessionConfiguredEvent` is the internal event that tells clients what
permissions are active for a session. Emitting both `sandbox_policy` and
`permission_profile` leaves two possible authorities and forces every
consumer to decide which one to honor. At this point in the migration,
the profile is expressive enough to represent managed, disabled, and
external sandbox enforcement, so the internal event can be profile-only.

The wire compatibility concern is older serialized events or rollout
data that only contain `sandbox_policy`; those still need to
deserialize.

## What Changed

- Removes `sandbox_policy` from `SessionConfiguredEvent` and makes
`permission_profile` required.
- Adds custom deserialization so old payloads with only `sandbox_policy`
are upgraded to a cwd-anchored `PermissionProfile`.
- Updates core event emission and TUI session handling to sync
permissions from the profile directly.
- Updates app-server response construction to derive the legacy
`sandbox` response field from the active thread snapshot instead of from
`SessionConfiguredEvent`.
- Updates yolo-mode display logic to treat both
`PermissionProfile::Disabled` and managed unrestricted filesystem plus
enabled network as full-access, while still preserving the distinction
between no sandbox and external sandboxing.

## Verification

- `cargo test -p codex-protocol session_configured_event --lib`
- `cargo test -p codex-protocol serialize_event --lib`
- `cargo test -p codex-exec session_configured --lib`
- `cargo test -p codex-app-server
thread_response_permission_profile_preserves_enforcement --lib`
- `cargo test -p codex-core
session_configured_reports_permission_profile_for_external_sandbox
--lib`
- `cargo test -p codex-tui session_configured --lib`
- `cargo test -p codex-tui
yolo_mode_includes_managed_full_access_profiles --lib`


































---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/19774).
* #19900
* #19899
* #19776
* #19775
* __->__ #19774
2026-04-27 22:06:47 -07:00
Eric Traut 5ba908d179 Avoid persisting ShutdownComplete after thread shutdown (#19630)
## Why

Fixes #19475.

`codex exec` can finish successfully and then emit an `ERROR` on stderr:

```text
failed to record rollout items: thread <id> not found
```

That happens because shutdown closes the live thread writer before
emitting `ShutdownComplete`. The terminal event was still using the
normal `send_event_raw` path, so it tried to append rollout items
through a recorder that had already been removed. The answer is correct,
but wrappers that treat stderr as failure can retry completed exec runs.

This looks like a likely recent regression from
[#18882](https://github.com/openai/codex/pull/18882), which routed live
thread writes through `ThreadStore` and added the shutdown-time live
writer close. I have not bisected this, so the PR treats #18882 as the
likely source based on the affected shutdown code path rather than a
proven first-bad commit.

## What Changed

`ShutdownComplete` now bypasses rollout persistence after thread
shutdown and is delivered directly to clients. The shutdown path still
records the protocol event in the rollout trace before delivery,
preserving trace visibility without attempting a post-shutdown
thread-store append.

The change also adds a regression test with the in-memory thread store
to assert that shutdown creates and shuts down the live thread without
appending another item after shutdown.
2026-04-27 22:02:08 -07:00
Eric Traut b7e5588d18 Clarify PR template invitation requirement (#19912)
Addresses #19856

## Summary
- Clarifies that external code contributions are invitation only.
- Points contributors to `docs/contributing.md` for the full policy
instead of using the previous warning phrasing.
2026-04-27 21:45:15 -07:00
Michael Bolin 7dc6345136 merge commit for archive created by Sapling 2026-04-27 21:40:17 -07:00
Michael Bolin e97f5f5117 permissions: add built-in default profiles 2026-04-27 21:38:52 -07:00
Michael Bolin 669323a45d app-server-protocol: mark permission profiles experimental 2026-04-27 21:38:52 -07:00
Michael Bolin 61fac4e8ee permissions: store thread sessions as profiles 2026-04-27 21:38:52 -07:00
Michael Bolin 2476604060 permissions: derive snapshot sandbox projections 2026-04-27 21:38:52 -07:00
Michael Bolin c942876181 permissions: make SessionConfigured profile-only 2026-04-27 21:38:26 -07:00
marksteinbrick-oai 6a8df2b61d [codex-analytics] include user agent in default headers (#17689)
## Summary
Adds the standard Codex `User-Agent` to shared default headers so the
responses-api WS handshake carries the same client OS and version
context as HTTP requests.

## Testing
- `cargo test -p codex-core
build_ws_client_metadata_includes_window_lineage_and_turn_metadata`
- `cargo test -p codex-core --test all responses_websocket`
2026-04-27 21:32:10 -07:00
Michael Bolin 3f2fe7f7c1 Merge 4707af72db into sapling-pr-archive-bolinfest 2026-04-27 21:29:55 -07:00
Michael Bolin 4707af72db permissions: add built-in default profiles 2026-04-27 21:29:34 -07:00
Michael Bolin 28113b6730 app-server-protocol: mark permission profiles experimental 2026-04-27 21:29:34 -07:00
Michael Bolin 9133437439 permissions: store thread sessions as profiles 2026-04-27 21:29:34 -07:00
Michael Bolin fac5fcd480 permissions: derive snapshot sandbox projections 2026-04-27 21:29:34 -07:00
Michael Bolin 49e344abaf permissions: make SessionConfigured profile-only 2026-04-27 21:29:34 -07:00
Michael Bolin 4e124a8264 merge commit for archive created by Sapling 2026-04-27 21:17:21 -07:00
Michael Bolin ecf246281e permissions: add built-in default profiles 2026-04-27 21:17:08 -07:00
Michael Bolin 0fc75cc1e0 app-server-protocol: mark permission profiles experimental 2026-04-27 21:17:08 -07:00
Michael Bolin 46a856eb53 permissions: store thread sessions as profiles 2026-04-27 21:17:08 -07:00
Michael Bolin 5895cd814a permissions: derive snapshot sandbox projections 2026-04-27 21:17:08 -07:00
Michael Bolin c8c964b8c2 permissions: make SessionConfigured profile-only 2026-04-27 21:17:08 -07:00
Michael Bolin 977c91c930 merge commit for archive created by Sapling 2026-04-27 21:12:48 -07:00
Michael Bolin f435a6cd02 permissions: add built-in default profiles 2026-04-27 21:12:16 -07:00
Michael Bolin ba5cc6d918 app-server-protocol: mark permission profiles experimental 2026-04-27 21:12:16 -07:00
Michael Bolin 2d32dadbd0 permissions: store thread sessions as profiles 2026-04-27 21:12:16 -07:00
Michael Bolin ee35838141 permissions: derive snapshot sandbox projections 2026-04-27 21:12:16 -07:00
Michael Bolin 7633b6943a permissions: make SessionConfigured profile-only 2026-04-27 21:12:16 -07:00
efrazer-oai c08177f7d0 refactor: load agent identity runtime eagerly (#19763)
## Summary

AgentIdentity auth previously registered the process task lazily behind
a `OnceCell`. That meant the auth object could be constructed before its
runtime task binding was known.

This PR makes AgentIdentity auth load the runtime task at auth load time
and stores the resulting process task id directly on the auth object.
The model-provider call path can then read a concrete task id instead of
handling a missing lazy value.

## Stack

1. [refactor: make auth loading
async](https://github.com/openai/codex/pull/19762) (merged)
2. **This PR:** [refactor: load AgentIdentity runtime
eagerly](https://github.com/openai/codex/pull/19763)
3. [fix: configure AgentIdentity AuthAPI base
URL](https://github.com/openai/codex/pull/19904)
4. [feat: verify AgentIdentity JWTs with
JWKS](https://github.com/openai/codex/pull/19764)

## Important call sites

| Area | Change |
| --- | --- |
| `AgentIdentityAuth::load` | Registers the process task during auth
loading and stores `process_task_id`. |
| `CodexAuth::from_agent_identity_jwt` | Awaits AgentIdentity auth
loading. |
| model-provider auth | Reads a concrete `process_task_id` instead of an
optional lazy value. |
| AgentIdentity auth tests | Mock task registration now covers eager
runtime allocation. |

## Design decisions

AgentIdentity auth now treats task registration as part of constructing
a usable auth object. That matches how callers use the value: once auth
is present, the model-provider path expects the task-scoped assertion
data to be ready.

## Testing

Tests: targeted Rust auth test compilation, formatter, scoped Clippy
fix, and Bazel lock check.
2026-04-27 21:09:26 -07:00
canvrno-oai 2307aa8d98 Allow /statusline and /title slash commands during active turns (#19917)
- Marks `/title` and `/statusline` as available during active tasks.
- Extends the existing slash-command availability test coverage to
include these commands alongside `/goal`.
2026-04-27 20:57:20 -07:00
Michael Bolin ccf7320227 Merge b7dc64bf3d into sapling-pr-archive-bolinfest 2026-04-27 20:41:26 -07:00
Michael Bolin b7dc64bf3d permissions: add built-in default profiles 2026-04-27 20:41:10 -07:00
Michael Bolin 737f95d313 app-server-protocol: mark permission profiles experimental 2026-04-27 20:41:10 -07:00
Michael Bolin 7edd6bde2e permissions: store thread sessions as profiles 2026-04-27 20:41:10 -07:00
Michael Bolin 7497c0207a permissions: derive snapshot sandbox projections 2026-04-27 20:41:10 -07:00
Michael Bolin 86b7c3fef2 permissions: make SessionConfigured profile-only 2026-04-27 20:41:10 -07:00
Michael Bolin af95662a70 permissions: require profiles in TUI thread state (#19773)
## Why

`ThreadSessionState` is the TUI's cached view of an app-server session.
To make `PermissionProfile` the canonical runtime permissions model,
cached thread sessions need to always have a profile instead of treating
the profile as an optional supplement to a legacy `sandbox` response
field.

The main compatibility concern is older app-server v2 lifecycle
responses that only include `sandbox` and omit `permissionProfile`:

- `thread/start` -> `ThreadStartResponse.sandbox`
- `thread/resume` -> `ThreadResumeResponse.sandbox`
- `thread/fork` -> `ThreadForkResponse.sandbox`

Those responses must still hydrate correctly when the TUI is pointed at
an older app-server. This PR converts the legacy `sandbox` value into a
`PermissionProfile` immediately at response ingestion time, using the
response `cwd`, so cached sessions do not carry an optional profile that
can later reinterpret cwd-bound grants against a different thread cwd.

This fallback is intentionally boundary compatibility. The follow-up PRs
in this stack continue the cleanup by making `SessionConfiguredEvent`
profile-only, deriving sandbox projections from snapshots only when an
API still needs them, and then removing `sandbox_policy` from
`ThreadSessionState`.

## What Changed

- Makes `ThreadSessionState.permission_profile` required.
- Converts legacy app-server response `sandbox` values into a
`PermissionProfile` at ingestion time using the response cwd.
- Ensures `thread/read` hydration does not reuse a primary session
profile that may be anchored to a different cwd; it uses the active
widget permission settings for the read thread fallback instead of
reusing cached primary-session permissions.
- Keeps the app-server request path unchanged: embedded sessions send
profiles, while remote sessions continue using legacy sandbox overrides
for compatibility.

## Verification

- `cargo test -p codex-tui thread_read --lib`
- `cargo test -p codex-tui
permission_settings_sync_preserves_active_profile_only_rules --lib`
- `cargo test -p codex-tui
resume_response_restores_turns_from_thread_items --lib`
- `cargo test -p codex-tui thread_session_state::tests --lib`




























---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/19773).
* #19900
* #19899
* #19776
* #19775
* #19774
* __->__ #19773
2026-04-27 20:39:06 -07:00
Michael Bolin 3f8be22845 Merge 7ca20b4669 into sapling-pr-archive-bolinfest 2026-04-27 20:18:03 -07:00
Michael Bolin 7ca20b4669 permissions: add built-in default profiles 2026-04-27 20:17:21 -07:00
Michael Bolin d1871b88e9 app-server-protocol: mark permission profiles experimental 2026-04-27 20:17:21 -07:00
Michael Bolin 08e200fd06 permissions: store thread sessions as profiles 2026-04-27 20:17:21 -07:00
Michael Bolin 2f9c725c72 permissions: derive snapshot sandbox projections 2026-04-27 20:17:21 -07:00
Michael Bolin 2d01c68aff permissions: make SessionConfigured profile-only 2026-04-27 20:17:21 -07:00
Michael Bolin bf530bf056 permissions: require profiles in TUI thread state 2026-04-27 20:17:21 -07:00
pakrym-oai 4e05f3053c Remove ghost snapshots (#19481)
## Summary
- Remove `ghost_snapshot` / `GhostCommit` from the Responses API surface
and generated SDK/schema artifacts.
- Keep legacy config loading compatible, but make undo a no-op that
reports the feature is unavailable.
- Clean up core history, compaction, telemetry, rollout, and tests to
stop carrying ghost snapshot items.

## Testing
- Unit tests passed for `codex-protocol`, `codex-core` targeted undo and
compaction flows, `codex-rollout`, and `codex-app-server-protocol`.
- Regenerated config and app-server schemas plus Python SDK artifacts
and verified they match the checked-in outputs.
2026-04-27 18:48:57 -07:00