Commit Graph
5932 Commits
Author SHA1 Message Date
Eric Traut 5e622e429e Merge branch 'etraut/next-turn-state-app-server' into etraut/next-turn-state-tui
# Conflicts:
#	codex-rs/app-server/src/request_processors/turn_processor.rs
2026-05-18 21:47:43 -07:00
Eric Traut 62df4d9f9e Wait for pending settings before turn start 2026-05-18 21:46:46 -07:00
Eric Traut b6b22ad1b3 [6 of 7] Add app-server thread settings API 2026-05-18 21:11:15 -07:00
Eric Traut a668379abf [5 of 7] Replace OverrideTurnContext with ThreadSettings (#22508)
**Stack position:** [5 of 7]

## Summary

This PR adds `Op::ThreadSettings`, a queued settings-only update
mechanism for changing stored thread settings without starting a new
turn. It also removes the legacy `Op::OverrideTurnContext` in the same
layer, so reviewers can see the replacement and deletion together.

## Changes

- Add `Op::ThreadSettings` for settings-only queued updates.
- Emit `ThreadSettingsApplied` with the effective thread settings
snapshot after core applies an update.
- Route settings-only updates through the same submission queue as user
input.
- Migrate remaining `OverrideTurnContext` tests and callers to the
queued `Op::ThreadSettings` path.
- Delete `Op::OverrideTurnContext` from the core protocol and submission
loop.

This stack addresses #20656 and #22090.

## Stack

1. [1 of 7] [Add thread settings to
UserInput](https://github.com/openai/codex/pull/23080)
2. [2 of 7] [Remove
UserInputWithTurnContext](https://github.com/openai/codex/pull/23081)
3. [3 of 7] [Remove
UserTurn](https://github.com/openai/codex/pull/23075)
4. [4 of 7] [Placeholder for OverrideTurnContext
cleanup](https://github.com/openai/codex/pull/23087)
5. [5 of 7] [Replace OverrideTurnContext with
ThreadSettings](https://github.com/openai/codex/pull/22508) (this PR)
6. [6 of 7] [Add app-server thread settings
API](https://github.com/openai/codex/pull/22509)
7. [7 of 7] [Sync TUI thread
settings](https://github.com/openai/codex/pull/22510)
2026-05-18 21:03:51 -07:00
iceweasel-oai d3d38159ed fix(plugins): keep version upgrades additive (#23356)
## Why

Windows can reject plugin cache upgrades when a running MCP server still
has its working directory inside the currently active plugin version.
The existing cache refresh path replaces
`plugins/cache/<marketplace>/<plugin>` as a whole, so a live handle
under the old version can make an otherwise ordinary version bump fail.

This PR keeps the existing plugin-selection model intact while making
version bumps less disruptive.

## What changed

- When installing a new version beside an existing plugin cache root,
move only the staged version directory into place instead of replacing
the whole plugin root.
- Best-effort prune older sibling version directories after the new
version is activated.
- Preserve the existing whole-root replacement path for first installs
and same-version refreshes.
- Add regression coverage for upgrading from `1.0.0` to `2.0.0` without
replacing the plugin root.

## Verification

- `cargo test -p codex-core-plugins install_with_new_version`
- `cargo fmt --package codex-core-plugins --check`
2026-05-19 04:02:30 +00:00
Eric Traut 54d4b5c862 Merge branch 'etraut/next-turn-state-app-server' into etraut/next-turn-state-tui 2026-05-18 21:02:09 -07:00
Eric Traut bac94585e7 Ensure listener for thread settings updates 2026-05-18 21:01:55 -07:00
Eric Traut d20715c620 Merge branch 'etraut/next-turn-state-app-server' into etraut/next-turn-state-tui 2026-05-18 20:39:34 -07:00
Eric Traut 0db66bd6d6 Fix thread settings permissions tests 2026-05-18 20:39:07 -07:00
pakrym-oai 9e9a62dc28 [codex] Extract turn skill and plugin injections (#23396)
## Why

`run_turn` had accumulated the turn-scoped skill, plugin, app, MCP,
connector-selection, and analytics setup inline. That made the
orchestration path harder to scan even though the actual turn item
injection still needs to stay in `run_turn` so ordering is explicit.

## What changed

This extracts that setup into `build_skills_and_plugins`, which returns
the combined injection `ResponseItem`s and the explicitly enabled
connector IDs. `run_turn` now keeps the required orchestration pieces:
context update recording, user input handling, connector selection
merge, and the explicit per-item `record_conversation_items` calls for
injection items.

The refactor keeps the change LOC-neutral in `core/src/session/turn.rs`
and preserves the existing response-item based injection path.

## Validation

- `cargo test -p codex-core collect_explicit_app_ids_from_skill_items`
- `just fix -p codex-core`
2026-05-18 20:33:27 -07:00
Eric Traut f82e75c0de Merge branch 'etraut/next-turn-state-app-server' into etraut/next-turn-state-tui 2026-05-18 20:27:53 -07:00
Eric Traut b00aa1ead1 Route thread settings notifications by thread 2026-05-18 20:27:40 -07:00
Eric Traut e7d5ddc46e Defer running resume subscription to listener 2026-05-18 20:23:29 -07:00
Eric Traut c8a56c1ce0 Wait for accepted thread settings notifications 2026-05-18 20:21:17 -07:00
Eric Traut 2a3f524006 Serialize thread settings notifications 2026-05-18 20:04:52 -07:00
Eric Traut 1a25d8b6e5 [3 of 7] Remove UserTurn (#23075)
**Stack position:** [3 of 7]

## Summary

This PR finishes the input-op consolidation by moving the remaining
`Op::UserTurn` callers onto `Op::UserInput` and deleting `Op::UserTurn`.
This touches a lot of files, but it is a low-risk mechanical migration.

## Stack

1. [1 of 7] [Add thread settings to
UserInput](https://github.com/openai/codex/pull/23080)
2. [2 of 7] [Remove
UserInputWithTurnContext](https://github.com/openai/codex/pull/23081)
3. [3 of 7] [Remove
UserTurn](https://github.com/openai/codex/pull/23075) (this PR)
4. [4 of 7] [Placeholder for OverrideTurnContext
cleanup](https://github.com/openai/codex/pull/23087)
5. [5 of 7] [Replace OverrideTurnContext with
ThreadSettings](https://github.com/openai/codex/pull/22508)
6. [6 of 7] [Add app-server thread settings
API](https://github.com/openai/codex/pull/22509)
7. [7 of 7] [Sync TUI thread
settings](https://github.com/openai/codex/pull/22510)
2026-05-18 19:56:00 -07:00
Eric Traut 09c10ffb0c Merge branch 'etraut/next-turn-state-app-server' into etraut/next-turn-state-tui 2026-05-18 19:54:23 -07:00
Eric Traut 7287944484 Merge branch 'etraut/next-turn-state-core' into etraut/next-turn-state-app-server 2026-05-18 19:54:06 -07:00
Eric Traut 7a091b0fe2 Classify invalid thread settings as bad requests 2026-05-18 19:53:51 -07:00
Eric Traut e811234484 [2 of 7] Remove UserInputWithTurnContext (#23081)
**Stack position:** [2 of 7]

## Summary

This PR removes the overlapping `Op::UserInputWithTurnContext` variant
now that `Op::UserInput` can carry thread settings overrides directly.

## Stack

1. [1 of 7] [Add thread settings to
UserInput](https://github.com/openai/codex/pull/23080)
2. [2 of 7] [Remove
UserInputWithTurnContext](https://github.com/openai/codex/pull/23081)
(this PR)
3. [3 of 7] [Remove
UserTurn](https://github.com/openai/codex/pull/23075)
4. [4 of 7] [Placeholder for OverrideTurnContext
cleanup](https://github.com/openai/codex/pull/23087)
5. [5 of 7] [Replace OverrideTurnContext with
ThreadSettings](https://github.com/openai/codex/pull/22508)
6. [6 of 7] [Add app-server thread settings
API](https://github.com/openai/codex/pull/22509)
7. [7 of 7] [Sync TUI thread
settings](https://github.com/openai/codex/pull/22510)
2026-05-18 19:41:33 -07:00
Eric Traut 1e07001028 Merge branch 'etraut/next-turn-state-app-server' into etraut/next-turn-state-tui 2026-05-18 19:35:06 -07:00
Eric Traut 9403a72345 Document thread settings experimental opt-in 2026-05-18 19:34:48 -07:00
Eric Traut 862a5e0420 Merge branch 'etraut/next-turn-state-app-server' into etraut/next-turn-state-tui 2026-05-18 19:33:27 -07:00
Eric Traut 49860973c4 Merge branch 'etraut/next-turn-state-core' into etraut/next-turn-state-app-server
# Conflicts:
#	codex-rs/app-server-protocol/src/protocol/common.rs
#	codex-rs/app-server-protocol/src/protocol/v2/thread.rs
#	codex-rs/app-server/src/request_processors/turn_processor.rs
2026-05-18 19:26:52 -07:00
Eric Traut ef2278bfdc Merge branch 'etraut/next-turn-state-remove-override-context' into etraut/next-turn-state-core 2026-05-18 19:23:13 -07:00
Eric Traut 45fe8ff8cc Merge branch 'etraut/next-turn-state-remove-user-input-with-context' into etraut/next-turn-state-input-op-consolidation
# Conflicts:
#	codex-rs/core/src/session/handlers.rs
#	codex-rs/core/tests/common/test_codex.rs
#	codex-rs/core/tests/suite/request_permissions.rs
#	codex-rs/core/tests/suite/unified_exec.rs
#	codex-rs/protocol/src/protocol.rs
2026-05-18 19:22:12 -07:00
Eric Traut 6927359c0c Simplify turn start context overrides 2026-05-18 18:51:31 -07:00
Eric Traut e3fe029000 Remove UserInputWithTurnContext op 2026-05-18 18:51:06 -07:00
Eric Traut 84d941d07f [1 of 7] Add thread settings to UserInput (#23080)
**Stack position:** [1 of 7]

## Summary

The first three PRs in this stack are a cleanup pass before the actual
thread settings API work.

Today, core has several overlapping "user input" ops: `UserInput`,
`UserInputWithTurnContext`, and `UserTurn`. They differ mostly in how
much next-turn state they carry, which makes the later queued thread
settings update harder to reason about and review.

This PR starts that cleanup by adding the shared
`ThreadSettingsOverrides` payload and allowing `Op::UserInput` to carry
it. Existing variants remain in place here, so this layer is mostly a
behavior-preserving API shape change plus mechanical constructor
updates.

## End State After PR3

By the end of PR3, `Op::UserInput` is the only "user input" core op. It
can carry optional thread settings overrides for callers that need to
update stored defaults with a turn, while callers without updates use
empty settings. `Op::UserInputWithTurnContext` and `Op::UserTurn` are
deleted.

## End State After PR5

By the end of PR5, core will have only two ops for this area:

- `Op::UserInput` for user-input-bearing submissions.
- `Op::ThreadSettings` for settings-only updates.

## Stack

1. [1 of 7] [Add thread settings to
UserInput](https://github.com/openai/codex/pull/23080) (this PR)
2. [2 of 7] [Remove
UserInputWithTurnContext](https://github.com/openai/codex/pull/23081)
3. [3 of 7] [Remove
UserTurn](https://github.com/openai/codex/pull/23075)
4. [4 of 7] [Placeholder for OverrideTurnContext
cleanup](https://github.com/openai/codex/pull/23087)
5. [5 of 7] [Replace OverrideTurnContext with
ThreadSettings](https://github.com/openai/codex/pull/22508)
6. [6 of 7] [Add app-server thread settings
API](https://github.com/openai/codex/pull/22509)
7. [7 of 7] [Sync TUI thread
settings](https://github.com/openai/codex/pull/22510)
2026-05-18 18:48:35 -07:00
Eric Traut 052260a50b Absolutize thread settings cwd before queueing 2026-05-18 18:42:41 -07:00
Eric Traut 0fafab08ef Merge branch 'etraut/next-turn-state-app-server' into etraut/next-turn-state-tui
# Conflicts:
#	codex-rs/tui/src/chatwidget/protocol.rs
2026-05-18 18:33:10 -07:00
Eric Traut 654586eda6 Update TUI thread settings notification matches 2026-05-18 18:31:49 -07:00
Eric Traut 505a6dec64 Wait for accepted thread settings updates 2026-05-18 18:27:29 -07:00
sayan-oai daa11820b0 Remove ToolSearch feature toggle (#23389)
## Summary
- mark `ToolSearch` as removed and ignore stale config writes for its
legacy key
- make search tool exposure depend only on model capability, not a
feature toggle
- remove app-server enablement support and prune now-obsolete test
coverage/setup

## Verification
- `cargo test -p codex-features`
- `cargo test -p codex-tools`
- `cargo test -p codex-core search_tool_requires_model_capability`
- `cargo test -p codex-app-server experimental_feature_enablement_set_`

## Notes
- This keeps the legacy config key as a no-op for compatibility while
removing the ability to toggle the behavior off cleanly.
- No developer-facing docs update outside the touched app-server README
was needed.
2026-05-19 01:24:39 +00:00
xl-openai 6b54ced108 cleanup: Remove skill env var dependency prompting (#22721)
Deletes the skill env var dependency prompt feature and its runtime
path. env_var entries in skill dependency metadata are now silently
ignored during skill loading.
2026-05-19 01:24:19 +00:00
Eric Traut 2de6572138 Fix thread settings notification client match 2026-05-18 18:20:24 -07:00
pakrym-oai 17d552fb4d [codex] Remove external websocket session resets (#23384)
## Why

Compaction now installs replacement history inside the session, but the
turn and compaction callers were still reaching into
`ModelClientSession` to reset websocket transport state after that
install. That made a transport-level reset part of the compaction API
even though websocket incremental request selection already checks
whether the next request is a strict extension of the previous one and
falls back to a full `response.create` when it is not.

## What changed

- Removed the compaction-side calls to `reset_websocket_session` from
`compact.rs` and `session/turn.rs`.
- Simplified pre-sampling and mid-turn compaction helpers so they return
`CodexResult<()>` instead of carrying a reset flag.
- Made `ModelClientSession::reset_websocket_session` private to
`client.rs`, leaving only the websocket timeout recovery path inside the
client as a caller.

## Validation

- `cargo test -p codex-core --test all
responses_websocket_creates_on_non_prefix`
- `cargo test -p codex-core --test all
steered_user_input_waits_for_model_continuation_after_mid_turn_compact`
- `cargo test -p codex-core --test all
pre_sampling_compact_runs_on_switch_to_smaller_context_model`
2026-05-19 01:13:38 +00:00
Eric Traut 0d62edd2de Merge branch 'etraut/next-turn-state-app-server' into etraut/next-turn-state-tui 2026-05-18 17:43:58 -07:00
Eric Traut 0f422dd875 Merge branch 'etraut/next-turn-state-core' into etraut/next-turn-state-app-server
# Conflicts:
#	codex-rs/app-server/src/request_processors/turn_processor.rs
2026-05-18 17:43:41 -07:00
Eric Traut 0a2c9aa9d9 Simplify thread settings core helpers 2026-05-18 17:42:36 -07:00
Michael Bolin 3fd79b7986 app-server: use profile ids in v2 permission params (#23360)
## Why

The v2 app-server permission profile fields are experimental, but the
previous migration kept a legacy object payload for profile selection.
That made clients aware of server-owned `activePermissionProfile`
metadata such as `extends`, and it kept a
`legacy_additional_writable_roots` path even though
`runtimeWorkspaceRoots` now owns runtime workspace-root selection.

This PR makes the client contract match the intended model: clients
select a permission profile by id, and the server resolves and reports
active profile provenance in response payloads.

Follow-up to #22611.

## What Changed

- Changed `thread/start`, `thread/resume`, `thread/fork`, and
`turn/start` permission profile selection to plain profile id strings.
- Changed `command/exec.permissionProfile` to a plain profile id string
for the same client/server ownership split.
- Removed `PermissionProfileSelectionParams` and the legacy `{ type:
"profile", modifications: [...] }` compatibility deserializer.
- Updated app-server, TUI, and `codex exec` call sites to send only ids,
while keeping `activePermissionProfile` as server response metadata.
- Updated app-server docs and schema fixtures for the revised
`command/exec.permissionProfile` shape.

## Verification

- `cargo test -p codex-app-server-protocol`
- `RUST_MIN_STACK=8388608 cargo test -p codex-app-server`
- `cargo test -p codex-exec`
- `RUST_MIN_STACK=8388608 cargo test -p codex-tui`

---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/23360).
* #23368
* __->__ #23360
2026-05-18 17:28:50 -07:00
Eric Traut 1d67ea0e0c Merge branch 'etraut/next-turn-state-app-server' into etraut/next-turn-state-tui 2026-05-18 17:15:46 -07:00
Eric Traut ed2534f1c1 Merge branch 'etraut/next-turn-state-core' into etraut/next-turn-state-app-server 2026-05-18 17:15:30 -07:00
Eric Traut 5dc813bd16 Fix thread settings op kind test 2026-05-18 17:15:15 -07:00
marksteinbrick-oai 5696167fe8 [codex-analytics] preserve user thread source for exec threads (#23376)
## Why
- Follows #20949.
- The above moved `thread_source` attribution from the reducer to
explicit caller provided metadata
- The `codex exec` path still omitted this metadata, leaving
exec-created threads without `thread_source`


## What Changed
- Ensures exec threads are marked as user created (`thread_source =
"user"`)
- Preserves thread-source metadata in exec’s startup session event


## Verification
- Updated unit tests to validate exec `thread_source` propagation.
- `cargo +1.93.0 test -p codex-exec --manifest-path codex-rs/Cargo.toml`
- `cargo +1.93.1 build -p codex-cli --manifest-path codex-rs/Cargo.toml`
- Validated locally with a freshly built `codex exec` run:
  - Startup logs showed `thread_source: Some(User)`.
  - Rollout metadata recorded `"thread_source":"user"`.
2026-05-18 17:13:49 -07:00
Eric Traut 38b56758f6 Merge branch 'etraut/next-turn-state-app-server' into etraut/next-turn-state-tui 2026-05-18 16:32:16 -07:00
Eric Traut 92d09dbb62 Merge branch 'etraut/next-turn-state-core' into etraut/next-turn-state-app-server 2026-05-18 16:32:07 -07:00
Eric Traut a14199fbb6 Merge branch 'etraut/next-turn-state-remove-override-context' into etraut/next-turn-state-core 2026-05-18 16:31:20 -07:00
Eric Traut d6ae36fd8d Merge branch 'etraut/next-turn-state-input-op-consolidation' into etraut/next-turn-state-remove-override-context 2026-05-18 16:30:45 -07:00
Eric Traut 4939645c44 Simplify thread settings test overrides 2026-05-18 16:30:08 -07:00