Commit Graph
4830 Commits
Author SHA1 Message Date
Roy Han 2ad79b06f0 Merge branch 'rhan/approval-source' into rhan/escalations-approvals-sandbox
# Conflicts:
#	codex-rs/core/src/codex.rs
#	codex-rs/core/src/codex_tests.rs
#	codex-rs/core/src/state/turn.rs
2026-03-22 23:32:08 -07:00
Roy Han 7a2c92bf89 clean up 2026-03-22 23:10:30 -07:00
Roy Han 862b417a3e rebase 2026-03-22 22:20:37 -07:00
Roy Han ed5971be8e lint 2026-03-22 17:22:49 -07:00
Roy Han 2ecbe6f0eb clean up churn 2026-03-22 17:18:23 -07:00
Roy Han 27329b51fe fix mutation 2026-03-20 20:42:23 -07:00
Roy Han cb680fab86 fix test drift 2026-03-20 20:01:20 -07:00
rhan-oai a2a53aa4c9 Merge branch 'rhan/surface-updates' into rhan/emittance 2026-03-20 18:05:31 -07:00
Roy Han 30cd30a6e4 fmt 2026-03-20 18:04:47 -07:00
Roy Han 826297a899 add directly to response input item 2026-03-20 18:03:20 -07:00
Roy Han b8bf118b56 module for metadata stamping 2026-03-20 17:47:35 -07:00
Roy Han 632ae61296 lint 2026-03-20 17:37:14 -07:00
Roy Han beda548bef fix construction 2026-03-20 17:19:06 -07:00
Roy Han 290ee318d1 remove redundant stamping 2026-03-20 16:54:37 -07:00
rhan-oai 6d8827debc Merge branch 'rhan/surface-updates' into rhan/emittance 2026-03-20 16:05:42 -07:00
rhan-oai 56ca2b539a fix lib.rs comment 2026-03-20 16:04:31 -07:00
Roy Han 13c91bde2e mandate metadata_id and use constructor 2026-03-20 15:59:38 -07:00
Roy Han 1db74b7287 rename uuid to metadata_id and introduce metadata variants 2026-03-20 15:38:36 -07:00
Roy Han b6b9b89865 features 2026-03-19 23:32:30 -07:00
Roy Han ddab859227 features 2026-03-19 23:30:20 -07:00
Roy Han eb86adc31c Merge remote-tracking branch 'origin/rhan/surface-updates' into codex/emittance-mergefix
# Conflicts:
#	codex-rs/core/tests/suite/items.rs
2026-03-19 23:24:03 -07:00
Roy Han 6f6fb8c017 Merge branch 'main' into rhan/surface-updates 2026-03-19 23:08:27 -07:00
Won Park 461ba012fc Feat/restore image generation history (#15223)
Restore image generation items in resumed thread history
2026-03-19 22:57:16 -07:00
Charley CunninghamandCodex b3a4da84da Add guardian follow-up reminder (#15262)
## Summary
- add a short guardian follow-up developer reminder before reused
reviews
- cache prior-review state on the guardian session instead of rescanning
full history on each request
- update guardian follow-up coverage and snapshot expectations

---------

Co-authored-by: Codex <noreply@openai.com>
2026-03-19 22:35:52 -07:00
xl-openai b1570d6c23 feat: Add One-Time Startup Remote Plugin Sync (#15264)
For early users who have already enabled apps, we should enable plugins
as part of the initial setup.
2026-03-20 05:01:39 +00:00
Roy Han d5d70d39f7 lint 2026-03-19 21:38:18 -07:00
Andrei Eternal cc192763e1 Disable hooks on windows for now (#15252)
We'll verify a bit later that all of this works correctly and re-enable
2026-03-19 21:31:56 -07:00
canvrno-oai f7201e5a9f Initial plugins TUI menu - list and read only. tui + tui_app_server (#15215)
### Preliminary /plugins TUI menu
- Adds a preliminary /plugins menu flow in both tui and tui_app_server.
- Fetches plugin list data asynchronously and shows loading/error/cached
states.
  - Limits this first pass to the curated ChatGPT marketplace.
  - Shows available plugins with installed/status metadata.
- Supports in-menu search over plugin display name, plugin id, plugin
name, and marketplace label.
- Opens a plugin detail view on selection, including summaries for
Skills, Apps, and MCP Servers, with back navigation.

### Testing
  - Launch codex-cli with plugins enabled (`--enable plugins`).
  - Run /plugins and verify:
      - loading state appears first
      - plugin list is shown
      - search filters results
- selecting a plugin opens detail view, with a list of
skills/connectors/MCP servers for the plugin
      - back action returns to the list.
- Verify disabled behavior by running /plugins without plugins enabled
(shows “Plugins are disabled” message).
- Launch with `--enable tui_app_server` (and plugins enabled) and repeat
the same /plugins flow; behavior should match.
2026-03-19 21:28:33 -07:00
Roy Han cb6ace9d1b clean up 2026-03-19 21:21:59 -07:00
Michael Bolin fa2a2f0be9 Use released DotSlash package for argument-comment lint (#15199)
## Why
The argument-comment lint now has a packaged DotSlash artifact from
[#15198](https://github.com/openai/codex/pull/15198), so the normal repo
lint path should use that released payload instead of rebuilding the
lint from source every time.

That keeps `just clippy` and CI aligned with the shipped artifact while
preserving a separate source-build path for people actively hacking on
the lint crate.

The current alpha package also exposed two integration wrinkles that the
repo-side prebuilt wrapper needs to smooth over:
- the bundled Dylint library filename includes the host triple, for
example `@nightly-2025-09-18-aarch64-apple-darwin`, and Dylint derives
`RUSTUP_TOOLCHAIN` from that filename
- on Windows, Dylint's driver path also expects `RUSTUP_HOME` to be
present in the environment

Without those adjustments, the prebuilt CI jobs fail during `cargo
metadata` or driver setup. This change makes the checked-in prebuilt
wrapper normalize the packaged library name to the plain
`nightly-2025-09-18` channel before invoking `cargo-dylint`, and it
teaches both the wrapper and the packaged runner source to infer
`RUSTUP_HOME` from `rustup show home` when the environment does not
already provide it.

After the prebuilt Windows lint job started running successfully, it
also surfaced a handful of existing anonymous literal callsites in
`windows-sandbox-rs`. This PR now annotates those callsites so the new
cross-platform lint job is green on the current tree.

## What Changed
- checked in the current
`tools/argument-comment-lint/argument-comment-lint` DotSlash manifest
- kept `tools/argument-comment-lint/run.sh` as the source-build wrapper
for lint development
- added `tools/argument-comment-lint/run-prebuilt-linter.sh` as the
normal enforcement path, using the checked-in DotSlash package and
bundled `cargo-dylint`
- updated `just clippy` and `just argument-comment-lint` to use the
prebuilt wrapper
- split `.github/workflows/rust-ci.yml` so source-package checks live in
a dedicated `argument_comment_lint_package` job, while the released lint
runs in an `argument_comment_lint_prebuilt` matrix on Linux, macOS, and
Windows
- kept the pinned `nightly-2025-09-18` toolchain install in the prebuilt
CI matrix, since the prebuilt package still relies on rustup-provided
toolchain components
- updated `tools/argument-comment-lint/run-prebuilt-linter.sh` to
normalize host-qualified nightly library filenames, keep the `rustup`
shim directory ahead of direct toolchain `cargo` binaries, and export
`RUSTUP_HOME` when needed for Windows Dylint driver setup
- updated `tools/argument-comment-lint/src/bin/argument-comment-lint.rs`
so future published DotSlash artifacts apply the same nightly-filename
normalization and `RUSTUP_HOME` inference internally
- fixed the remaining Windows lint violations in
`codex-rs/windows-sandbox-rs` by adding the required `/*param*/`
comments at the reported callsites
- documented the checked-in DotSlash file, wrapper split, archive
layout, nightly prerequisite, and Windows `RUSTUP_HOME` requirement in
`tools/argument-comment-lint/README.md`
2026-03-20 03:19:22 +00:00
starr-openaiandCodex 96a86710c3 Split exec process into local and remote implementations (#15233)
## Summary
- match the exec-process structure to filesystem PR #15232
- expose `ExecProcess` on `Environment`
- make `LocalProcess` the real implementation and `RemoteProcess` a thin
network proxy over `ExecServerClient`
- make `ProcessHandler` a thin RPC adapter delegating to `LocalProcess`
- add a shared local/remote process test

## Validation
- `just fmt`
- `CARGO_TARGET_DIR=~/.cache/cargo-target/codex cargo test -p
codex-exec-server`
- `just fix -p codex-exec-server`

---------

Co-authored-by: Codex <noreply@openai.com>
2026-03-20 03:13:08 +00:00
2e22885e79 Split features into codex-features crate (#15253)
- Split the feature system into a new `codex-features` crate.
- Cut `codex-core` and workspace consumers over to the new config and
warning APIs.

Co-authored-by: Ahmed Ibrahim <219906144+aibrahim-oai@users.noreply.github.com>
Co-authored-by: Codex <noreply@openai.com>
2026-03-19 20:12:07 -07:00
xl-openai 35f8b87a5b fix: Distinguish missing and empty plugin products (#15263)
Treat [] as no product allowed, empty as all products allowed.
2026-03-19 20:02:40 -07:00
Michael Bolin a3e59e9e85 core: add a full-buffer exec capture policy (#15254) rusty-v8-v146.4.0 2026-03-20 02:38:12 +00:00
Matthew Zeng 0a344e4fab [plugins] Install MCPs when calling plugin/install (#15195)
- [x] Auth MCPs when installing plugins.
2026-03-19 19:36:58 -07:00
Roy Han cf70384367 lint 2026-03-19 19:03:28 -07:00
Ahmed IbrahimandCodex 2aa4873802 Move auth code into login crate (#15150)
- Move the auth implementation and token data into codex-login.
- Keep codex-core re-exporting that surface from codex-login for
existing callers.

---------

Co-authored-by: Codex <noreply@openai.com>
2026-03-19 18:58:17 -07:00
Roy Han a7de20f2fd Remove unused approval and pending-input wrappers 2026-03-19 18:39:40 -07:00
Roy Han a411d51c88 protocol types 2026-03-19 18:36:28 -07:00
Roy Han 95c7d03161 tests 2026-03-19 18:36:28 -07:00
Roy Han a4ad4c4166 patch network regression 2026-03-19 18:36:28 -07:00
Roy Han f0e3924016 refactor 2026-03-19 18:36:28 -07:00
Roy Han 2a5d70bece guardian patch and test update 2026-03-19 18:35:54 -07:00
Roy Han b4a80c5bf0 Trigger CI 2026-03-19 18:35:54 -07:00
Roy Han 11c1cd375c initial draft 2026-03-19 18:35:54 -07:00
Roy Han ef7f3b189e move uuid stamping callsite to earliest boundary 2026-03-19 18:35:11 -07:00
Roy Han c265a1a0ba merge conflicts 2026-03-19 18:34:43 -07:00
Andrei Eternal f6f5e1608b [hooks] userpromptsubmit - hook before user's prompt is executed (#14626)
- this allows blocking the user's prompts from executing, and also
prevents them from entering history
- handles the edge case where you can both prevent the user's prompt AND
add n amount of additionalContexts
- refactors some old code into common.rs where hooks overlap
functionality
- refactors additionalContext being previously added to user messages,
instead we use developer messages for them
- handles queued messages correctly

Sample hook for testing - if you write "[block-user-submit]" this hook
will stop the thread:

example run
```
› sup

• Running UserPromptSubmit hook: reading the observatory notes

UserPromptSubmit hook (completed)
  warning: wizard-tower UserPromptSubmit demo inspected: sup
  hook context: Wizard Tower UserPromptSubmit demo fired. For this reply only, include the exact
phrase 'observatory lanterns lit' exactly once near the end.

• Just riding the cosmic wave and ready to help, my friend. What are we building today? observatory
  lanterns lit

› and [block-user-submit]

• Running UserPromptSubmit hook: reading the observatory notes

UserPromptSubmit hook (stopped)
  warning: wizard-tower UserPromptSubmit demo blocked the prompt on purpose.
  stop: Wizard Tower demo block: remove [block-user-submit] to continue.
```

.codex/config.toml
```
[features]
codex_hooks = true
```

.codex/hooks.json
```
{
  "hooks": {
    "UserPromptSubmit": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "/usr/bin/python3 .codex/hooks/user_prompt_submit_demo.py",
            "timeoutSec": 10,
            "statusMessage": "reading the observatory notes"
          }
        ]
      }
    ]
  }
}
```

.codex/hooks/user_prompt_submit_demo.py
```

import json
import sys
from pathlib import Path

def prompt_from_payload(payload: dict) -> str:
    prompt = payload.get("prompt")
    if isinstance(prompt, str) and prompt.strip():
        return prompt.strip()

    event = payload.get("event")
    if isinstance(event, dict):
        user_prompt = event.get("user_prompt")
        if isinstance(user_prompt, str):
            return user_prompt.strip()

    return ""

def main() -> int:
    payload = json.load(sys.stdin)
    prompt = prompt_from_payload(payload)
    cwd = Path(payload.get("cwd", ".")).name or "wizard-tower"

    if "[block-user-submit]" in prompt:
        print(
            json.dumps(
                {
                    "systemMessage": (
                        f"{cwd} UserPromptSubmit demo blocked the prompt on purpose."
                    ),
                    "decision": "block",
                    "reason": (
                        "Wizard Tower demo block: remove [block-user-submit] to continue."
                    ),
                }
            )
        )
        return 0

    prompt_preview = prompt or "(empty prompt)"
    if len(prompt_preview) > 80:
        prompt_preview = f"{prompt_preview[:77]}..."

    print(
        json.dumps(
            {
                "systemMessage": (
                    f"{cwd} UserPromptSubmit demo inspected: {prompt_preview}"
                ),
                "hookSpecificOutput": {
                    "hookEventName": "UserPromptSubmit",
                    "additionalContext": (
                        "Wizard Tower UserPromptSubmit demo fired. "
                        "For this reply only, include the exact phrase "
                        "'observatory lanterns lit' exactly once near the end."
                    ),
                },
            }
        )
    )
    return 0

if __name__ == "__main__":
    raise SystemExit(main())
```
2026-03-19 18:32:54 -07:00
Roy Han 910bc90d78 rerun ci on latest head 2026-03-19 18:28:06 -07:00
Roy Han 5646c5a828 add uuid to metadata 2026-03-19 18:28:06 -07:00