Commit Graph

6747 Commits

Author SHA1 Message Date
Eric Traut
0db66bd6d6 Fix thread settings permissions tests 2026-05-18 20:39:07 -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
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
240f34cab0 Merge branch 'etraut/next-turn-state-core' into etraut/next-turn-state-app-server 2026-05-18 19:44:54 -07:00
Eric Traut
87c91db57f Merge branch 'etraut/next-turn-state-remove-override-context' into etraut/next-turn-state-core 2026-05-18 19:44:41 -07:00
Eric Traut
981399d146 Merge branch 'etraut/next-turn-state-input-op-consolidation' into etraut/next-turn-state-remove-override-context 2026-05-18 19:44:31 -07:00
Eric Traut
e940365cc8 Remove UserTurn op 2026-05-18 19:43:44 -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
9403a72345 Document thread settings experimental opt-in 2026-05-18 19:34:48 -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
154ef812a5 Merge branch 'etraut/next-turn-state-input-op-consolidation' into etraut/next-turn-state-remove-override-context 2026-05-18 19:23:01 -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
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
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
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
78dc40ac5c Merge branch 'etraut/next-turn-state-core' into etraut/next-turn-state-app-server 2026-05-18 16:46:53 -07:00
Eric Traut
c230815119 Merge branch 'etraut/next-turn-state-remove-override-context' into etraut/next-turn-state-core 2026-05-18 16:46:41 -07:00
Eric Traut
d58faa2abe Keep thread settings stack placeholder 2026-05-18 16:45:25 -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
Felipe Coury
a66712c95d fix(tui): warn on unsupported iTerm2 pet versions (#23371)
## Why

Older iTerm2 builds can be detected as supporting the image transport
that terminal pets use, but in practice they fail to render the pet flow
correctly. Instead of silently attempting image rendering, Codex should
tell the user that their iTerm2 version is too old and that upgrading is
the fix.

## What Changed

- gate iTerm2 pet auto-detection on version `3.6.0` or newer
- show a dedicated upgrade message for older or unknown iTerm2 versions
instead of the generic unsupported-terminal warning
- keep the existing generic unsupported-terminal path for non-iTerm
terminals
- add regression coverage for iTerm2 version parsing and the old-iTerm
warning path

## How to Test

1. Start Codex in iTerm2 3.6 or newer.
2. Run `/pets`.
3. Confirm the pets picker opens instead of showing a warning.
4. Start Codex in an older iTerm2 build, or exercise the equivalent test
path.
5. Run `/pets`.
6. Confirm Codex warns that pets require iTerm2 3.6 or newer and tells
the user to upgrade.
7. Also verify that a non-iTerm unsupported terminal still shows the
generic unsupported-terminal message.

Targeted tests:
- `cargo test -p codex-terminal-detection`
- `cargo test -p codex-tui pets::`
- `cargo test -p codex-tui slash_pets_on_unsupported_terminal`
- `cargo test -p codex-tui slash_pets_on_old_iterm2`
2026-05-18 20:24:09 -03:00
Eric Traut
17816b6664 Merge branch 'etraut/next-turn-state-core' into etraut/next-turn-state-app-server 2026-05-18 16:17:54 -07:00
Eric Traut
0a2edb9e31 Merge branch 'etraut/next-turn-state-remove-override-context' into etraut/next-turn-state-core 2026-05-18 16:17:38 -07:00
Eric Traut
5ff0c296bb Merge branch 'etraut/next-turn-state-input-op-consolidation' into etraut/next-turn-state-remove-override-context 2026-05-18 16:17:20 -07:00
Eric Traut
2836662ea4 Fix thread settings field rename 2026-05-18 16:17:01 -07:00
Eric Traut
1484283d12 Merge branch 'etraut/next-turn-state-core' into etraut/next-turn-state-app-server 2026-05-18 16:09:25 -07:00
Eric Traut
b7d18d7606 Merge branch 'etraut/next-turn-state-remove-override-context' into etraut/next-turn-state-core
# Conflicts:
#	codex-rs/core/src/session/handlers.rs
2026-05-18 16:09:13 -07:00
Eric Traut
76447889f2 Merge branch 'etraut/next-turn-state-input-op-consolidation' into etraut/next-turn-state-remove-override-context 2026-05-18 16:08:16 -07:00
Eric Traut
dea732b035 Merge branch 'etraut/next-turn-state-remove-user-input-with-context' into etraut/next-turn-state-input-op-consolidation 2026-05-18 16:07:57 -07:00
Eric Traut
d3052c6136 Merge branch 'etraut/next-turn-state-user-input-context' into etraut/next-turn-state-remove-user-input-with-context 2026-05-18 16:07:45 -07:00