Commit Graph

10323 Commits

Author SHA1 Message Date
Michael Bolin
44af4527fc Merge 1094b771d6 into sapling-pr-archive-bolinfest 2026-03-27 11:59:08 -07:00
Michael Bolin
1094b771d6 fix: fix Windows CI regression introduced in #15999 2026-03-27 11:58:57 -07:00
Michael Bolin
e4269cae21 merge commit for archive created by Sapling 2026-03-27 10:38:37 -07:00
Michael Bolin
e5463fc549 ci: add Bazel clippy workflow for codex-rs 2026-03-27 10:38:31 -07:00
Michael Bolin
f27cc63ff6 Merge fb4e76be98 into sapling-pr-archive-bolinfest 2026-03-27 09:23:49 -07:00
Michael Bolin
fb4e76be98 ci: add Bazel clippy workflow for codex-rs 2026-03-27 09:23:45 -07:00
Michael Bolin
16f3697138 Merge 620f7a4f12 into sapling-pr-archive-bolinfest 2026-03-27 09:16:58 -07:00
Michael Bolin
620f7a4f12 ci: add Bazel clippy workflow for codex-rs 2026-03-27 09:16:49 -07:00
Michael Bolin
4c127facd9 Merge cf1368b80d into sapling-pr-archive-bolinfest 2026-03-27 09:13:06 -07:00
Michael Bolin
cf1368b80d codex-tools: introduce named tool definitions 2026-03-27 09:12:42 -07:00
Michael Bolin
617475e54b codex-tools: extract dynamic tool adapters (#15944)
## Why

`codex-tools` already owned the shared JSON schema parser and the MCP
tool schema adapter, but `core/src/tools/spec.rs` still parsed dynamic
tools directly.

That left the tool-schema boundary split in two different ways:

- MCP tools flowed through `codex-tools`, while dynamic tools were still
parsed in `codex-core`
- the extracted dynamic-tool path initially introduced a
dynamic-specific parsed shape even though `codex-tools` already had very
similar MCP adapter output

This change finishes that extraction boundary in one step. `codex-core`
still owns `ResponsesApiTool` assembly, but both MCP tools and dynamic
tools now enter that layer through `codex-tools` using the same parsed
tool-definition shape.

## What changed

- added `tools/src/dynamic_tool.rs` and sibling
`tools/src/dynamic_tool_tests.rs`
- introduced `parse_dynamic_tool()` in `codex-tools` and switched
`core/src/tools/spec.rs` to use it for dynamic tools
- added `tools/src/parsed_tool_definition.rs` so both MCP and dynamic
adapters return the same `ParsedToolDefinition`
- updated `core/src/tools/spec.rs` to build `ResponsesApiTool` through a
shared local adapter helper instead of separate MCP and dynamic assembly
paths
- expanded `core/src/tools/spec_tests.rs` so the dynamic-tool adapter
test asserts the full converted `ResponsesApiTool`, including
`defer_loading`
- updated `codex-rs/tools/README.md` to reflect the shared parsed
tool-definition boundary

## Test plan

- `cargo test -p codex-tools`
- `cargo test -p codex-core --lib tools::spec::`

---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/15944).
* #15953
* __->__ #15944
2026-03-27 09:12:36 -07:00
viyatb-oai
ec089fd22a fix(sandbox): fix bwrap lookup for multi-entry PATH (#15973)
## Summary
- split the joined `PATH` before running system `bwrap` lookup
- keep the existing workspace-local `bwrap` skip behavior intact
- add regression tests that exercise real multi-entry search paths

## Why
The PATH-based lookup added in #15791 still wrapped the raw `PATH`
environment value as a single `PathBuf` before passing it through
`join_paths()`. On Unix, a normal multi-entry `PATH` contains `:`, so
that wrapper path is invalid as one path element and the lookup returns
`None`.

That made Codex behave as if no system `bwrap` was installed even when
`bwrap` was available on `PATH`, which is what users in #15340 were
still hitting on `0.117.0-alpha.25`.

## Impact
System `bwrap` discovery now works with normal multi-entry `PATH` values
instead of silently falling back to the vendored binary.

Fixes #15340.

## Validation
- `just fmt`
- `cargo test -p codex-sandboxing`
- `cargo test -p codex-linux-sandbox`
- `just fix -p codex-sandboxing`
- `just argument-comment-lint`
2026-03-27 08:41:06 -07:00
jif-oai
426f28ca99 feat: spawn v2 as inter agent communication (#15985)
Co-authored-by: Codex <noreply@openai.com>
2026-03-27 15:45:19 +01:00
jif-oai
2b71717ccf Use codex-utils-template for review exit XML (#15999) 2026-03-27 15:30:28 +01:00
jif-oai
f044ca64df Use codex-utils-template for search tool descriptions (#15996) 2026-03-27 15:08:24 +01:00
jif-oai
37b057f003 Use codex-utils-template for collaboration mode presets (#15995) 2026-03-27 14:51:07 +01:00
jif-oai
2c85ca6842 Use codex-utils-template for sandbox mode prompts (#15998) 2026-03-27 14:50:36 +01:00
jif-oai
7d5d9f041b Use codex-utils-template for review prompts (#16001) 2026-03-27 14:50:01 +01:00
jif-oai
270b7655cd Use codex-utils-template for login error page (#16000) 2026-03-27 14:49:45 +01:00
jif-oai
6a0c4709ca feat: spawn v2 make task name as mandatory (#15986) 2026-03-27 11:30:22 +01:00
Michael Bolin
568e932365 merge commit for archive created by Sapling 2026-03-27 02:31:42 -07:00
Michael Bolin
3253af8f45 ci: refactor Bazel workflow setup 2026-03-27 02:31:33 -07:00
Michael Bolin
7aaa0ace95 ci: add Bazel clippy workflow for codex-rs 2026-03-27 02:31:33 -07:00
Michael Bolin
2ef91b7140 chore: move pty and windows sandbox to Rust 2024 (#15954)
## Why

`codex-utils-pty` and `codex-windows-sandbox` were the remaining crates
in `codex-rs` that still overrode the workspace's Rust 2024 edition.
Moving them forward in a separate PR keeps the baseline edition update
isolated from the follow-on Bazel clippy workflow in #15955, while
making linting and formatting behavior consistent with the rest of the
workspace.

This PR also needs Cargo and Bazel to agree on the edition for
`codex-windows-sandbox`. Without the Bazel-side sync, the experimental
Bazel app-server builds fail once they compile `windows-sandbox-rs`.

## What changed

- switch `codex-rs/utils/pty` and `codex-rs/windows-sandbox-rs` to
`edition = "2024"`
- update `codex-utils-pty` callsites and tests to use the collapsed `if
let` form that Clippy expects under the new edition
- fix the Rust 2024 fallout in `windows-sandbox-rs`, including the
reserved `gen` identifier, `unsafe extern` requirements, and new Clippy
findings that surfaced under the edition bump
- keep the edition bump separate from a larger unsafe cleanup by
temporarily allowing `unsafe_op_in_unsafe_fn` in the Windows entrypoint
modules that now report it under Rust 2024
- update `codex-rs/windows-sandbox-rs/BUILD.bazel` to `crate_edition =
"2024"` so Bazel compiles the crate with the same edition as Cargo





---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/15954).
* #15976
* #15955
* __->__ #15954
2026-03-27 02:31:08 -07:00
Michael Bolin
3bb9b110e7 merge commit for archive created by Sapling 2026-03-27 02:13:14 -07:00
Michael Bolin
df257bafda ci: enable the Windows Bazel workflow path 2026-03-27 02:13:08 -07:00
Michael Bolin
3cbe7e2e0b merge commit for archive created by Sapling 2026-03-27 02:05:01 -07:00
Michael Bolin
c516e41b40 ci: enable the Windows Bazel workflow path 2026-03-27 02:04:45 -07:00
jif-oai
2e849703cd chore: drop useless stuff (#15876) 2026-03-27 09:41:47 +01:00
Michael Bolin
be0e168682 merge commit for archive created by Sapling 2026-03-27 01:39:08 -07:00
Michael Bolin
092c2d3809 ci: enable the Windows Bazel workflow path 2026-03-27 01:38:58 -07:00
Michael Bolin
bf1aadfca4 merge commit for archive created by Sapling 2026-03-27 01:34:45 -07:00
Michael Bolin
ff33e9b67f ci: enable the Windows Bazel workflow path 2026-03-27 01:34:33 -07:00
Michael Bolin
8af74ad958 merge commit for archive created by Sapling 2026-03-27 01:25:44 -07:00
Michael Bolin
e69fcac8c0 ci: enable the Windows Bazel workflow path 2026-03-27 01:25:38 -07:00
Michael Bolin
22776c69c5 merge commit for archive created by Sapling 2026-03-27 01:23:00 -07:00
Michael Bolin
5cde018c58 ci: enable the Windows Bazel workflow path 2026-03-27 01:22:54 -07:00
Michael Bolin
80057b5ec6 merge commit for archive created by Sapling 2026-03-27 01:17:42 -07:00
Michael Bolin
c15f6c6bc3 ci: enable the Windows Bazel workflow path 2026-03-27 01:17:31 -07:00
Michael Bolin
39f2e48d89 Merge 4234212a5f into sapling-pr-archive-bolinfest 2026-03-27 01:08:59 -07:00
Michael Bolin
4234212a5f ci: enable the Windows Bazel workflow path 2026-03-27 01:08:53 -07:00
Michael Bolin
3dc85cfde7 merge commit for archive created by Sapling 2026-03-27 01:01:04 -07:00
Michael Bolin
1ae9d14612 ci: enable the Windows Bazel workflow path 2026-03-27 01:00:47 -07:00
Michael Bolin
cbf1ba188d merge commit for archive created by Sapling 2026-03-27 00:57:20 -07:00
Michael Bolin
e012e08ed2 ci: refactor Bazel workflow setup 2026-03-27 00:56:58 -07:00
Michael Bolin
0602685529 Merge 29cb89690d into sapling-pr-archive-bolinfest 2026-03-27 00:39:06 -07:00
Michael Bolin
29cb89690d ci: enable the Windows Bazel workflow path 2026-03-27 00:38:49 -07:00
daniel-oai
47a9e2e084 Add ChatGPT device-code login to app server (#15525)
## Problem

App-server clients could only initiate ChatGPT login through the browser
callback flow, even though the shared login crate already supports
device-code auth. That left VS Code, Codex App, and other app-server
clients without a first-class way to use the existing device-code
backend when browser redirects are brittle or when the client UX wants
to own the login ceremony.

## Mental model

This change adds a second ChatGPT login start path to app-server:
clients can now call `account/login/start` with `type:
"chatgptDeviceCode"`. App-server immediately returns a `loginId` plus
the device-code UX payload (`verificationUrl` and `userCode`), then
completes the login asynchronously in the background using the existing
`codex_login` polling flow. Successful device-code login still resolves
to ordinary `chatgpt` auth, and completion continues to flow through the
existing `account/login/completed` and `account/updated` notifications.

## Non-goals

This does not introduce a new auth mode, a new account shape, or a
device-code eligibility discovery API. It also does not add automatic
fallback to browser login in core; clients remain responsible for
choosing when to request device code and whether to retry with a
different UX if the backend/admin policy rejects it.

## Tradeoffs

We intentionally keep `login_chatgpt_common` as a local validation
helper instead of turning it into a capability probe. Device-code
eligibility is checked by actually calling `request_device_code`, which
means policy-disabled cases surface as an immediate request error rather
than an async completion event. We also keep the active-login state
machine minimal: browser and device-code logins share the same public
cancel contract, but device-code cancellation is implemented with a
local cancel token rather than a larger cross-crate refactor.

## Architecture

The protocol grows a new `chatgptDeviceCode` request/response variant in
app-server v2. On the server side, the new handler reuses the existing
ChatGPT login precondition checks, calls `request_device_code`, returns
the device-code payload, and then spawns a background task that waits on
either cancellation or `complete_device_code_login`. On success, it
reuses the existing auth reload and cloud-requirements refresh path
before emitting `account/login/completed` success and `account/updated`.
On failure or cancellation, it emits only `account/login/completed`
failure. The existing `account/login/cancel { loginId }` contract
remains unchanged and now works for both browser and device-code
attempts.


## Tests

Added protocol serialization coverage for the new request/response
variant, plus app-server tests for device-code success, failure, cancel,
and start-time rejection behavior. Existing browser ChatGPT login
coverage remains in place to show that the callback-based flow is
unchanged.
2026-03-27 00:27:15 -07:00
Michael Bolin
cc6a956036 merge commit for archive created by Sapling 2026-03-27 00:23:14 -07:00
Michael Bolin
4be744172f ci: enable the Windows Bazel workflow path 2026-03-27 00:23:00 -07:00