Commit Graph

4686 Commits

Author SHA1 Message Date
Eric Traut
375af6e9d0 codex: satisfy goal TUI argument lint 2026-04-15 22:58:15 -07:00
Eric Traut
8baac58662 Merge branch 'goal-mode-4-core-runtime' into goal-mode-5-tui 2026-04-15 22:44:57 -07:00
Eric Traut
1dafa9dc01 Merge branch 'goal-mode-3-tools' into goal-mode-4-core-runtime 2026-04-15 22:44:45 -07:00
Eric Traut
4fef6ac562 codex: satisfy goal tool argument lint 2026-04-15 22:44:34 -07:00
Eric Traut
effaf92886 Merge branch 'goal-mode-4-core-runtime' into goal-mode-5-tui 2026-04-15 22:42:07 -07:00
Eric Traut
caa3880201 codex: account stopped goals before set_goal returns 2026-04-15 22:41:57 -07:00
Eric Traut
de645ea22e Merge branch 'goal-mode-4-core-runtime' into goal-mode-5-tui 2026-04-15 22:32:39 -07:00
Eric Traut
989c4cbafb codex: address PR review feedback (#18076) 2026-04-15 22:32:12 -07:00
Eric Traut
1e0e357884 Merge branch 'goal-mode-3-tools' into goal-mode-4-core-runtime 2026-04-15 22:29:24 -07:00
Eric Traut
3ff6be1760 Merge branch 'goal-mode-2-app-server' into goal-mode-3-tools 2026-04-15 22:28:54 -07:00
Eric Traut
08db8ed2e2 codex: address PR review feedback (#18074) 2026-04-15 22:28:23 -07:00
Eric Traut
761a7dc8c1 Merge branch 'goal-mode-4-core-runtime' into goal-mode-5-tui
# Conflicts:
#	codex-rs/tui/src/chatwidget.rs
2026-04-15 22:25:22 -07:00
Eric Traut
419aaf55ca Merge branch 'goal-mode-3-tools' into goal-mode-4-core-runtime 2026-04-15 22:20:28 -07:00
Eric Traut
55bb03e0ca Merge branch 'goal-mode-2-app-server' into goal-mode-3-tools 2026-04-15 22:20:14 -07:00
Eric Traut
5e402792d7 codex: fix CI failure on PR #18074 2026-04-15 22:19:46 -07:00
Eric Traut
0384799747 Merge branch 'goal-mode-4-core-runtime' into goal-mode-5-tui 2026-04-15 22:17:17 -07:00
Eric Traut
8974a62919 codex: address PR review feedback (#18076) 2026-04-15 22:17:06 -07:00
Eric Traut
cfc6d9df53 codex: address PR review feedback (#18077) 2026-04-15 22:14:46 -07:00
Eric Traut
a6e965852e Merge branch 'goal-mode-4-core-runtime' into goal-mode-5-tui 2026-04-15 22:11:33 -07:00
Eric Traut
737f829dff Merge branch 'goal-mode-3-tools' into goal-mode-4-core-runtime 2026-04-15 22:11:19 -07:00
Eric Traut
042e6b3e5e Merge branch 'goal-mode-2-app-server' into goal-mode-3-tools 2026-04-15 22:11:03 -07:00
Eric Traut
8742288072 Merge branch 'goal-mode-1-state' into goal-mode-2-app-server 2026-04-15 22:10:50 -07:00
Eric Traut
a7897034ee codex: address PR review feedback (#18073) 2026-04-15 22:10:38 -07:00
Eric Traut
cf8873c618 codex: carry goal status rename into TUI 2026-04-15 22:08:16 -07:00
Eric Traut
66e45975af Merge branch 'goal-mode-4-core-runtime' into goal-mode-5-tui 2026-04-15 22:04:18 -07:00
Eric Traut
f7b9dbdb3e codex: address PR review feedback (#18076) 2026-04-15 22:04:04 -07:00
Eric Traut
59a1d53909 Merge branch 'goal-mode-3-tools' into goal-mode-4-core-runtime 2026-04-15 22:00:04 -07:00
Eric Traut
96b10a8764 codex: carry goal status rename into tools 2026-04-15 21:59:54 -07:00
Eric Traut
d9fb90798e Merge branch 'goal-mode-2-app-server' into goal-mode-3-tools 2026-04-15 21:57:47 -07:00
Eric Traut
e5abd13232 codex: address PR review feedback (#18074) 2026-04-15 21:57:37 -07:00
Eric Traut
757c8b1ee3 Merge branch 'goal-mode-1-state' into goal-mode-2-app-server 2026-04-15 21:54:41 -07:00
Eric Traut
00ac0b1b3e codex: address PR review feedback (#18073) 2026-04-15 21:54:28 -07:00
Eric Traut
a332fa7ada Add goal mode TUI 2026-04-15 21:43:33 -07:00
Eric Traut
aa6847c32b Add goal mode core runtime 2026-04-15 21:39:01 -07:00
Eric Traut
34cedb5e37 Add goal mode model tools 2026-04-15 21:34:56 -07:00
Eric Traut
270c426176 Add goal mode app-server API 2026-04-15 21:28:16 -07:00
Eric Traut
6ae8cf4c4c Add goal mode state foundation 2026-04-15 21:22:38 -07:00
pakrym-oai
bd61737e8a Async config loading (#18022)
Parts of config will come from executor. Prepare for that by making
config loading methods async.
2026-04-15 19:18:38 -07:00
canvrno-oai
d97bad1272 Display YOLO mode permissions if set when launching TUI (#17877)
- When launching the TUI client, if YOLO mode is enabled, display this
in the header.
- Eligibility is determined by `approval_policy = "never"` and
`sandbox_mode = "danger-full-access"`

<img width="886" height="230" alt="image"
src="https://github.com/user-attachments/assets/d7064778-e32c-4123-8e44-ca0c9016ab09"
/>
2026-04-15 18:28:11 -07:00
Ruslan Nigmatullin
f948690fc8 [codex] Make command exec delta tests chunk tolerant (#17999)
## Summary
- Make command/exec output-delta tests accumulate streamed chunks
instead of assuming complete logical output in a single notification.
- Collect stdout and stderr independently so stream interleaving does
not fail the pipe streaming test.

## Why
The command/exec protocol exposes output as deltas, so tests should not
rely on chunk boundaries being stable. A line like `out-start\n` may
arrive split across multiple notifications, and stdout/stderr
notifications may interleave.

## Validation
- `just fmt`
- `git diff --check`
- `cargo test -p codex-app-server suite::v2::command_exec`
2026-04-15 17:57:02 -07:00
Won Park
e2dbe7dfc3 removing network proxy for yolo (#17742)
**Summary**
- prevent managed requirements.toml network settings from leaking into
DangerFullAccess / yolo turns by gating managed proxy attachment on
sandbox mode
- keep guardian/sandboxed modes on the managed proxy path, while making
true yolo bypass the proxy entirely, including /shell full-access
commands
2026-04-16 00:02:42 +00:00
bxie-openai
c2bdb7812c Clarify realtime v2 context and handoff messages (#17896)
## Summary
- wrap realtime startup context in
`<startup_context>...</startup_context>` tags
- prefix V2 mirrored user text and relayed backend text with `[USER]` /
`[BACKEND]`
- remove the V2 progress suffix and replace the final V2 handoff output
with a short completion acknowledgement while preserving the existing V1
wrapper

## Testing
- cargo test -p codex-api
realtime_v2_session_update_includes_background_agent_tool_and_handoff_output_item
-- --exact
- cargo test -p codex-app-server webrtc_v2_background_agent_
- cargo test -p codex-app-server webrtc_v2_text_input_is_
- cargo test -p codex-core conversation_user_text_turn_is_
2026-04-15 16:26:20 -07:00
Matthew Zeng
28b76d13fe [mcp] Add dummy tools for previously called but currently missing tools. (#17853)
- [x] Add dummy tools for previously called but currently missing tools.
Currently supporting MCP tools only.
2026-04-15 21:48:05 +00:00
efrazer-oai
9d1bf002c6 Significantly improve standalone installer (#17022)
## Summary

This PR significantly improves the standalone installer experience.

The main changes are:

1. We now install the codex binary and other dependencies in a
subdirectory under CODEX_HOME.
(`CODEX_HOME/packages/standalone/releases/...`)

2. We replace the `codex.js` launcher that npm/bun rely on with logic in
the Rust binary that automatically resolves its dependencies (like
ripgrep)

## Motivation

A few design constraints pushed this work.

1. Currently, the entrypoint to codex is through `codex.js`, which
forces a node dependency to kick off our rust app. We want to move away
from this so that the entrypoint to codex does not rely on node or
external package managers.
2. Right now, the native script adds codex and its dependencies directly
to user PATH. Given that codex is likely to add more binary dependencies
than ripgrep, we want a solution which does not add arbitrary binaries
to user PATH -- the only one we want to add is the `codex` command
itself.
3. We want upgrades to be atomic. We do not want scenarios where
interrupting an upgrade command can move codex into undefined state (for
example, having a new codex binary but an old ripgrep binary). This was
~possible with the old script.
4. Currently, the Rust binary uses heuristics to determine which
installer created it. These heuristics are flaky and are tied to the
`codex.js` launcher. We need a more stable/deterministic way to
determine how the binary was installed for standalone.
5. We do not want conflicting codex installations on PATH. For example,
the user installing via npm, then installing via brew, then installing
via standalone would make it unclear which version of codex is being
launched and make it tough for us to determine the right upgrade
command.

## Design

### Standalone package layout

Standalone installs now live under `CODEX_HOME/packages/standalone`:

```text
$CODEX_HOME/
  packages/
    standalone/
      current -> releases/0.111.0-x86_64-unknown-linux-musl
      releases/
        0.111.0-x86_64-unknown-linux-musl/
          codex
          codex-resources/
            rg
```

where `standalone/current` is a symlink to a release directory.

On Windows, the release directory has the same shape, with `.exe` names
and Windows helpers in `codex-resources`:

```text
%CODEX_HOME%\
  packages\
    standalone\
      current -> releases\0.111.0-x86_64-pc-windows-msvc
      releases\
        0.111.0-x86_64-pc-windows-msvc\
          codex.exe
          codex-resources\
            rg.exe
            codex-command-runner.exe
            codex-windows-sandbox-setup.exe
```

This gives us:
- atomic upgrades because we can fully stage a release before switching
`standalone/current`
- a stable way for the binary to recognize a standalone install from its
canonical `current_exe()` path under CODEX_HOME
- a clean place for binary dependencies like `rg`, Windows sandbox
helpers, and, in the future, our custom `zsh` etc

### Command location

On Unix, we add a symlink at `~/.local/bin/codex` which points directly
to the `$CODEX_HOME/packages/standalone/current/codex` binary. This
becomes the main entrypoint for the CLI.

On Windows, we store the link at
`%LOCALAPPDATA%\Programs\OpenAI\Codex\bin`.

### PATH persistence

This is a tricky part of the PR, as there's no ~super reliable way to
ensure that we end up on PATH without significant tradeoffs.

Most Unix variants will have `~/.local/bin` on PATH already, which means
we *should* be fine simply registering the command there in most cases.
However, there are cases where this is not the case. In these cases, we
directly edit the profile depending on the shell we're in.

- macOS zsh: `~/.zprofile`
- macOS bash: `~/.bash_profile`
- Linux zsh: `~/.zshrc`
- Linux bash: `~/.bashrc`
- fallback: `~/.profile`

On Windows, we update the User `Path` environment variable directly and
we don't need to worry about shell profiles.

### Standalone runtime detection

This PR adds a new shared crate, `codex-install-context`, which computes
install ownership once per process and caches it in a `OnceLock`.

That context includes:
- install manager (`Standalone`, `Npm`, `Bun`, `Brew`, `Other`)
- the managed standalone release directory, when applicable
- the managed standalone `codex-resources` directory, when present
- the resolved `rg_command`

The standalone path is detected by canonicalizing `current_exe()`,
canonicalizing CODEX_HOME via `find_codex_home()`, and checking whether
the binary is running from under
`$CODEX_HOME/packages/standalone/releases`.

We intentionally do not use a release metadata file. The binary path is
the source of truth.

### Dependency resolution

For standalone installs, `grep_files` now resolves bundled `rg` from
`codex-resources` next to the Codex binary.

For npm/bun/brew/other installs, `grep_files` falls back to resolving
`rg` from PATH.

For Windows standalone installs, Windows sandbox helpers are still found
as direct siblings when present. If they are not direct siblings, the
lookup also checks the sibling `codex-resources` directory.

### TUI update path

The TUI now has `UpdateAction::StandaloneUnix` and
`UpdateAction::StandaloneWindows`, which rerun the standalone install
commands.

Unix update command:

```sh
sh -c "curl -fsSL https://chatgpt.com/codex/install.sh | sh"
```

Windows update command:

```powershell
powershell -c "irm https://chatgpt.com/codex/install.ps1|iex"
```

The Windows updater runs PowerShell directly. We do this because `cmd
/C` would parse the `|iex` as a cmd pipeline instead of passing it to
PowerShell.

## Additional installer behavior

- standalone installs now warn about conflicting npm/bun/brew-managed
`codex` installs and offer to uninstall them
- same-version reruns do not redownload the release if it is already
staged locally

## Testing

Installer smoke tests run:
- macOS: fresh install into isolated `HOME` and `CODEX_HOME` with
`scripts/install/install.sh --release latest`
- macOS: reran the installer against the same isolated install to verify
the same-version/update path and PATH block idempotence
- macOS: verified the installed `codex --version` and bundled
`codex-resources/rg --version`
- Windows: parsed `scripts/install/install.ps1` with PowerShell via
`[scriptblock]::Create(...)`
- Windows: verified the standalone update action builds a direct
PowerShell command and does not route the `irm ...|iex` command through
`cmd /C`

---------

Co-authored-by: Codex <noreply@openai.com>
2026-04-15 14:44:01 -07:00
Curtis 'Fjord' Hawthorne
9e2fc31854 Support original-detail metadata on MCP image outputs (#17714)
## Summary
- honor `_meta["codex/imageDetail"] == "original"` on MCP image content
and map it to `detail: "original"` where supported
- strip that detail back out when the active model does not support
original-detail image inputs
- update code-mode `image(...)` to accept individual MCP image blocks
- teach `js_repl` / `codex.emitImage(...)` to preserve the same hint
from raw MCP image outputs
- document the new `_meta` contract and add generic RMCP-backed coverage
across protocol, core, code-mode, and js_repl paths
2026-04-15 14:43:33 -07:00
evawong-oai
17d94bd1e3 [docs] Revert extra changes from PR 17848 (#18003)
## Summary

1. Revert https://github.com/openai/codex/pull/17848 so the Bazel and
`BUILD` file changes leave `main`.
2. Prepare for a narrower follow up that restores only `SECURITY.md`.

## Validation

1. Reviewed the revert diff against `main`.
2. Ran a clean diff check before push.
2026-04-15 14:43:30 -07:00
xl-openai
e70ccdeaf7 feat: Support alternate marketplace manifests and local string (#17885)
- Discover marketplace manifests from different supported layout paths
instead of only .agents/plugins/marketplace.json.
- Accept local plugin sources written either as { source: "local", path:
... } or as a direct string path.
- Skip unsupported or invalid plugin source entries without failing the
entire marketplace, and keep valid local plugins loadable.
2026-04-15 14:16:41 -07:00
jif-oai
83dc8da9cc Re-enable it (#18002)
Reverts openai/codex#17981
2026-04-15 22:09:41 +01:00
Eugene Brevdo
bc969b6516 Dismiss stale app-server requests after remote resolution (#15134)
Dismiss stale TUI app-server approvals after remote resolution

When an approval, user-input prompt, or elicitation request is resolved
by another client, the TUI now dismisses the matching local UI instead
of leaving stale prompts behind and emitting a misleading local
cancellation.

This change teaches pending app-server request tracking to map
`serverRequest/resolved` notifications back to the concrete request type
and stable request key, then propagates that resolved request into TUI
prompt state. Approval, request-user-input, and MCP elicitation overlays
now drop the resolved current or queued request quietly, advance to the
next queued request when present, and avoid emitting abort/cancel events
for stale UI.

The latest update also retires matching prompts while they are still
deferred behind active streaming and suppresses buffered active-thread
requests whose app-server request id has already been resolved before
drain. `ChatWidget` removes a resolved request from both the deferred
interrupt queue and the materialized bottom-pane stack, while
active-thread request handling verifies the app-server request is still
pending before showing a prompt. Lifecycle events such as exec begin/end
remain queued so approved work can still render normally.

Tests cover resolved-request mapping, overlay dismissal behavior,
deferred prompt pruning for same-turn user input, exec approval IDs,
lifecycle-event retention, and the buffered active-thread ordering
regression.

Validation:
- `just fmt`
- `git diff --check`
- `cargo test -p codex-tui
resolved_buffered_approval_does_not_become_actionable_after_drain`
- `cargo test -p codex-tui
enqueue_primary_thread_session_replays_buffered_approval_after_attach`
- `cargo test -p codex-tui chatwidget::interrupts`
- `just fix -p codex-tui`

---------

Co-authored-by: Codex <noreply@openai.com>
2026-04-15 13:57:41 -07:00
starr-openai
ba36415a30 [codex] Restore remote exec-server filesystem tests (#17989)
## Summary

- Re-enable remote variants for the exec-server filesystem
sandbox/symlink tests that were made local-only in PR #17671.
- Restore `use_remote` parameterization for the readable-root,
normalized symlink escape, symlink removal, and symlink
copy-preservation cases.
- Preserve `mode={use_remote}` context on key async filesystem failures
so CI failures point at the local or remote lane.

## Validation

- `cd codex-rs && just fmt`
- Not run: `bazel test
//codex-rs/exec-server:exec-server-file_system-test` per local Codex
development guidance to avoid test runs unless explicitly requested.

Co-authored-by: Codex <noreply@openai.com>
2026-04-15 20:48:13 +00:00