Commit Graph
12249 Commits
Author SHA1 Message Date
Tom a718b6fd47 Read conversation summaries through thread store (#18716)
Migrate the conversation summary App Server methods to ThreadStore

Because this app server api allows explicitly fetching the thread by
rollout path, intercept that case in the app server code and (a) route
directly to underlying local thread store methods if we're using a local
thread store, or (b) throw an unsupported error if we're using a remote
thread store. This keeps the thread store API clean and all filesystem
operations inside of the local thread store, which pushing the
"fundamental incompatibility" check as early as possible.
2026-04-20 22:39:10 +00:00
jif-oaiandCodex 660153b6de feat: cascade thread archive (#18112)
Cascade the thread archive endpoint to all the sub-agents in the agent
tree

Fix: https://github.com/openai/codex/issues/17867

---------

Co-authored-by: Codex <noreply@openai.com>
2026-04-20 23:38:18 +01:00
Eric Traut b8e78e8869 Use app server metadata for fork parent titles (#18632)
## Problem
The TUI resolved fork parent titles from local CODEX_HOME metadata,
which could show missing or stale titles when app-server metadata is
authoritative.

This is a lingering bug left over from the migration of the TUI to the
app-server interface. I found it when I asked Codex to review all places
where the TUI code was still directly accessing the local CODEX_HOME.

## Solution
Route fork parent title metadata through the app-server session state
and render only that supplied title, with focused snapshot coverage for
stale local metadata.

## Testing
I manually tested by renaming a thread then forking it and confirming
that the "forked from" message indicated the parent thread's name.
2026-04-20 15:37:31 -07:00
Thibault Sottiaux 54bd07d28c [codex] prefer inherited spawn agent model (#18701)
This updates the spawn-agent tool contract so subagents are presented as
inheriting the parent model by default. The visible model list is now
framed as optional overrides, the model parameter tells callers to leave
it unset and the delegation guidance no longer nudges models toward
picking a smaller/mini override.

Fixes reports that 5.4 would occasionally pick 5.2 or lower as
sub-agents.
2026-04-20 22:34:08 +00:00
Felipe Coury cebe57b723 fix(tui): keep /copy aligned with rollback (#18739)
## Why

Fixes #18718.

After rewinding a thread, `/copy` could still copy the latest assistant
response from before the rewind. The transcript cells were rolled back,
but the copy source was a single `last_agent_markdown` cache that was
not synchronized with backtracking, so the visible conversation and
copied content could diverge.

## What changed

`ChatWidget` now keeps a bounded copy history for the most recent 32
assistant responses, keyed by the visible user-turn count. When local
rollback trims transcript cells, the copy cache is trimmed to the same
surviving user-turn count so `/copy` uses the latest visible assistant
response.

If the user rewinds past the retained copy window, `/copy` now reports:

```text
Cannot copy that response after rewinding. Only the most recent 32 responses are available to /copy.
```

The change also adds coverage for copying the latest surviving response
after rollback and for the over-limit rewind message.

## Verification

- Manually resumed a synthetic 35-turn session, rewound within the
retained window, and verified `/copy` copied the surviving response.
- Manually rewound past the retained window and verified `/copy` showed
the 32-response limit message.
- `cargo test -p codex-tui slash_copy`
- `just fix -p codex-tui`
- `cargo insta pending-snapshots`

Note: `cargo test -p codex-tui` currently fails on unrelated model
catalog and snapshot drift around the default model changing to
`gpt-5.4`; the focused `/copy` tests pass after fixing the new test
setup.
2026-04-20 19:24:10 -03:00
Michael Bolin 432cd0fe93 merge commit for archive created by Sapling 2026-04-20 15:21:05 -07:00
Michael Bolin f6b0616e75 protocol: preserve glob scan depth in permission profiles 2026-04-20 15:20:53 -07:00
Tom 46e5814f77 Add experimental remote thread store config (#18714)
Add experimental config to use remote thread store rather than local
thread store implementation in app server
2026-04-20 22:20:39 +00:00
Michael Bolin f3fe41a071 merge commit for archive created by Sapling 2026-04-20 15:04:46 -07:00
Michael Bolin 88e3f23fea tests: isolate approval fixtures from host rules 2026-04-20 15:04:17 -07:00
Michael Bolin 8c1e4d5e2e shell-escalation: carry resolved permission profiles 2026-04-20 15:04:17 -07:00
Michael Bolin ad187d484a mcp: include permission profiles in sandbox state 2026-04-20 15:04:17 -07:00
Michael Bolin 2cd879430e tui: carry permission profiles on user turns 2026-04-20 15:04:17 -07:00
Michael Bolin acef277d13 tui: sync session permission profiles 2026-04-20 15:04:17 -07:00
Michael Bolin 48f1e00e27 app-server: accept command permission profiles 2026-04-20 15:04:17 -07:00
Michael Bolin 3f19fb1213 protocol: report session permission profiles 2026-04-20 15:04:17 -07:00
Michael Bolin fb4c037096 rollout: persist turn permission profiles 2026-04-20 15:04:17 -07:00
Michael Bolin ee0a15a465 clients: send permission profiles to app-server 2026-04-20 15:04:17 -07:00
Michael Bolin 0b44164c21 app-server: accept permission profile overrides 2026-04-20 15:04:17 -07:00
Michael Bolin c20c566610 app-server: expose thread permission profiles 2026-04-20 15:04:17 -07:00
Michael Bolin 90d7734250 core: derive active permission profiles 2026-04-20 15:04:17 -07:00
Michael Bolin 7bfb84e84d exec-server: carry filesystem sandbox profiles 2026-04-20 15:04:17 -07:00
Michael Bolin f6e66a5730 sandboxing: intersect permission profiles semantically 2026-04-20 15:04:17 -07:00
Michael Bolin b61264985f protocol: preserve glob scan depth in permission profiles 2026-04-20 15:04:17 -07:00
Michael Bolin f7b3d1920b Merge 2dd173fc66 into sapling-pr-archive-bolinfest 2026-04-20 14:58:14 -07:00
Michael Bolin 2dd173fc66 chore: enable await-holding clippy lints
Follow-up to https://github.com/openai/codex/pull/18178, where we said the await-holding clippy rule would be enabled separately.

Enable `await_holding_lock` and `await_holding_invalid_type` after the preceding commits fixed or explicitly documented the current offenders.
2026-04-20 14:58:02 -07:00
Michael Bolin 832c25b023 chore: document intentional await-holding cases 2026-04-20 14:58:02 -07:00
Michael Bolin f04f04bb9a refactor: drop data locks before async work 2026-04-20 14:58:01 -07:00
Ahmed Ibrahim cc96a03f10 Fix stale model test fixtures (#18719)
Fixes stale test fixtures left after the active bundled model catalog
updates in #18586 and #18388. Those changes made `gpt-5.4` the current
default and removed several older hardcoded slugs, which left Windows
Bazel shards failing TUI and config tests.

What changed:
- Refresh TUI model migration, availability NUX, plan-mode, status, and
snapshot fixtures to use active bundled model slugs.
- Update the config edit test expectation for the TOML-quoted
`"gpt-5.2"` migration key.
- Move the model catalog tests into
`codex-rs/tui/src/app/tests/model_catalog.rs` so touching them does not
trip the blob-size policy for `app.rs`.

Verification:
- CI Bazel/lint checks are expected to cover the affected test shards.
2026-04-20 21:52:30 +00:00
Eric Traut baa5dd7b29 Surface TUI skills refresh failures (#18627)
## Why

`skills/list` refreshes are best-effort metadata updates. If one fails
during startup or thread switching, the TUI should keep running and show
enough detail to diagnose the app-server failure instead of leaving the
user with only a log entry.

This addresses the recoverability and observability issue reported in
#16914.

## What Changed

- Preserve the full startup `skills/list` error chain before sending it
back through the app event queue.
- Surface failed skills refreshes as recoverable TUI error messages
while still logging the warning.

This is related to the recent bug fix from [PR
#18370](https://github.com/openai/codex/pull/18370).
2026-04-20 14:43:04 -07:00
guinness-oai 126bd6e7a8 Update realtime handoff transcript handling (#18597)
## Summary

This PR aims to improve integration between the realtime model and the
codex agent by sharing more context with each other. In particular, we
now share full realtime conversation transcript deltas in addition to
the delegation message.

realtime_conversation.rs now turns a handoff into:
```
<realtime_delegation>
  <input>...</input>
  <transcript_delta>...</transcript_delta>
</realtime_delegation>
```

## Implementation notes

The transcript is accumulated in the realtime websocket layer as parsed
realtime events arrive. When a background-agent handoff is requested,
the current transcript snapshot is copied onto the handoff event and
then serialized by `realtime_conversation.rs` into the hidden realtime
delegation envelope that Codex receives as user-turn context.

For Realtime V2, the session now explicitly enables input audio
transcription, and the parser handles the relevant input/output
transcript completion events so the snapshot includes both user speech
and realtime model responses. The delegation `<input>` remains the
actual handoff request, while `<transcript_delta>` carries the
surrounding conversation history for context.

Reviewers should note that the transcript payload is intended for Codex
context sharing, not UI rendering. The realtime delegation envelope
should stay hidden from the user-facing transcript surface, while still
being included in the background-agent turn so Codex can answer with the
same conversational context the realtime model had.
2026-04-20 14:04:09 -07:00
Dylan Hurd 14ebfbced9 chore(guardian) disable mcps and plugins (#18722)
## Summary
Disables apps, plugins, mcps for the guardian subagent thread

## Testing
- [x] Added unit tests
2026-04-20 13:43:50 -07:00
Michael Bolin 17230e80e8 Merge c4faa628f0 into sapling-pr-archive-bolinfest 2026-04-20 13:17:54 -07:00
Michael Bolin c4faa628f0 chore: enable await-holding clippy lints
Follow-up to https://github.com/openai/codex/pull/18178, where we said the await-holding clippy rule would be enabled separately.

Enable `await_holding_lock` and `await_holding_invalid_type` after the preceding commits fixed or explicitly documented the current offenders.
2026-04-20 13:17:44 -07:00
Michael Bolin feaccc448e chore: document intentional await-holding cases 2026-04-20 13:17:44 -07:00
Michael Bolin 1621e1b73c refactor: drop data locks before async work 2026-04-20 13:17:44 -07:00
Michael Bolin 9de3c609c1 Merge 6b4eb404e9 into sapling-pr-archive-bolinfest 2026-04-20 13:11:23 -07:00
Michael Bolin 6b4eb404e9 protocol: preserve glob scan depth in permission profiles 2026-04-20 13:11:01 -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
Michael Bolin a0ab4b3d04 merge commit for archive created by Sapling 2026-04-20 12:58:39 -07:00
Michael Bolin cb3ad47a67 protocol: preserve glob scan depth in permission profiles 2026-04-20 12:58:10 -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
Michael Bolin 3b6607d83d Merge 8597f938ca into sapling-pr-archive-bolinfest 2026-04-20 11:35:21 -07:00
Michael Bolin 8597f938ca tests: isolate approval fixtures from host rules 2026-04-20 11:28:23 -07:00
Michael Bolin b2be74dbf7 shell-escalation: carry resolved permission profiles 2026-04-20 11:28:23 -07:00
Michael Bolin 75bb66f6ea mcp: include permission profiles in sandbox state 2026-04-20 11:28:22 -07:00
Michael Bolin d2bd226956 tui: carry permission profiles on user turns 2026-04-20 11:28:22 -07:00
Michael Bolin 6a670565de tui: sync session permission profiles 2026-04-20 11:28:21 -07:00
Michael Bolin e600010f6f app-server: accept command permission profiles 2026-04-20 11:28:21 -07:00