Commit Graph
10545 Commits
Author SHA1 Message Date
Michael Bolin 1533e518a7 Merge a4ec8ce2e5 into sapling-pr-archive-bolinfest 2026-03-28 14:10:25 -07:00
Michael Bolin b720f9f528 Merge 451ea32c31 into sapling-pr-archive-bolinfest 2026-03-28 14:10:15 -07:00
Michael Bolin a4ec8ce2e5 stabilize zsh-fork approvals and resume --last 2026-03-28 14:10:08 -07:00
Michael Bolin 451ea32c31 core: avoid stale curated plugin cache refresh 2026-03-28 14:10:01 -07:00
Michael Bolin d348a1d43c Merge 1826bc60d4 into sapling-pr-archive-bolinfest 2026-03-28 14:09:06 -07:00
Michael Bolin 1826bc60d4 codex-tools: extract configured tool specs 2026-03-28 14:08:56 -07:00
Michael Bolin ae8a3be958 bazel: refresh the expired macOS SDK pin (#16128)
## Why

macOS BuildBuddy started failing before target analysis because the
Apple CDN object pinned in
[`MODULE.bazel`](https://github.com/openai/codex/blob/fce0f76d577b5070f1e2b4a2abaa8350acfc38ff/MODULE.bazel#L28-L36)
now returns `403 Forbidden`. The failure report that triggered this
change was this [BuildBuddy
invocation](https://app.buildbuddy.io/invocation/c57590e0-1bdb-4e19-a86f-74d4a7ded228).

This repo uses `@llvm//extensions:osx.bzl` via `osx.from_archive(...)`,
and that API does not discover a current SDK URL for us. It fetches
exactly the `urls`, `sha256`, and `strip_prefix` we pin. Once Apple
retires that `swcdn.apple.com` object, `@macos_sdk` stops resolving and
every downstream macOS build fails during external repository fetch.

This is the same basic failure mode we hit in
[b9fa08ec61](https://github.com/openai/codex/commit/b9fa08ec619c96617a9ae2041c9ddb02d2c02434):
the pin itself aged out.

## How I tracked it down

1. I started from the BuildBuddy error and copied the exact
`swcdn.apple.com/.../CLTools_macOSNMOS_SDK.pkg` URL from the failure.
2. I reproduced the issue outside CI by opening that URL directly in a
browser and by running `curl -I` against it locally. Both returned `403
Forbidden`, which ruled out BuildBuddy as the root cause.
3. I searched the repo for that URL and found it hardcoded in
`MODULE.bazel`.
4. I inspected the `llvm` Bzlmod `osx` extension implementation to
confirm that `osx.from_archive(...)` is just a literal fetch of the
pinned archive metadata. There is no automatic fallback or catalog
lookup behind it.
5. I queried Apple's software update catalogs to find the current
Command Line Tools package for macOS 26.x. The useful catalog was:
-
`https://swscan.apple.com/content/catalogs/others/index-26-15-14-13-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz`

This is scriptable; it does not require opening a website in a browser.
The catalog is a gzip-compressed plist served over HTTP, so the workflow
is just:

   1. fetch the catalog,
   2. decompress it,
   3. search or parse the plist for `CLTools_macOSNMOS_SDK.pkg` entries,
   4. inspect the matching product metadata.

   The quick shell version I used was:

   ```shell
   curl -L <catalog-url> \
     | gzip -dc \
     | rg -n -C 6 'CLTools_macOSNMOS_SDK\.pkg|PostDate|English\.dist'
   ```

That is enough to surface the current product id, package URL, post
date, and the matching `.dist` file. If we want something less
grep-driven next time, the same catalog can be parsed structurally. For
example:

   ```python
   import gzip
   import plistlib
   import urllib.request

url =
"https://swscan.apple.com/content/catalogs/others/index-26-15-14-13-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz"
   with urllib.request.urlopen(url) as resp:
       catalog = plistlib.loads(gzip.decompress(resp.read()))

   for product_id, product in catalog["Products"].items():
       for package in product.get("Packages", []):
           package_url = package.get("URL", "")
           if package_url.endswith("CLTools_macOSNMOS_SDK.pkg"):
               print(product_id)
               print(product.get("PostDate"))
               print(package_url)
               print(product.get("Distributions", {}).get("English"))
   ```

In practice, `curl` was only the transport. The important part is that
the catalog itself is a machine-readable plist, so this can be
automated.
6. That catalog contains the newer `047-96692` Command Line Tools
release, and its distribution file identifies it as [Command Line Tools
for Xcode
26.4](https://swdist.apple.com/content/downloads/32/53/047-96692-A_OAHIHT53YB/ybtshxmrcju8m2qvw3w5elr4rajtg1x3y3/047-96692.English.dist).
7. I downloaded that package locally, computed its SHA-256, expanded it
with `pkgutil --expand-full`, and verified that it contains
`Payload/Library/Developer/CommandLineTools/SDKs/MacOSX26.4.sdk`, which
is the correct new `strip_prefix` for this pin.

The core debugging loop looked like this:

```shell
curl -I <stale swcdn URL>
rg 'swcdn\.apple\.com|osx\.from_archive' MODULE.bazel
curl -L <apple 26.x sucatalog> | gzip -dc | rg 'CLTools_macOSNMOS_SDK.pkg'
pkgutil --expand-full CLTools_macOSNMOS_SDK.pkg expanded
find expanded/Payload/Library/Developer/CommandLineTools/SDKs -maxdepth 1 -mindepth 1
```

## What changed

- Updated `MODULE.bazel` to point `osx.from_archive(...)` at the
currently live `047-96692` `CLTools_macOSNMOS_SDK.pkg` object.
- Updated the pinned `sha256` to match that package.
- Updated the `strip_prefix` from `MacOSX26.2.sdk` to `MacOSX26.4.sdk`.

## Verification

- `bazel --output_user_root="$(mktemp -d
/tmp/codex-bazel-sdk-fetch.XXXXXX)" build @macos_sdk//sysroot`

## Notes for next time

As long as we pin raw `swcdn.apple.com` objects, this will likely happen
again. When it does, the expected recovery path is:

1. Reproduce the `403` against the exact URL from CI.
2. Find the stale pin in `MODULE.bazel`.
3. Look up the current CLTools package in the relevant Apple software
update catalog for that macOS major version.
4. Download the replacement package and refresh both `sha256` and
`strip_prefix`.
5. Validate the new pin with a fresh `@macos_sdk` fetch, not just an
incremental Bazel build.

The important detail is that the non-`26` catalog did not surface the
macOS 26.x SDK package here; the `index-26-15-14-...` catalog was the
one that exposed the currently live replacement.
2026-03-28 21:08:19 +00:00
Michael Bolin 7404a229a1 merge commit for archive created by Sapling 2026-03-28 14:04:59 -07:00
Michael Bolin 1e5e0e22bc ci: run Windows argument-comment-lint via native Bazel 2026-03-28 14:04:55 -07:00
Michael Bolin 91efc0c317 merge commit for archive created by Sapling 2026-03-28 13:58:21 -07:00
Michael Bolin 2adf6814a3 ci: run Windows argument-comment-lint via native Bazel 2026-03-28 13:58:17 -07:00
Michael Bolin 99fe7c539e merge commit for archive created by Sapling 2026-03-28 13:55:44 -07:00
Michael Bolin 1cbddbed23 ci: run Windows argument-comment-lint via native Bazel 2026-03-28 13:55:33 -07:00
Michael Bolin c2831d05d3 Merge 23bf221b6b into sapling-pr-archive-bolinfest 2026-03-28 13:44:13 -07:00
Michael Bolin 23bf221b6b bazel: refresh the pinned macOS SDK package 2026-03-28 13:44:01 -07:00
Michael Bolin 6dc5b58a5d merge commit for archive created by Sapling 2026-03-28 13:41:49 -07:00
Michael Bolin 79fb52ec2b ci: run Windows argument-comment-lint via native Bazel 2026-03-28 13:41:44 -07:00
Michael Bolin f14a22df4d merge commit for archive created by Sapling 2026-03-28 13:39:31 -07:00
Michael Bolin 5b53e90410 ci: run Windows argument-comment-lint via native Bazel 2026-03-28 13:39:18 -07:00
Michael Bolin bc53d42fd9 codex-tools: extract tool spec models (#16047)
## Why

This continues the `codex-tools` migration by moving another passive
tool-definition layer out of `codex-core`.

After `ResponsesApiTool` and the lower-level schema adapters moved into
`codex-tools`, `core/src/client_common.rs` was still owning `ToolSpec`
and the web-search request wire types even though they are serialized
data models rather than runtime orchestration. Keeping those types in
`codex-core` makes the crate boundary look smaller than it really is and
leaves non-runtime tool-shape code coupled to core.

## What changed

- moved `ToolSpec`, `ResponsesApiWebSearchFilters`, and
`ResponsesApiWebSearchUserLocation` into
`codex-rs/tools/src/tool_spec.rs`
- added focused unit tests in `codex-rs/tools/src/tool_spec_tests.rs`
for:
  - `ToolSpec::name()`
  - web-search config conversions
  - `ToolSpec` serialization for `web_search` and `tool_search`
- kept `codex-rs/tools/src/lib.rs` exports-only by re-exporting the new
module from `lib.rs`
- reduced `core/src/client_common.rs` to a compatibility shim that
re-exports the extracted tool-spec types for current core call sites
- updated `core/src/tools/spec_tests.rs` to consume the extracted
web-search types directly from `codex-tools`
- updated `codex-rs/tools/README.md` so the crate contract reflects that
`codex-tools` now owns the passive tool-spec request models in addition
to the lower-level Responses API structs

## Test plan

- `cargo test -p codex-tools`
- `cargo test -p codex-core --lib tools::spec::`
- `cargo test -p codex-core --lib client_common::`
- `just fix -p codex-tools -p codex-core`
- `just argument-comment-lint`

## References

- #15923
- #15928
- #15944
- #15953
- #16031
2026-03-28 13:37:00 -07:00
Michael Bolin 99d3eb9406 Merge 34c5cadef7 into sapling-pr-archive-bolinfest 2026-03-28 13:32:55 -07:00
Michael Bolin 34c5cadef7 core: avoid stale curated plugin cache refresh 2026-03-28 13:32:29 -07:00
Michael Bolin 77791c2583 merge commit for archive created by Sapling 2026-03-28 13:32:13 -07:00
Michael Bolin ad1e74c39a ci: run Windows argument-comment-lint via native Bazel 2026-03-28 13:32:07 -07:00
Michael Bolin 7c463e563f merge commit for archive created by Sapling 2026-03-28 13:28:13 -07:00
Michael Bolin 8326f6ad34 Merge c93bf9a006 into sapling-pr-archive-bolinfest 2026-03-28 13:28:08 -07:00
Michael Bolin 86fd561212 ci: run Windows argument-comment-lint via native Bazel 2026-03-28 13:28:06 -07:00
Michael Bolin c93bf9a006 tests: pin Windows apply_patch harness shell 2026-03-28 13:27:44 -07:00
Michael Bolin e4a2761bd0 merge commit for archive created by Sapling 2026-03-28 13:15:58 -07:00
Michael Bolin 9badeef2ca ci: run Windows argument-comment-lint via native Bazel 2026-03-28 13:15:47 -07:00
Michael Bolin db9bf81846 Merge e8be3d1e51 into sapling-pr-archive-bolinfest 2026-03-28 13:09:38 -07:00
Michael Bolin e8be3d1e51 codex-tools: extract tool spec models 2026-03-28 13:09:14 -07:00
Michael Bolin c1aeec1a75 merge commit for archive created by Sapling 2026-03-28 13:06:32 -07:00
Michael Bolin c583297480 ci: run Windows argument-comment-lint via native Bazel 2026-03-28 13:06:20 -07:00
Eric Traut 178d2b00b1 Remove the codex-tui app-server originator workaround (#16116)
## Summary
- remove the temporary `codex-tui` special-case when setting the default
originator during app-server initialization
2026-03-28 13:53:33 -06:00
Michael Bolin 23ff2a1795 Merge ac60b5ba8f into sapling-pr-archive-bolinfest 2026-03-28 12:52:48 -07:00
Michael Bolin ac60b5ba8f ci: run Windows argument-comment-lint via native Bazel 2026-03-28 12:51:54 -07:00
Eric Traut 48144a7fa4 Remove remaining custom prompt support (#16115)
## Summary
- remove protocol and core support for discovering and listing custom
prompts
- simplify the TUI slash-command flow and command popup to built-in
commands only
- delete obsolete custom prompt tests, helpers, and docs references
- clean up downstream event handling for the removed protocol events
2026-03-28 13:49:37 -06:00
Michael Bolin ec68f8c22a merge commit for archive created by Sapling 2026-03-28 12:49:19 -07:00
Michael Bolin 90e10bbc19 stabilize zsh-fork approvals and resume --last 2026-03-28 12:48:29 -07:00
Michael Bolin 92f520af4c merge commit for archive created by Sapling 2026-03-28 12:45:12 -07:00
Michael Bolin da925f1770 ci: run Windows argument-comment-lint via native Bazel 2026-03-28 12:44:56 -07:00
Michael Bolin fce0f76d57 build: migrate argument-comment-lint to a native Bazel aspect (#16106)
## Why

`argument-comment-lint` had become a PR bottleneck because the repo-wide
lane was still effectively running a `cargo dylint`-style flow across
the workspace instead of reusing Bazel's Rust dependency graph. That
kept the lint enforced, but it threw away the main benefit of moving
this job under Bazel in the first place: metadata reuse and cacheable
per-target analysis in the same shape as Clippy.

This change moves the repo-wide lint onto a native Bazel Rust aspect so
Linux and macOS can lint `codex-rs` without rebuilding the world
crate-by-crate through the wrapper path.

## What Changed

- add a nightly Rust toolchain with `rustc-dev` for Bazel and a
dedicated crate-universe repo for `tools/argument-comment-lint`
- add `tools/argument-comment-lint/driver.rs` and
`tools/argument-comment-lint/lint_aspect.bzl` so Bazel can run the lint
as a custom `rustc_driver`
- switch repo-wide `just argument-comment-lint` and the Linux/macOS
`rust-ci` lanes to `bazel build --config=argument-comment-lint
//codex-rs/...`
- keep the Python/DotSlash wrappers as the package-scoped fallback path
and as the current Windows CI path
- gate the Dylint entrypoint behind a `bazel_native` feature so the
Bazel-native library avoids the `dylint_*` packaging stack
- update the aspect runtime environment so the driver can locate
`rustc_driver` correctly under remote execution
- keep the dedicated `tools/argument-comment-lint` package tests and
wrapper unit tests in CI so the source and packaged entrypoints remain
covered

## Verification

- `python3 -m unittest discover -s tools/argument-comment-lint -p
'test_*.py'`
- `cargo test` in `tools/argument-comment-lint`
- `bazel build
//tools/argument-comment-lint:argument-comment-lint-driver
--@rules_rust//rust/toolchain/channel=nightly`
- `bazel build --config=argument-comment-lint
//codex-rs/utils/path-utils:all`
- `bazel build --config=argument-comment-lint
//codex-rs/rollout:rollout`







---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/16106).
* #16120
* __->__ #16106
2026-03-28 12:41:56 -07:00
Michael Bolin 51d174aa3c merge commit for archive created by Sapling 2026-03-28 12:22:53 -07:00
Michael Bolin 5495a3f27e ci: run Windows argument-comment-lint via native Bazel 2026-03-28 12:22:46 -07:00
Michael Bolin 865f58ed79 merge commit for archive created by Sapling 2026-03-28 12:13:58 -07:00
Michael Bolin 6e69a6cac5 ci: run Windows argument-comment-lint via native Bazel 2026-03-28 12:13:49 -07:00
Michael Bolin 7310bf6389 merge commit for archive created by Sapling 2026-03-28 12:03:13 -07:00
Michael Bolin 0bcb13b032 ci: run Windows argument-comment-lint via native Bazel 2026-03-28 12:02:57 -07:00
Michael Bolin 8c87ac2ca6 Merge b8972c1c39 into sapling-pr-archive-bolinfest 2026-03-28 11:44:00 -07:00