Commit Graph
5948 Commits
Author SHA1 Message Date
rhan-oai a2ba32d982 merge commit for archive created by Sapling 2026-04-15 17:26:25 -07:00
rhan-oai 569266739b core: emit responses api call analytics 2026-04-15 17:23:16 -07:00
rhan-oai f2ad6dd2ca analytics: reduce responses api call facts 2026-04-15 17:23:07 -07:00
rhan-oai d650215ec7 analytics: add responses api call schema 2026-04-15 17:23:00 -07:00
rhan-oai f286fa06a3 merge commit for archive created by Sapling 2026-04-15 17:21:36 -07:00
rhan-oai 146af961e4 [codex-analytics] guardian review TTFT plumbing and emission 2026-04-15 17:19:17 -07:00
rhan-oai 687ca65b1a [codex-analytics] guardian review truncation 2026-04-15 17:19:17 -07:00
rhan-oai de81c59fb7 [codex-analytics] guardian review thread and token metadata 2026-04-15 17:19:16 -07:00
rhan-oai 1d8d171063 Merge 79f6ed4876 into sapling-pr-archive-rhan-oai 2026-04-15 17:05:52 -07:00
rhan-oai 79f6ed4876 [codex-analytics] guardian review TTFT plumbing and emission 2026-04-15 17:03:36 -07:00
rhan-oai 25e5ada961 [codex-analytics] guardian review truncation 2026-04-15 17:03:36 -07:00
rhan-oai 6a7b6a066f [codex-analytics] guardian review thread and token metadata 2026-04-15 17:03:36 -07:00
rhan-oai 73130f425d [codex-analytics] guardian review analytics events emission 2026-04-15 17:03:35 -07:00
rhan-oai c0114dd9f1 Merge bf12018ce2 into sapling-pr-archive-rhan-oai 2026-04-15 16:52:13 -07:00
rhan-oai bf12018ce2 [codex-analytics] guardian review TTFT plumbing and emission 2026-04-15 16:48:32 -07:00
rhan-oai f8d87a8cd8 [codex-analytics] guardian review truncation 2026-04-15 16:48:31 -07:00
rhan-oai 647ccdbefb [codex-analytics] guardian review thread and token metadata 2026-04-15 16:48:31 -07:00
rhan-oai 044b9ef764 [codex-analytics] guardian review analytics events emission 2026-04-15 16:46:22 -07:00
rhan-oai 67a1bc3919 merge commit for archive created by Sapling 2026-04-15 16:42:13 -07:00
rhan-oai f35e63c9e5 [codex-analytics] guardian review TTFT plumbing and emission 2026-04-15 16:38:47 -07:00
rhan-oai 57e2b7d7e1 [codex-analytics] guardian review truncation 2026-04-15 16:38:46 -07:00
rhan-oai 16c1c5624d [codex-analytics] guardian review thread and token metadata 2026-04-15 16:32:48 -07: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
rhan-oai f705bf6b27 merge commit for archive created by Sapling 2026-04-15 16:05:35 -07:00
rhan-oai bd3e0d4de8 [codex-analytics] guardian review analytics events emission 2026-04-15 16:04:52 -07:00
rhan-oai 7b86b6de1b [codex-analytics] guardian review TTFT plumbing and emission 2026-04-15 16:04:52 -07:00
rhan-oai d6b3522b94 [codex-analytics] guardian review truncation 2026-04-15 16:04:52 -07:00
rhan-oai 0c4e8a7b75 [codex-analytics] guardian review thread and token metadata 2026-04-15 16:04:52 -07:00
rhan-oai 802431582a merge commit for archive created by Sapling 2026-04-15 15:57:45 -07:00
rhan-oai 6e067c8771 [codex-analytics] guardian review TTFT plumbing and emission 2026-04-15 15:54:14 -07:00
rhan-oai 240fe42265 [codex-analytics] guardian review truncation 2026-04-15 15:52:55 -07:00
rhan-oai 6ff2cd408c [codex-analytics] guardian review thread and token metadata 2026-04-15 15:51:11 -07:00
rhan-oai 7e15797c8d [codex-analytics] guardian review analytics events emission 2026-04-15 15:47:45 -07:00
rhan-oai 81aeef8f0e merge commit for archive created by Sapling 2026-04-15 15:29:53 -07:00
rhan-oai 57a76ae8ed [codex-analytics] guardian review TTFT plumbing and emission 2026-04-15 15:28:52 -07:00
rhan-oai 5efeb7cf2e [codex-analytics] guardian review truncation 2026-04-15 15:28:52 -07:00
rhan-oai d8e456889f [codex-analytics] guardian review thread and token metadata 2026-04-15 15:28:52 -07:00
rhan-oai 8644138ef0 [codex-analytics] guardian review analytics events emission 2026-04-15 15:28:52 -07:00
rhan-oai d59234e830 [codex-analytics] guardian review analytics schema polishing 2026-04-15 15:27:01 -07:00
rhan-oai 0029d35e37 merge commit for archive created by Sapling 2026-04-15 15:11:53 -07:00
evawong-oai 18d61f6923 [docs] Restore SECURITY.md update from PR 17848 (#18004)
Restore the `SECURITY.md` section from
https://github.com/openai/codex/pull/17848. Note this was lost in the
revert PR https://github.com/openai/codex/pull/18003.
2026-04-15 15:09:39 -07:00
rhan-oai 9711349153 [codex-analytics] guardian review TTFT plumbing and emission 2026-04-15 15:09:36 -07:00
rhan-oai d94e127f20 [codex-analytics] guardian review truncation 2026-04-15 15:09:36 -07:00
rhan-oai 882a371084 [codex-analytics] guardian review thread and token metadata 2026-04-15 15:09:36 -07:00
rhan-oai 2fd06c0371 [codex-analytics] guardian review analytics events emission 2026-04-15 15:09:36 -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-oaiandCodex 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
rhan-oai 902700ffaa merge commit for archive created by Sapling 2026-04-15 14:37:30 -07:00