Commit Graph

9551 Commits

Author SHA1 Message Date
Michael Bolin
f4c0171554 merge commit for archive created by Sapling 2026-03-13 15:58:31 -07:00
Michael Bolin
f9cf5e7463 refactor: model unified-exec shell mode explicitly 2026-03-13 15:58:20 -07:00
Michael Bolin
a6871fa69f Merge 0b89b8ef3a into sapling-pr-archive-bolinfest 2026-03-13 15:52:30 -07:00
Michael Bolin
0b89b8ef3a refactor: model unified-exec shell mode explicitly 2026-03-13 15:52:26 -07:00
Michael Bolin
b1948bf39d merge commit for archive created by Sapling 2026-03-13 15:52:04 -07:00
Michael Bolin
60bbc71ef4 refactor: model unified-exec shell mode explicitly 2026-03-13 15:51:36 -07:00
Michael Bolin
e45bffcfbd merge commit for archive created by Sapling 2026-03-13 15:44:46 -07:00
Michael Bolin
93f9ca917d refactor: model unified-exec shell mode explicitly 2026-03-13 15:44:37 -07:00
Michael Bolin
ecc15f6468 Merge 7732b60344 into sapling-pr-archive-bolinfest 2026-03-13 15:38:01 -07:00
Michael Bolin
7732b60344 refactor: model unified-exec shell mode explicitly 2026-03-13 15:37:53 -07:00
Michael Bolin
8e48907745 merge commit for archive created by Sapling 2026-03-13 15:15:05 -07:00
Michael Bolin
0ea98aefae refactor: model unified-exec shell mode explicitly 2026-03-13 15:14:58 -07:00
Michael Bolin
75053d4eda merge commit for archive created by Sapling 2026-03-13 15:02:51 -07:00
Michael Bolin
24d61f2d08 refactor: model unified-exec shell mode explicitly 2026-03-13 15:02:37 -07:00
Michael Bolin
d71b38bc60 merge commit for archive created by Sapling 2026-03-13 14:34:21 -07:00
Michael Bolin
2e2183ca68 refactor: model unified-exec shell mode explicitly 2026-03-13 14:34:08 -07:00
Michael Bolin
743eb1956c merge commit for archive created by Sapling 2026-03-13 13:50:50 -07:00
Michael Bolin
e2aa9dd338 refactor: route zsh-fork through unified exec 2026-03-13 13:50:43 -07:00
Michael Bolin
b48aa092bf Merge a55560f5d9 into sapling-pr-archive-bolinfest 2026-03-13 13:34:32 -07:00
Michael Bolin
a55560f5d9 refactor: route zsh-fork through unified exec 2026-03-13 13:32:40 -07:00
pakrym-oai
477a2dd345 Add code_mode_only feature (#14617)
Summary
- add the code_mode_only feature flag/config schema and wire its
dependency on code_mode
- update code mode tool descriptions to list nested tools with detailed
headers
- restrict available tools for prompt and exec descriptions when
code_mode_only is enabled and test the behavior

Testing
- Not run (not requested)
2026-03-13 13:30:19 -07:00
Michael Bolin
ef37d313c6 fix: preserve zsh-fork escalation fds across unified-exec spawn paths (#13644)
## Why

`zsh-fork` sessions launched through unified-exec need the escalation
socket to survive the wrapper -> server -> child handoff so later
intercepted `exec()` calls can still reach the escalation server.

The inherited-fd spawn path also needs to avoid closing Rust's internal
exec-error pipe, and the shell-escalation handoff needs to tolerate the
receive-side case where a transferred fd is installed into the same
stdio slot it will be mapped onto.

## What Changed

- Added `SpawnLifecycle::inherited_fds()` in
`codex-rs/core/src/unified_exec/process.rs` and threaded inherited fds
through `codex-rs/core/src/unified_exec/process_manager.rs` so
unified-exec can preserve required descriptors across both PTY and
no-stdin pipe spawn paths.
- Updated `codex-rs/core/src/tools/runtimes/shell/zsh_fork_backend.rs`
to expose the escalation socket fd through the spawn lifecycle.
- Added inherited-fd-aware spawn helpers in
`codex-rs/utils/pty/src/pty.rs` and `codex-rs/utils/pty/src/pipe.rs`,
including Unix pre-exec fd pruning that preserves requested inherited
fds while leaving `FD_CLOEXEC` descriptors alone. The pruning helper is
now named `close_inherited_fds_except()` to better describe that
behavior.
- Updated `codex-rs/shell-escalation/src/unix/escalate_client.rs` to
duplicate local stdio before transfer and send destination stdio numbers
in `SuperExecMessage`, so the wrapper keeps using its own
`stdin`/`stdout`/`stderr` until the escalated child takes over.
- Updated `codex-rs/shell-escalation/src/unix/escalate_server.rs` so the
server accepts the overlap case where a received fd reuses the same
stdio descriptor number that the child setup will target with `dup2`.
- Added comments around the PTY stdio wiring and the overlap regression
helper to make the fd handoff and controlling-terminal setup easier to
follow.

## Verification

- `cargo test -p codex-utils-pty`
- covers preserved-fd PTY spawn behavior, PTY resize, Python REPL
continuity, exec-failure reporting, and the no-stdin pipe path
- `cargo test -p codex-shell-escalation`
- covers duplicated-fd transfer on the client side and verifies the
overlap case by passing a pipe-backed stdin payload through the
server-side `dup2` path

---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/13644).
* #14624
* __->__ #13644
2026-03-13 20:25:31 +00:00
Owen Lin
014e19510d feat(app-server, core): add more spans (#14479)
## Description

This PR expands tracing coverage across app-server thread startup, core
session initialization, and the Responses transport layer. It also gives
core dispatch spans stable operation-specific names so traces are easier
to follow than the old generic `submission_dispatch` spans.

Also use `fmt::Display` for types that we serialize in traces so we send
strings instead of rust types
2026-03-13 13:16:33 -07:00
Michael Bolin
bec183622e Merge fc100c0574 into sapling-pr-archive-bolinfest 2026-03-13 13:10:18 -07:00
Michael Bolin
1df0fadaf8 merge commit for archive created by Sapling 2026-03-13 12:57:40 -07:00
Michael Bolin
fc100c0574 refactor: route zsh-fork through unified exec 2026-03-13 12:57:31 -07:00
Michael Bolin
ab58df4559 fix: preserve zsh-fork escalation fds in unified-exec PTYs 2026-03-13 12:57:31 -07:00
Michael Bolin
6b39742e82 merge commit for archive created by Sapling 2026-03-13 12:56:26 -07:00
Michael Bolin
84ec355b2d fix: preserve zsh-fork escalation fds in unified-exec PTYs 2026-03-13 12:56:12 -07:00
canvrno-oai
914f7c7317 Override local apps settings with requirements.toml settings (#14304)
This PR changes app and connector enablement when `requirements.toml` is
present locally or via remote configuration.

For apps.* entries:
- `enabled = false` in `requirements.toml` overrides the user’s local
`config.toml` and forces the app to be disabled.
- `enabled = true` in `requirements.toml` does not re-enable an app the
user has disabled in config.toml.

This behavior applies whether or not the user has an explicit entry for
that app in `config.toml`. It also applies to cloud-managed policies and
configurations when the admin sets the override through
`requirements.toml`.

Scenarios tested and verified:
- Remote managed, user config (present) override
- Admin-defined policies & configurations include a connector override:
  `[apps.<appID>]
enabled = false`
- User's config.toml has the same connector configured with `enabled =
true`
  - TUI/App should show connector as disabled
  - Connector should be unavailable for use in the composer
  
- Remote managed, user config (absent) override
- Admin-defined policies & configurations include a connector override:
  `[apps.<appID>]
enabled = false`
  - User's config.toml has no entry for the the same connector
  - TUI/App should show connector as disabled
  - Connector should be unavailable for use in the composer
  
- Locally managed, user config (present) override
  - Local requirements.toml includes a connector override:
  `[apps.<appID>]
enabled = false`
- User's config.toml has the same connector configured with `enabled =
true`
  - TUI/App should show connector as disabled
  - Connector should be unavailable for use in the composer

- Locally managed, user config (absent) override
  - Local requirements.toml includes a connector override:
  `[apps.<appID>]
enabled = false`
  - User's config.toml has no entry for the the same connector
  - TUI/App should show connector as disabled
  - Connector should be unavailable for use in the composer




<img width="1446" height="753" alt="image"
src="https://github.com/user-attachments/assets/61c714ca-dcca-4952-8ad2-0afc16ff3835"
/>
<img width="595" height="233" alt="image"
src="https://github.com/user-attachments/assets/7c8ab147-8fd7-429a-89fb-591c21c15621"
/>
2026-03-13 12:40:24 -07:00
Ahmed Ibrahim
d58620c852 Use subagents naming in the TUI (#14618)
- rename user-facing TUI multi-agent wording to subagents
- rename the surfaced slash command to `subagents` and update
tests/snapshots

Co-authored-by: Codex <noreply@openai.com>
2026-03-13 19:08:38 +00:00
Ruslan Nigmatullin
50558e6507 app-server: Add platform os and family to init response (#14527)
This allows the client to pick os-specific behavior while interacting
with the app server, e.g. to use proper path separators.
2026-03-13 19:07:54 +00:00
Michael Bolin
0ea5de5708 merge commit for archive created by Sapling 2026-03-13 12:01:42 -07:00
Michael Bolin
456e627a03 fix: preserve zsh-fork escalation fds in unified-exec PTYs 2026-03-13 12:01:30 -07:00
Michael Bolin
77eff0c07f merge commit for archive created by Sapling 2026-03-13 11:52:59 -07:00
Michael Bolin
04e5b689d4 fix: preserve zsh-fork escalation fds in unified-exec PTYs 2026-03-13 11:52:28 -07:00
Ahmed Ibrahim
3aabce9e0a Unify realtime v1/v2 session config (#14606)
## Summary
- unify realtime websocket settings under `[realtime]` (`version` and
`type`)
- remove `realtime_conversation_v2` and select parser/session mode from
config

## Testing
- not run (per request)

---------

Co-authored-by: Codex <noreply@openai.com>
2026-03-13 11:35:38 -07:00
Eric Traut
9dba7337f2 Start TUI on embedded app server (#14512)
This PR is part of the effort to move the TUI on top of the app server.
In a previous PR, we introduced an in-process app server and moved
`exec` on top of it.

For the TUI, we want to do the migration in stages. The app server
doesn't currently expose all of the functionality required by the TUI,
so we're going to need to support a hybrid approach as we make the
transition.

This PR changes the TUI initialization to instantiate an in-process app
server and access its `AuthManager` and `ThreadManager` rather than
constructing its own copies. It also adds a placeholder TUI event
handler that will eventually translate app server events into TUI
events. App server notifications are accepted but ignored for now. It
also adds proper shutdown of the app server when the TUI terminates.
2026-03-13 12:04:41 -06:00
zbarsky-openai
8567e3a5c7 [bazel] Bump up cc and rust toolchains (#14542)
This lets us drop various patches and go all the way to a very clean
setup.

In case folks are curious what was going on... we were depending on the
toolchain finding stdlib headers as sibling files of `clang++`, and for
linking we were providing a `-resource-dir` containing the runtime libs.
However, some users of the cc toolchain (such as rust build scripts) do
the equivalent of `$CC $CCFLAGS $LDFLAGS` so the `-resource-dir` was
being passed when compiling, which suppressed the default stdlib header
location logic. The upstream fix was to swap to using `-isystem` to pass
the stdlib headers, while carefully controlling the ordering to simulate
them coming from the resource-dir.
2026-03-13 18:01:38 +00:00
sayan-oai
9f2da5a9ce chore: clarify plugin + app copy in model instructions (#14541)
- clarify app mentions are in user messages
- clarify what it means for tools to be provided via `codex_apps` MCP
- add plugin descriptions (with basic sanitization) to top-level `##
Plugins` section alongside the corresponding plugin names
- explain that skills from plugins are prefixed with `plugin_name:` in
top-level `##Plugins` section

changes to more logically organize `Apps`, `Skills`, and `Plugins`
instructions will be in a separate PR, as that shuffles dev + user
instructions in ways that change tests broadly.

### Tests
confirmed in local rollout, some new tests.
2026-03-13 10:57:41 -07:00
Jack Mousseau
59b588b8ec Improve granular approval policy prompt (#14553) 2026-03-13 10:42:17 -07:00
Michael Bolin
1281adf54e merge commit for archive created by Sapling 2026-03-13 10:41:02 -07:00
Michael Bolin
374a9a6bcb refactor: route zsh-fork through unified exec 2026-03-13 10:40:18 -07:00
Michael Bolin
7e58a83e89 fix: preserve zsh-fork escalation fds in unified-exec PTYs 2026-03-13 10:40:06 -07:00
Won Park
958f93f899 sending back imagaegencall response back to responseapi (#14558)
Sending back the ResponseItem::ImageGenerationCall as is, because it is
now supported from the API-side.
2026-03-13 17:29:19 +00:00
Michael Bolin
433f994ca9 Merge 2be2c19aa1 into sapling-pr-archive-bolinfest 2026-03-13 10:19:09 -07:00
Michael Bolin
2be2c19aa1 refactor: route zsh-fork through unified exec 2026-03-13 10:19:00 -07:00
Michael Bolin
eeb1e304f4 fix: preserve zsh-fork escalation fds in unified-exec PTYs 2026-03-13 10:18:59 -07:00
iceweasel-oai
6b3d82daca Use a private desktop for Windows sandbox instead of Winsta0\Default (#14400)
## Summary
- launch Windows sandboxed children on a private desktop instead of
`Winsta0\Default`
- make private desktop the default while keeping
`windows.sandbox_private_desktop=false` as the escape hatch
- centralize process launch through the shared
`create_process_as_user(...)` path
- scope the private desktop ACL to the launching logon SID

## Why
Today sandboxed Windows commands run on the visible shared desktop. That
leaves an avoidable same-desktop attack surface for window interaction,
spoofing, and related UI/input issues. This change moves sandboxed
commands onto a dedicated per-launch desktop by default so the sandbox
no longer shares `Winsta0\Default` with the user session.

The implementation stays conservative on security with no silent
fallback back to `Winsta0\Default`

If private-desktop setup fails on a machine, users can still opt out
explicitly with `windows.sandbox_private_desktop=false`.

## Validation
- `cargo build -p codex-cli`
- elevated-path `codex exec` desktop-name probe returned
`CodexSandboxDesktop-*`
- elevated-path `codex exec` smoke sweep for shell commands, nested
`pwsh`, jobs, and hidden `notepad` launch
- unelevated-path full private-desktop compatibility sweep via `codex
exec` with `-c windows.sandbox=unelevated`
2026-03-13 10:13:39 -07:00
pakrym-oai
9c9867c9fa code mode: single line tool declarations (#14526)
## Summary
- render code mode tool declarations as single-line TypeScript snippets
- make the JSON schema renderer emit inline object shapes for these
declarations
- update code mode/spec expectations to match the new inline rendering

## Testing
- `just fmt`
- `cargo test -p codex-core render_json_schema_to_typescript`
- `cargo test -p codex-core code_mode_augments_`
- `cargo test -p codex-core --test all exports_all_tools_metadata --
--nocapture`
2026-03-13 10:08:34 -07:00