Commit Graph

8634 Commits

Author SHA1 Message Date
Michael Bolin
b27bc46ee9 Use Arc-based ToolCtx in tool runtimes 2026-02-23 08:10:38 -08:00
Michael Bolin
d11b22c00d feat: split core business logic from exec-server to shell-escalation 2026-02-23 08:10:38 -08:00
jif-oai
2119532a81 feat: role metrics multi-agent (#12579)
add metrics for agent role
2026-02-23 15:55:48 +00:00
Eric Traut
862a5b3eb3 Allow exec resume to parse output-last-message flag after command (#12541)
Summary
- mark `output-last-message` as a global exec flag so it can follow
subcommands like `resume`
- add regression tests in both `cli` and `exec` crates verifying the
flag order works when invoking `resume`

Fixes #12538
2026-02-23 07:55:37 -08:00
jif-oai
e8709bc11a chore: rename memory feature flag (#12580)
`memory_tool` -> `memories`
2026-02-23 15:37:12 +00:00
jif-oai
764ac9449f feat: add uuid helper (#12500) 2026-02-23 14:14:36 +00:00
jif-oai
cf0210bf22 feat: agent nick names to model (#12575) 2026-02-23 13:44:37 +00:00
jif-oai
829d1080f6 feat: keep dead agents in the agent picker (#12570) 2026-02-23 12:58:55 +00:00
jif-oai
9d826a20c6 fix: TUI constraint (#12571) 2026-02-23 12:49:54 +00:00
jif-oai
6fbf19ef5f chore: phase 2 name (#12568) 2026-02-23 11:04:55 +00:00
jif-oai
2b9d0c385f chore: add doc to memories (#12565)
]
2026-02-23 10:52:58 +00:00
jif-oai
cfcbff4c48 chore: awaiter (#12562) 2026-02-23 10:28:24 +00:00
jif-oai
8e9312958d chore: nit name (#12559) 2026-02-23 08:49:41 +00:00
Michael Bolin
956f2f439e refactor: decouple MCP policy construction from escalate server (#12555)
## Why
The current escalate path in `codex-rs/exec-server` still had policy
creation coupled to MCP details, which makes it hard to reuse the shell
execution flow outside the MCP server. This change is part of a broader
goal to split MCP-specific behavior from shared escalation execution so
other handlers (for example a future `ShellCommandHandler`) can reuse it
without depending on MCP request context types.

## What changed
- Added a new `EscalationPolicyFactory` abstraction in `mcp.rs`:
  - `crate`-relative path: `codex-rs/exec-server/src/posix/mcp.rs`
-
https://github.com/openai/codex/blob/main/codex-rs/exec-server/src/posix/mcp.rs#L87-L107
- Made `run_escalate_server` in `mcp.rs` accept a policy factory instead
of constructing `McpEscalationPolicy` directly.
-
https://github.com/openai/codex/blob/main/codex-rs/exec-server/src/posix/mcp.rs#L178-L201
- Introduced `McpEscalationPolicyFactory` that stores MCP-only state
(`RequestContext`, `preserve_program_paths`) and implements the new
trait.
-
https://github.com/openai/codex/blob/main/codex-rs/exec-server/src/posix/mcp.rs#L100-L117
- Updated `shell()` to pass a `McpEscalationPolicyFactory` instance into
`run_escalate_server`, so the server remains the MCP-specific wiring
layer.
-
https://github.com/openai/codex/blob/main/codex-rs/exec-server/src/posix/mcp.rs#L163-L170

## Verification
- Build and test execution was not re-run in this pass; changes are
limited to `mcp.rs` and preserve the existing escalation flow semantics
by only extracting policy construction behind a factory.




---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/12555).
* #12556
* __->__ #12555
2026-02-23 00:31:29 -08:00
Michael Bolin
6c651f33f6 merge commit for archive created by Sapling 2026-02-23 00:26:00 -08:00
Michael Bolin
c3df4f8b48 feat: split core business logic from exec-server to shell-escalation 2026-02-23 00:25:53 -08:00
Michael Bolin
de87bc8a42 merge commit for archive created by Sapling 2026-02-23 00:25:44 -08:00
Michael Bolin
056ddb789b feat: split core business logic from exec-server to shell-escalation 2026-02-23 00:06:00 -08:00
Michael Bolin
2b9d728e90 merge commit for archive created by Sapling 2026-02-22 23:48:41 -08:00
Michael Bolin
7cbc2e024a feat: split core business logic from exec-server to shell-escalation 2026-02-22 23:48:36 -08:00
Michael Bolin
ab26c80df3 merge commit for archive created by Sapling 2026-02-22 23:40:02 -08:00
Michael Bolin
a8b8c82787 feat: split core business logic from exec-server to shell-escalation 2026-02-22 23:39:49 -08:00
Michael Bolin
ef0dbe3a48 Merge 50b74d84eb into sapling-pr-archive-bolinfest 2026-02-22 23:17:51 -08:00
Michael Bolin
50b74d84eb feat: refactor logic in exec-server for general use 2026-02-22 23:17:37 -08:00
pakrym-oai
335a4e1cbc Return image content from view_image (#12553)
Responses API supports image content
2026-02-22 23:00:08 -08:00
Michael Bolin
d1e6aba028 merge commit for archive created by Sapling 2026-02-22 20:01:11 -08:00
Michael Bolin
4cfc116d7f refactor: unify zsh fork shell tool with fd-based bridge 2026-02-22 20:01:03 -08:00
Michael Bolin
e8949f4507 test: vendor zsh fork via DotSlash and stabilize zsh-fork tests (#12518)
## Why

The zsh integration tests were still brittle in two ways:

- they relied on `CODEX_TEST_ZSH_PATH` / environment-specific setup, so
they often did not exercise the patched zsh fork that `shell-tool-mcp`
ships
- once the tests consistently used the vendored zsh fork, they exposed
real Linux-specific zsh-fork issues in CI

In particular, the Linux failures were not just test noise:

- the zsh-fork launch path was dropping `ExecRequest.arg0`, so Linux
`codex-linux-sandbox` arg0 dispatch did not run and zsh wrapper-mode
could receive malformed arguments
- the
`turn_start_shell_zsh_fork_subcommand_decline_marks_parent_declined_v2`
test uses the zsh exec bridge (which talks to the parent over a Unix
socket), but Linux restricted sandbox seccomp denies `connect(2)`,
causing timeouts on `ubuntu-24.04` x86/arm

This PR makes the zsh tests consistently run against the intended
vendored zsh fork and fixes/hardens the zsh-fork path so the Linux CI
signal is meaningful.

## What Changed

- Added a single shared test-only DotSlash file for the patched zsh fork
at `codex-rs/exec-server/tests/suite/zsh` (analogous to the existing
`bash` test resource).
- Updated both app-server and exec-server zsh tests to use that shared
DotSlash zsh (no duplicate zsh DotSlash file, no `CODEX_TEST_ZSH_PATH`
dependency).
- Updated the app-server zsh-fork test helper to resolve the shared
DotSlash zsh and avoid silently falling back to host zsh.
- Kept the app-server zsh-fork tests configured via `config.toml`, using
a test wrapper path where needed to force `zsh -df` (and rewrite `-lc`
to `-c`) for the subcommand-decline test.
- Hardened the app-server subcommand-decline zsh-fork test for CI
variability:
  - tolerate an extra `/responses` POST with a no-op mock response
- tolerate non-target approval ordering while remaining strict on the
two `/usr/bin/true` approvals and decline behavior
- use `DangerFullAccess` on Linux for this one test because it validates
zsh approval flow, not Linux sandbox socket restrictions
- Fixed zsh-fork process launching on Linux by preserving `req.arg0` in
`ZshExecBridge::execute_shell_request(...)` so `codex-linux-sandbox`
arg0 dispatch continues to work.
- Moved `maybe_run_zsh_exec_wrapper_mode()` under
`arg0_dispatch_or_else(...)` in `app-server` and `cli` so wrapper-mode
handling coexists correctly with arg0-dispatched helper modes.
- Consolidated duplicated `dotslash -- fetch` resolution logic into
shared test support (`core/tests/common/lib.rs`).
- Updated `codex-rs/exec-server/tests/suite/accept_elicitation.rs` to
use DotSlash zsh and hardened the zsh elicitation test for Bazel/zsh
differences by:
  - resolving an absolute `git` path
  - running `git init --quiet .`
- asserting success / `.git` creation instead of relying on banner text

## Verification

- `cargo test -p codex-app-server turn_start_zsh_fork -- --nocapture`
- `cargo test -p codex-exec-server accept_elicitation -- --nocapture`
- `bazel test //codex-rs/exec-server:exec-server-all-test
--test_output=streamed --test_arg=--nocapture
--test_arg=accept_elicitation_for_prompt_rule_with_zsh`
- CI (`rust-ci`) on the final cleaned commit: `Tests — ubuntu-24.04 -
x86_64-unknown-linux-gnu` and `Tests — ubuntu-24.04-arm -
aarch64-unknown-linux-gnu` passed in [run
22291424358](https://github.com/openai/codex/actions/runs/22291424358)
2026-02-22 19:39:56 -08:00
Michael Bolin
af4695422f merge commit for archive created by Sapling 2026-02-22 19:03:47 -08:00
Michael Bolin
d158fc8e5a feat: use DotSlash to fetch zsh fork for tests 2026-02-22 19:03:36 -08:00
Michael Bolin
398556bf1a Merge c8e94229e6 into sapling-pr-archive-bolinfest 2026-02-22 18:49:37 -08:00
Michael Bolin
c8e94229e6 feat: use DotSlash to fetch zsh fork for tests 2026-02-22 18:49:30 -08:00
Michael Bolin
5d7feebe6d Merge 1659e2b563 into sapling-pr-archive-bolinfest 2026-02-22 18:36:34 -08:00
Michael Bolin
1659e2b563 feat: use DotSlash to fetch zsh fork for tests 2026-02-22 18:36:28 -08:00
Michael Bolin
ee998ba202 merge commit for archive created by Sapling 2026-02-22 18:25:17 -08:00
Michael Bolin
6eca037ca6 feat: use DotSlash to fetch zsh fork for tests 2026-02-22 18:25:06 -08:00
Michael Bolin
0a4d77373f merge commit for archive created by Sapling 2026-02-22 17:58:44 -08:00
Michael Bolin
706dec6b66 feat: use DotSlash to fetch zsh fork for tests 2026-02-22 17:58:40 -08:00
Michael Bolin
28d7587de4 merge commit for archive created by Sapling 2026-02-22 17:44:37 -08:00
Michael Bolin
ac80a626de feat: use DotSlash to fetch zsh fork for tests 2026-02-22 17:44:29 -08:00
Michael Bolin
1243ba644a Merge 719dd7e0e2 into sapling-pr-archive-bolinfest 2026-02-22 17:26:51 -08:00
Michael Bolin
719dd7e0e2 feat: use DotSlash to fetch zsh fork for tests 2026-02-22 17:26:48 -08:00
Michael Bolin
10a6cdba1d Merge 2aa40942af into sapling-pr-archive-bolinfest 2026-02-22 17:23:02 -08:00
Michael Bolin
2aa40942af feat: use DotSlash to fetch zsh fork for tests 2026-02-22 17:22:58 -08:00
Michael Bolin
aa7b86b2ad merge commit for archive created by Sapling 2026-02-22 17:21:04 -08:00
Michael Bolin
79b1dd88df feat: use DotSlash to fetch zsh fork for tests 2026-02-22 17:20:59 -08:00
Michael Bolin
008a77f3c5 merge commit for archive created by Sapling 2026-02-22 17:20:39 -08:00
Michael Bolin
52c6bac663 feat: use DotSlash to fetch zsh fork for tests 2026-02-22 17:20:34 -08:00
Michael Bolin
7be4c734d4 merge commit for archive created by Sapling 2026-02-22 17:18:08 -08:00
Michael Bolin
0b7f018b1f feat: use DotSlash to fetch zsh fork for tests 2026-02-22 17:16:07 -08:00