Commit Graph
6194 Commits
Author SHA1 Message Date
rhan-oai 945388bcb3 merge commit for archive created by Sapling 2026-04-20 13:37:29 -07:00
rhan-oai 35c9400828 [codex-analytics] emit tool item events from item lifecycle 2026-04-20 13:35:46 -07:00
rhan-oai ecd06cbee0 [codex-analytics] add tool item event schemas 2026-04-20 13:35:46 -07:00
rhan-oai 06a35d7811 Merge b4e5d584b2 into sapling-pr-archive-rhan-oai 2026-04-20 13:33:38 -07:00
rhan-oai b4e5d584b2 core: emit responses api call analytics 2026-04-20 13:31:41 -07:00
rhan-oai aea8f2a3d3 analytics: reduce responses api call facts 2026-04-20 13:31:40 -07:00
rhan-oai 391565ff57 [codex-analytics] ingest server requests and responses 2026-04-20 13:30:41 -07:00
rhan-oai be2c19672c analytics: add responses api call schema 2026-04-20 13:30:41 -07:00
rhan-oai 467c16184e merge commit for archive created by Sapling 2026-04-20 13:29:42 -07:00
rhan-oai 930b9c6996 merge commit for archive created by Sapling 2026-04-20 13:13:26 -07:00
rhan-oai d8dec91fd3 [codex-analytics] guardian review TTFT plumbing and emission 2026-04-20 13:11:54 -07:00
rhan-oai d7d92000d5 [codex-analytics] guardian review truncation 2026-04-20 13:11:53 -07:00
rhan-oai 68b51daa28 [codex-analytics] guardian review analytics events emission 2026-04-20 13:11:53 -07:00
rhan-oai 7f53e47250 [codex-analytics] guardian review analytics schema polishing (#17692)
## Why

Guardian review analytics needs a Rust event shape that matches the
backend schema while avoiding unnecessary PII exposure from reviewed
tool calls. This PR narrows the analytics payload to the fields we
intend to emit and keeps shared Guardian assessment enums in protocol
instead of duplicating equivalent analytics-only enums.

## What changed

- Uses protocol Guardian enums directly for `risk_level`,
`user_authorization`, `outcome`, and command source values.
- Removes high-risk reviewed-action fields from the analytics payload,
including raw commands, display strings, working directories, file
paths, network targets/hosts, justification text, retry reason, and
rationale text.
- Makes `target_item_id` and `tool_call_count` nullable so the Codex
event can represent cases where the app-server protocol or producer does
not have those values.
- Keeps lower-risk structured reviewed-action metadata such as sandbox
permissions, permission profile, `tty`, `execve` source/program, network
protocol/port, and MCP connector/tool labels.
- Adds an analytics reducer/client test covering `codex_guardian_review`
serialization with an optional `target_item_id` and absent removed
fields.

## Verification

- `cargo test -p codex-analytics
guardian_review_event_ingests_custom_fact_with_optional_target_item`
- `cargo fmt --check`

---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/17692).
* #17696
* #17695
* #17693
* __->__ #17692
2026-04-20 13:08:17 -07:00
rhan-oai bf4d5d7bd6 merge commit for archive created by Sapling 2026-04-20 13:08:12 -07:00
rhan-oai d2746931a5 core: emit responses api call analytics 2026-04-20 13:07:50 -07:00
rhan-oai d245a57db3 Merge 888f26ae4b into sapling-pr-archive-rhan-oai 2026-04-20 13:07:38 -07:00
rhan-oai ff079effc8 [codex-analytics] emit tool item events from item lifecycle 2026-04-20 13:07:01 -07:00
rhan-oai 888f26ae4b [codex-analytics] add tool item event schemas 2026-04-20 13:07:01 -07:00
rhan-oai 0af69cf78b [codex-analytics] ingest server requests and responses 2026-04-20 12:28:18 -07:00
rhan-oai 83136ec535 Merge 063191c1a0 into sapling-pr-archive-rhan-oai 2026-04-20 12:24:47 -07:00
rhan-oai 4aa53418fb merge commit for archive created by Sapling 2026-04-20 12:22:20 -07:00
rhan-oai 063191c1a0 core: emit responses api call analytics 2026-04-20 12:21:52 -07:00
rhan-oai 012b3cdaf2 analytics: reduce responses api call facts 2026-04-20 12:21:51 -07:00
rhan-oai 0bb92652f0 merge commit for archive created by Sapling 2026-04-20 12:12:38 -07:00
rhan-oai 89bc73125a [codex-analytics] emit tool item events from item lifecycle 2026-04-20 12:11:40 -07:00
rhan-oai a44d0f3af1 [codex-analytics] add tool item event schemas 2026-04-20 12:11:40 -07:00
rhan-oai ff0450669c [codex-analytics] ingest server requests and responses 2026-04-20 12:11:40 -07:00
rhan-oai 5b0245593b merge commit for archive created by Sapling 2026-04-20 12:09:19 -07:00
rhan-oai 7c99aec182 analytics: add responses api call schema 2026-04-20 12:07:05 -07:00
rhan-oai b0a50cda34 core: emit responses api call analytics 2026-04-20 12:07:05 -07:00
rhan-oai 5a2478bd2f analytics: reduce responses api call facts 2026-04-20 12:07:05 -07:00
caseysilver-oai fe04d75e0f [codex] Fix high severity dependency alerts (#18167)
## Summary
- Pin vulnerable npm dependencies through the existing root
`resolutions` mechanism so the lockfile moves only to patched versions.
- Refresh `pnpm-lock.yaml` for `@modelcontextprotocol/sdk`,
`handlebars`, `path-to-regexp`, `picomatch`, `minimatch`, `flatted`,
`rollup`, and `glob`.
- Bump `quinn-proto` from `0.11.13` to `0.11.14` and refresh
`MODULE.bazel.lock`.

## Testing
- `corepack pnpm --store-dir .pnpm-store install --frozen-lockfile
--ignore-scripts`
- `corepack pnpm audit --audit-level high` (passes; remaining advisories
are low/moderate)
- `corepack pnpm -r --filter ./sdk/typescript run build`
- `corepack pnpm exec eslint 'src/**/*.ts' 'tests/**/*.ts'`
- `cargo check --locked`
- `cargo build -p codex-cli`
- `bazel --output_user_root=/tmp/bazel-codex-dependabot
--ignore_all_rc_files mod deps --lockfile_mode=error`
- `just fmt`

Note: `corepack pnpm -r --filter ./sdk/typescript run test` was also
attempted after building `codex`; it is blocked on this workstation by
host-managed Codex MDM/auth state (`approval_policy` restrictions and
ChatGPT/API-key mismatch), not by this dependency change.
2026-04-20 11:59:50 -07:00
4676cb5ff8 Update models.json (#18388)
Automated update of models.json.

---------

Co-authored-by: aibrahim-oai <219906144+aibrahim-oai@users.noreply.github.com>
Co-authored-by: Ahmed Ibrahim <aibrahim@openai.com>
2026-04-20 11:46:52 -07:00
rhan-oai c27dbf91c0 merge commit for archive created by Sapling 2026-04-20 11:46:48 -07:00
rhan-oai 32c8bb120d core: emit responses api call analytics 2026-04-20 11:46:14 -07:00
rhan-oai b863d929f4 analytics: reduce responses api call facts 2026-04-20 11:46:14 -07:00
rhan-oai 4c6aec58f7 analytics: add responses api call schema 2026-04-20 11:45:55 -07:00
rhan-oai 258b780ec0 merge commit for archive created by Sapling 2026-04-20 11:07:32 -07:00
rhan-oai b7bd713158 core: emit responses api call analytics 2026-04-20 11:06:58 -07:00
rhan-oai 63f7a5bac3 analytics: reduce responses api call facts 2026-04-20 11:06:58 -07:00
rhan-oai 3d407bec6e analytics: add responses api call schema 2026-04-20 11:06:29 -07:00
Adrian 6b17adc231 [codex] Fix agent identity auth test fixture (#18697)
## Summary
- Add the missing `background_task_id: None` field to the
`AgentIdentityAuthRecord` fixture introduced in `auth_tests.rs`.

## Why
- Current `main` fails Bazel/rust-ci compile paths after the
background-task auth field landed and a later auth test fixture
constructed `AgentIdentityAuthRecord` without that new field.
- I intentionally removed the earlier broader CI-stability edits from
this PR. The code-mode timeout, external-agent migration snapshot, and
MCP resource timeout failures appear to be general/flaky or unrelated to
the agent identity merge stack rather than cleanly caused by it.

## Validation
- `cargo test -p codex-login
dummy_chatgpt_auth_does_not_create_cwd_auth_json_when_identity_is_set --
--nocapture`
- `just fmt`
2026-04-20 11:05:58 -07:00
Eric Traut 164b6a0c78 Remove simple TUI legacy_core reexports (#18631)
## Problem
The TUI still imported path utilities and config-loader symbols through
app-server-client's legacy_core facade even though those APIs already
exist in utility/config crates. This is part of our ongoing effort to
whittle away at these old dependencies.

## Solution
Rewire imports to avoid the TUI directly importing from the core crate
and instead import from common lower-level crates. This PR doesn't
include any functional changes; it's just a simple rewiring.
2026-04-20 10:48:27 -07:00
Akshay Nathan 34a3e85fcd Wire the PatchUpdated events through app_server (#18289)
Wires patch_updated events through app_server. These events are parsed
and streamed while apply_patch is being written by the model. Also adds 500ms of buffering to the patch_updated events in the diff_consumer.

The eventual goal is to use this to display better progress indicators in
the codex app.
2026-04-20 10:44:03 -07:00
Ahmed Ibrahim 316cf0e90b Update models.json (#18586)
- Replace the active models-manager catalog with the deleted core
catalog contents.
- Replace stale hardcoded test model slugs with current bundled model
slugs.
- Keep this as a stacked change on top of the cleanup PR.
2026-04-20 10:27:01 -07:00
Michael Bolin 5d5d610740 refactor: use semaphores for async serialization gates (#18403)
This is the second cleanup in the await-holding lint stack. The
higher-level goal, following https://github.com/openai/codex/pull/18178
and https://github.com/openai/codex/pull/18398, is to enable Clippy
coverage for guards held across `.await` points without carrying broad
suppressions.

The stack is working toward enabling Clippy's
[`await_holding_lock`](https://rust-lang.github.io/rust-clippy/master/index.html#await_holding_lock)
lint and the configurable
[`await_holding_invalid_type`](https://rust-lang.github.io/rust-clippy/master/index.html#await_holding_invalid_type)
lint for Tokio guard types.

Several existing fields used `tokio::sync::Mutex<()>` only as
one-at-a-time async gates. Those guards intentionally lived across
`.await` while an operation was serialized. A mutex over `()` suggests
protected data and trips the await-holding lint shape; a single-permit
`tokio::sync::Semaphore` expresses the intended serialization directly.

## What changed

- Replace `Mutex<()>` serialization gates with `Semaphore::new(1)` for
agent identity ensure, exec policy updates, guardian review session
reuse, plugin remote sync, managed network proxy refresh, auth token
refresh, and RMCP session recovery.
- Update call sites from `lock().await` / `try_lock()` to
`acquire().await` / `try_acquire()`.
- Map closed-semaphore errors into the existing local error types, even
though these semaphores are owned for the lifetime of their managers.
- Update session test builders for the new
`managed_network_proxy_refresh_lock` type.

## Verification

- The split stack was verified at the final lint-enabling head with
`just clippy`.





---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/18403).
* #18698
* #18423
* #18418
* __->__ #18403
2026-04-20 17:21:29 +00:00
Michael Bolin dcec516313 protocol: canonicalize file system permissions (#18274)
## Why

`PermissionProfile` needs stable, canonical file-system semantics before
it can become the primary runtime permissions abstraction. Without a
canonical form, callers have to keep re-deriving legacy sandbox maps and
profile comparisons remain lossy or order-dependent.

## What changed

This adds canonicalization helpers for `FileSystemPermissions` and
`PermissionProfile`, expands special paths into explicit sandbox
entries, and updates permission request/conversion paths to consume
those canonical entries. It also tightens the legacy bridge so root-wide
write profiles with narrower carveouts are not silently projected as
full-disk legacy access.

## Verification

- `cargo test -p codex-protocol
root_write_with_read_only_child_is_not_full_disk_write -- --nocapture`
- `cargo test -p codex-sandboxing permission -- --nocapture`
- `cargo test -p codex-tui permissions -- --nocapture`
2026-04-20 09:57:03 -07:00
Tom ac7c9a685f codex: move unloaded thread writes into store (#18361)
- Migrates unloaded `thread/name/set` and `thread/memoryModeSet`
app-server writes behind the generic
`ThreadStore::update_thread_metadata` API rather than adding one-off
store methods for setting thread name or memory mode.
- Implements the local ThreadStore metadata patch path for thread name
and memory mode, including rollout append, legacy name index updates,
SessionMeta validation/update, SQLite reconciliation, and re-reading the
stored thread.
- Adds focused local thread-store unit coverage plus app-server
integration coverage for the migrated unloaded write paths.
2026-04-20 09:50:01 -07:00
Eric Traut 0dc503ba6e Surface parent thread status in side conversations (#18591)
## Summary

Side conversations can hide important state changes from the parent
conversation while the user is focused on the side thread. In
particular, the parent may finish, fail, need user input, or require an
approval while the side conversation remains visible. Users need a
lightweight signal for those states, but parent approval overlays should
not interrupt the side conversation itself.

This change adds parent-conversation status to the side conversation
context label and defers parent interactive overlays while side mode is
active. When the user exits side mode, pending parent approvals and
input requests are restored in the main thread. The pending approval
footer avoids duplicating the same parent approval status, and replayed
notice cells are filtered when restoring a pending interactive request
so tips or warnings do not crowd out the approval prompt.

The change is contained to the TUI side-conversation and thread replay
paths.

Example 1: Approval pending
<img width="752" height="35" alt="Screenshot 2026-04-19 at 12 56 07 PM"
src="https://github.com/user-attachments/assets/1cc0f1a3-9cab-4d60-aed2-96523ccafc20"
/>

Example 2: Turn complete
<img width="754" height="35" alt="Screenshot 2026-04-19 at 12 56 27 PM"
src="https://github.com/user-attachments/assets/653521a5-e298-4366-ae1c-72b56eb88eeb"
/>
2026-04-20 09:00:44 -07:00