Commit Graph

6987 Commits

Author SHA1 Message Date
Ahmed Ibrahim
ada487fb3d Import multi-agent runtime resolver in session tests 2026-05-29 11:30:00 -07:00
Ahmed Ibrahim
9abd55660e Centralize resolved multi-agent runtime version 2026-05-29 11:22:02 -07:00
Ahmed Ibrahim
7de051e1ec Keep multi-agent thread limits in config resolution 2026-05-29 11:09:42 -07:00
Ahmed Ibrahim
d926f6c05e Simplify inherited multi-agent runtime handling 2026-05-29 11:05:59 -07:00
Ahmed Ibrahim
e9ef90c361 Keep fork spawn options within clippy argument limit 2026-05-29 10:43:24 -07:00
Ahmed Ibrahim
8193bcf143 Make spawned agents inherit parent multi-agent runtime 2026-05-29 10:31:46 -07:00
Ahmed Ibrahim
e92ded1249 Merge remote-tracking branch 'origin/codex/model-info-multi-agent-version' into codex/model-info-multi-agent-version 2026-05-29 10:19:55 -07:00
Ahmed Ibrahim
7e7a9eb340 Use resolved multi-agent version across runtime 2026-05-29 10:19:34 -07:00
Ahmed Ibrahim
b3655164a5 Merge branch 'main' into codex/model-info-multi-agent-version 2026-05-29 09:15:32 -07:00
Ahmed Ibrahim
abca78f62e Merge remote-tracking branch 'origin/main' into codex/model-info-multi-agent-version
# Conflicts:
#	codex-rs/app-server/tests/common/models_cache.rs
#	codex-rs/codex-api/tests/models_integration.rs
#	codex-rs/core/src/session/review.rs
#	codex-rs/core/src/session/turn_context.rs
#	codex-rs/core/src/tools/spec_plan.rs
#	codex-rs/core/src/tools/spec_plan_tests.rs
#	codex-rs/core/tests/suite/model_runtime_selectors.rs
#	codex-rs/core/tests/suite/model_switching.rs
#	codex-rs/core/tests/suite/models_cache_ttl.rs
#	codex-rs/core/tests/suite/personality.rs
#	codex-rs/core/tests/suite/remote_models.rs
#	codex-rs/core/tests/suite/rmcp_client.rs
#	codex-rs/core/tests/suite/spawn_agent_description.rs
#	codex-rs/core/tests/suite/view_image.rs
#	codex-rs/models-manager/src/model_info.rs
#	codex-rs/protocol/src/openai_models.rs
#	codex-rs/tools/src/tool_config_tests.rs
2026-05-29 09:14:58 -07:00
sayan-oai
96f1347fa3 Show activity for standalone web search calls (#24693)
## Why

Standalone `web.run` calls run in the extension, so they need normal
web-search progress activity while a request is in flight and durable
completed activity after a thread is reloaded.

Follow-up to #23823; uses the extension turn-item emission path added in
#24813.

## What changed

- Emit standalone `web.run` start/completion items through the host
turn-item emitter, preserving standard client delivery and rollout
persistence.
- Include useful completion detail for queries, image queries, and
literal-URL `open`/`find` commands.
- Render completed searches as `Searched the web` or `Searched the web
for <detail>`, with snapshot coverage for the detail-free case.
- Extend the app-server round-trip test to verify completed search
activity is reconstructed by `thread/read` after a fresh-process reload.

## Testing

- `just test -p codex-web-search-extension`
- `just test -p codex-app-server -E
"test(standalone_web_search_round_trips_encrypted_output)"`
2026-05-29 16:12:58 +00:00
Ahmed Ibrahim
aad293503c codex: address PR review feedback (#25032) 2026-05-29 09:06:20 -07:00
Ahmed Ibrahim
5577a9e148 [codex] Add model tool mode selector (#25031)
## Why
Some models need to select their code-execution behavior through model
catalog metadata. Models without that metadata must continue to follow
the existing `CodeMode` and `CodeModeOnly` feature flags, including when
a newer server sends an enum value this client does not recognize.

## What changed
- add optional `ModelInfo.tool_mode` metadata with `direct`,
`code_mode`, and `code_mode_only`
- treat omitted and unknown wire values as `None`
- resolve `None` from the existing feature flags
- carry the resolved `ToolMode` directly on `TurnContext`, outside
`Config`
- use the resolved value for turn creation, model switches, review
turns, tool planning, and code execution

## Coverage
- add protocol coverage for omitted, known, and unknown enum values
- add focused coverage for flag fallback and explicit metadata
overriding feature flags
- add core integration coverage that fetches remote model metadata
through `/v1/models` and verifies the outbound `/responses` tools for
explicit `direct` and `code_mode_only` selectors

## Stack
- followed by #25032
2026-05-29 09:05:05 -07:00
Abhinav
251b2412b2 Render multiline hook output in TUI (#24965)
# Why

Fixes #24529. Completed hook output in the TUI rendered each
`HookOutputEntry` as one ratatui line, so explicit newlines inside hook
output were not shown as separate transcript rows. That made multiline
`SessionStart.additionalContext` hard to inspect even though the
model-facing context path preserved the original text.

# What

- Split completed hook output entries on explicit newlines before
rendering them in `codex-rs/tui/src/history_cell/hook_cell.rs`.
- Keep the hook output prefix, such as `hook context:` or `warning:`, on
the first physical line only.
- Preserve explicit blank lines and render continuation lines with the
hook body indent.
- Add unit coverage for multiline context and warning output, plus a
chatwidget snapshot regression for `SessionStart` history output.

# Testing

- `cargo nextest run -p codex-tui completed_hook_multiline
hook_completed_before_reveal_renders_completed_without_running_flash`
- `just argument-comment-lint -p codex-tui -- --ignore-rust-version
--lib --tests`
2026-05-29 15:12:40 +00:00
jif-oai
b40ad0d84d Remove stale rollout TODO tests (#25106)
## Summary

Remove a stale `TODO(jif)` block of commented-out rollout listing tests
that still referenced an older listing API.

The current rollout listing behavior is covered by the active state DB
and filesystem fallback tests, so keeping the dead commented tests just
adds noise.

## Validation

- `just fmt`
- `just test -p codex-rollout`
2026-05-29 17:09:00 +02:00
jif-oai
27e256bc40 Handle goal usage limits from turn errors (#25095)
## Summary
- handle goal usage-limit turn errors in the goal extension
- exercise the extension path in the goal backend test

## Tests
- just fmt
- just test -p codex-goal-extension
- just fix -p codex-goal-extension
2026-05-29 15:39:05 +02:00
jif-oai
1c55bb2702 [codex] Improve built-in tool schema docs (#24794)
## Summary
- Clarify default, omission, and bounded behavior across built-in tool
schemas, including unified exec, classic shell, Code Mode exec/wait,
multi-agent, agent job, MCP resource, image, goal, plan, tool_search,
and test-sync fields.
- Convert update_plan status to an enum and add short field descriptions
where the schema previously relied on surrounding context.
- Remove the dedicated permission-approval schema test and keep only
updates to existing expected-spec tests.

## Validation
- Ran `just fmt`.
- Ran `git diff --check`.
- Did not run clippy or tests, per request.

Regression has been eval
[here](https://openai.slack.com/archives/C09GDSP1J9X/p1779905065496949)
and we proved there are no regressions
2026-05-29 13:32:19 +02:00
jif-oai
3deda3116c fix: main (#25075) 2026-05-29 12:53:31 +02:00
jif-oai
191c39aa75 Drop debug-client prompt state tracking (#25070)
Deletes `codex-rs/debug-client/src/state.rs` as one step in removing the
stale app-server debug client.

This intentionally leaves Cargo workspace and lockfile cleanup for a
later follow-up PR.
2026-05-29 12:51:23 +02:00
jif-oai
43fa4e5d25 Remove debug-client server event reader (#25069)
Deletes `codex-rs/debug-client/src/reader.rs` as one step in removing
the stale app-server debug client.

This intentionally leaves Cargo workspace and lockfile cleanup for a
later follow-up PR.
2026-05-29 12:51:19 +02:00
jif-oai
5c1387846d Delete debug-client JSONL output helper (#25068)
Deletes `codex-rs/debug-client/src/output.rs` as one step in removing
the stale app-server debug client.

This intentionally leaves Cargo workspace and lockfile cleanup for a
later follow-up PR.
2026-05-29 12:51:16 +02:00
jif-oai
e2b8ec616a Remove the debug-client CLI entrypoint (#25067)
Deletes `codex-rs/debug-client/src/main.rs` as one step in removing the
stale app-server debug client.

This intentionally leaves Cargo workspace and lockfile cleanup for a
later follow-up PR.
2026-05-29 12:51:12 +02:00
jif-oai
3d3cc5a953 Retire debug-client interactive command parsing (#25066)
Deletes `codex-rs/debug-client/src/commands.rs` as one step in removing
the stale app-server debug client.

This intentionally leaves Cargo workspace and lockfile cleanup for a
later follow-up PR.
2026-05-29 12:51:09 +02:00
jif-oai
1197c7d654 Delete debug-client app-server process plumbing (#25065)
Deletes `codex-rs/debug-client/src/client.rs` as one step in removing
the stale app-server debug client.

This intentionally leaves Cargo workspace and lockfile cleanup for a
later follow-up PR.
2026-05-29 12:51:05 +02:00
jif-oai
a9a92cbb0a Remove the generated debug-client README (#25064)
Deletes `codex-rs/debug-client/README.md` as one step in removing the
stale app-server debug client.

This intentionally leaves Cargo workspace and lockfile cleanup for a
later follow-up PR.
2026-05-29 12:51:01 +02:00
jif-oai
fc8c723553 Drop the stale debug-client manifest (#25063)
Deletes `codex-rs/debug-client/Cargo.toml` as one step in removing the
stale app-server debug client.

This intentionally leaves Cargo workspace and lockfile cleanup for a
later follow-up PR.
2026-05-29 12:50:58 +02:00
jif-oai
8f6a945ec9 Use inject_if_running for active goal steering (#24924)
## Why

This PR is stacked on #24918, which moves goal steering onto
source-labeled internal model context fragments. Active-turn goal
steering should use the same running-turn injection path as other
runtime steering, so those fragments enter the pending input queue as
`ResponseItem`s through the existing
[`Session::inject_if_running`](8d6f6cdf69/codex-rs/core/src/session/inject.rs (L12-L27))
behavior instead of through a goal-specific conversion wrapper.

## What Changed

- Exposes a narrow `CodexThread::inject_if_running` bridge for callers
that only hold a thread handle.
- Changes `ext/goal` active-turn steering to pass `ResponseItem`s
directly.
- Builds goal steering prompts as contextual internal model context
`ResponseItem`s before injecting them into the running turn.

## Testing

Not run locally; PR metadata update only.
2026-05-29 11:24:39 +02:00
Ahmed Ibrahim
ebe85c8af5 codex: assert serialized v1 namespace tool order 2026-05-29 01:31:33 -07:00
Ahmed Ibrahim
6261f33a4f codex: fix CI failure on PR #25032 2026-05-29 01:30:58 -07:00
Ahmed Ibrahim
a50eb62cd0 [codex] Add multi-agent selector integration coverage 2026-05-29 01:30:58 -07:00
Ahmed Ibrahim
581291bf68 [codex] Inline multi-agent version resolution 2026-05-29 01:30:58 -07:00
Ahmed Ibrahim
129b77b71b [codex] Resolve multi-agent version on turn context 2026-05-29 01:30:58 -07:00
Ahmed Ibrahim
512655e4b0 [codex] Simplify multi-agent version selection 2026-05-29 01:30:57 -07:00
Ahmed Ibrahim
1f68c3dbdd [codex] Add model multi-agent version selector 2026-05-29 01:30:57 -07:00
Ahmed Ibrahim
e558c37be5 codex: assert direct selector behavior independent of shell family 2026-05-29 01:30:56 -07:00
jif-oai
740d942f90 Use internal model context fragments for goal steering (#24918)
## Why

Goal steering is one form of runtime-owned model context, but the old
`<goal_context>` wrapper made the contextual-fragment hiding path
goal-specific. Using a source-labeled internal context fragment gives
core and extensions a shared shape for hidden model steering while
keeping those prompts out of visible turn history.

The change also keeps legacy `<goal_context>` messages recognized as
hidden contextual input so existing stored history does not start
rendering old goal-steering prompts as user-visible turn items.

## What Changed

- Replaces `GoalContext` with `InternalModelContextFragment` plus a
validated `InternalContextSource`.
- Renders goal steering as `<codex_internal_context
source="goal">...</codex_internal_context>`.
- Updates core goal steering and `ext/goal` steering to inject the new
internal-context fragment.
- Updates contextual-fragment, event-mapping, goal, and session tests
for the new wrapper.

## Test Coverage

- Adds coverage for detecting the new internal model context fragment.
- Preserves coverage for hiding legacy `<goal_context>` fragments.
- Verifies invalid internal context sources are rejected and arbitrary
context tags are not hidden.
- Updates goal steering/session assertions to expect the new
`source="goal"` wrapper.
2026-05-29 10:28:25 +02:00
Ahmed Ibrahim
79de1ac6f7 codex: preserve model switch in selector integration test 2026-05-29 01:23:24 -07:00
Ahmed Ibrahim
1657ac2983 codex: refresh remote model fixture in selector integration test 2026-05-29 01:10:58 -07:00
Ahmed Ibrahim
b030e34870 codex: fix CI failure on PR #25031 2026-05-29 00:57:20 -07:00
Ahmed Ibrahim
dbf5762796 [codex] Expose selector integration response body 2026-05-29 00:48:07 -07:00
Ahmed Ibrahim
ad9ab6eb34 [codex] Add tool mode selector integration coverage 2026-05-29 00:46:37 -07:00
Ahmed Ibrahim
c1713608ac [codex] Inline tool mode resolution 2026-05-29 00:40:33 -07:00
Ahmed Ibrahim
b138a8a992 [codex] Use ToolMode as resolved runtime value 2026-05-29 00:18:53 -07:00
Ahmed Ibrahim
7c264fbbd2 [codex] Keep tool mode runtime state out of config 2026-05-29 00:07:40 -07:00
Ahmed Ibrahim
1756422e41 [codex] Add model tool mode metadata selector 2026-05-29 00:00:20 -07:00
Eric Traut
522f549922 Fix fs/watch debounce batching (#24716)
## Summary

`fs/watch` was using a local debounce wrapper whose deadline was
initialized once and then reused after the first batch. Once that stale
deadline was in the past, later file changes could bypass the intended
200ms debounce and send noisier `fs/changed` notifications.

This moves the debounce wrapper into `codex-file-watcher` as
`DebouncedWatchReceiver`, resets the debounce deadline for each event
batch, preserves pending paths across cancelled receives, and updates
app-server `fs/watch` to use the shared wrapper.

Fixes #24692.
2026-05-28 23:09:55 -07:00
Michael Bolin
6e10142199 fix: preserve deny-read sandboxing for safe commands (#23943)
## Why

Permission profiles can mark filesystem entries as unreadable with
`deny` rules, including glob patterns. Several shell execution paths
treated known-safe commands or execpolicy `allow` rules as sufficient to
run outside the filesystem sandbox. That is not valid for read-capable
commands: for example, `cat` or `ls` may be reasonable to allow
generally, but dropping the sandbox would also drop deny-read
constraints such as `**/*.env`.

## What changed

- Added a shared check that treats active deny-read restrictions as
incompatible with unsandboxed execution.
- Kept first-attempt execution sandboxed for explicit escalation and
execpolicy allow bypasses when deny-read entries are present.
- Prevented no-sandbox retry after a sandbox denial when the active
filesystem policy contains deny-read entries.
- Updated the zsh-fork execve path so prefix-rule `allow` decisions
continue inside the current sandbox when deny-read restrictions are
active.

## Verification

- `cargo test -p codex-core tools::sandboxing::tests`
- `cargo test -p codex-core
tools::runtimes::shell::unix_escalation::tests`
- `cargo test -p codex-core
shell_command_enforces_glob_deny_read_policy`
2026-05-28 22:49:37 -07:00
Eric Traut
56958f2512 Seed prompt history from resumed messages (#24298)
## Why

When the TUI resumes a thread, transcript replay renders prior user
messages but did not seed the composer history. That leaves the resumed
session with empty in-memory prompt history, so pressing Up can fall
through to persisted global history and surface a prompt from another
thread.

The expected behavior is that prompts from the resumed thread are
recalled first, with global history only as a fallback.

## What changed

- Record replayed user messages into the composer history during resume
replay.
- Preserve the existing persisted history format and avoid any startup
history scan.
- Add focused TUI coverage showing replayed prompts are recalled before
persisted global history.

## Validation

- Added `replayed_user_messages_seed_composer_history` in
`codex-rs/tui/src/chatwidget/tests/history_replay.rs`.
- `just test -p codex-tui replayed_user_messages_seed_composer_history`
passed.
2026-05-28 22:08:05 -07:00
xl-openai
f0a839ea0c Add runtime extra skill roots API (#24977)
## Summary
- Add v2 `skills/extraRoots/set` to replace app-server process-local
standalone skill roots. The setting is not persisted, accepts missing
roots, and `extraRoots: []` clears the runtime set.
- Wire runtime roots into core skill discovery for `skills/list` and
turn loads, clear skill caches on set, and register the roots with the
skills watcher so later filesystem changes emit `skills/changed`.
- Update app-server docs, generated JSON/TypeScript schemas, and
coverage for serialization, missing roots, empty clears, and restart
behavior.

## Testing
- `cargo test -p codex-app-server-protocol`
- `cargo test -p codex-core-skills`
- `cargo test -p codex-app-server
skills_extra_roots_set_updates_process_runtime_roots`
- `just fix -p codex-app-server-protocol`
- `just fix -p codex-core-skills`
- `just fix -p codex-app-server`
2026-05-28 21:14:34 -07:00
Adrian
42c80385cd [codex] Avoid PowerShell safety parsing off Windows (#24946)
## Summary

This fixes BUGB-17567 by preventing non-Windows command safety
classification from invoking the Windows PowerShell safelist/parser
path.

Previously, `is_known_safe_command` called the Windows PowerShell
classifier on every platform. That classifier recognizes
`pwsh`/`powershell` by basename and delegates script parsing to the
PowerShell AST parser. The parser starts the supplied executable, so on
macOS/Linux a repository-controlled `pwsh` path could execute during
safety parsing before the normal sandboxed command execution path.

The change gates the Windows PowerShell classifier and module behind
`#[cfg(windows)]`. On macOS/Linux, PowerShell-looking commands are no
longer auto-approved by the Windows classifier and instead fall through
to the normal non-Windows safe-command logic.

## Validation

- `/private/tmp/codex-tools/bin/just fmt`
- `PATH=/private/tmp/codex-tools/bin:$PATH
/private/tmp/codex-tools/bin/just test -p codex-shell-command`

The focused test run passed 135 tests with 0 skipped and completed the
crate bench-smoke step.

## Notes

This PR is scoped to the BUGB-17567 macOS/Linux path. Windows still uses
the PowerShell classifier; a separate hardening follow-up should ensure
Windows safety parsing only executes a trusted PowerShell parser binary
and does not spawn the command's `argv[0]` when that path may be
repository-controlled.
2026-05-29 03:00:35 +00:00