Commit Graph
10568 Commits
Author SHA1 Message Date
Michael Bolin 06ec95588c Merge 24dfe15aca into sapling-pr-archive-bolinfest 2026-03-28 15:12:06 -07:00
Michael Bolin a56d6f8db9 merge commit for archive created by Sapling 2026-03-28 15:11:43 -07:00
Michael Bolin 7217a9c71f Merge f727c17712 into sapling-pr-archive-bolinfest 2026-03-28 15:11:17 -07:00
Michael Bolin f727c17712 ci: align just bazel test helpers with Bazel workflow behavior 2026-03-28 15:11:09 -07:00
Michael Bolin 24dfe15aca permissions: start using PermissionProfile as the canonical runtime model 2026-03-28 15:11:01 -07:00
Michael Bolin d942ea1e87 codex-tools: extract code mode tool spec adapters 2026-03-28 15:10:47 -07:00
Michael Bolin 133c2065fb merge commit for archive created by Sapling 2026-03-28 15:03:14 -07:00
Michael Bolin 8e869a58db ci: run Windows argument-comment-lint via native Bazel 2026-03-28 15:03:03 -07:00
Michael Bolin c25c0d6e9e core: fix stale curated plugin cache refresh races (#16126)
## Why

The `plugin/list` force-sync path can race app-server startup's curated
plugin cache refresh.

Startup was capturing the configured curated plugin IDs from the initial
config snapshot. If `plugin/list` with `forceRemoteSync` removed curated
plugin entries from `config.toml` while that background refresh was
still in flight, the startup task could recreate cache directories for
plugins that had just been uninstalled.

That leaves the `plugin/list` response logically correct but the on-disk
cache stale, which matches the flaky Ubuntu arm failure seen in
`codex-app-server::all
suite::v2::plugin_list::plugin_list_force_remote_sync_reconciles_curated_plugin_state`
while validating [#16047](https://github.com/openai/codex/pull/16047).

## What

- change `codex-rs/core/src/plugins/manager.rs` so startup curated-repo
refresh rereads the current user `config.toml` before deciding which
curated plugin cache entries to refresh
- factor the configured-plugin parsing so the same logic can be reused
from either the config layer stack or the persisted user config value
- add a regression test that verifies curated plugin IDs are read from
the latest user config state before cache refresh runs

## Testing

- `cargo test -p codex-core
configured_curated_plugin_ids_from_codex_home_reads_latest_user_config
-- --nocapture`
- `cargo test -p codex-app-server
suite::v2::plugin_list::plugin_list_force_remote_sync_reconciles_curated_plugin_state
-- --nocapture`
- `just argument-comment-lint`
2026-03-28 15:00:39 -07:00
Michael Bolin 313fb95989 ci: keep rust-ci-full Windows argument-comment-lint on packaged wrapper (#16130)
## Why

PR #16106 switched `rust-ci-full` over to the native Bazel-backed
`argument-comment-lint` path on all three platforms.

That works on Linux and macOS, but the Windows leg in `rust-ci-full` now
fails before linting starts: Bazel dies while building `rules_rust`'s
`process_wrapper` tool, so `main` reports an `argument-comment-lint`
failure even though no Rust lint finding was produced.

Until native Windows Bazel linting is repaired, `rust-ci-full` should
keep the same Windows split that `rust-ci.yml` already uses.

## What changed

- restored the Windows-only nightly `argument-comment-lint` toolchain
setup in `rust-ci-full`
- limited the Bazel-backed lint step in `rust-ci-full` to non-Windows
runners
- routed the Windows runner back through
`tools/argument-comment-lint/run-prebuilt-linter.py`
- left the Linux and macOS `rust-ci-full` behavior unchanged

## Test plan

- loaded `.github/workflows/rust-ci-full.yml` and
`.github/workflows/rust-ci.yml` with `python3` + `yaml.safe_load(...)`
- inspected failing Actions run `23692864849`, especially job
`69023229311`, to confirm the Windows failure occurs in Bazel
`process_wrapper` setup before lint output is emitted

## References

- #16106
2026-03-28 14:50:19 -07:00
Michael Bolin af93c2bc0e merge commit for archive created by Sapling 2026-03-28 14:48:01 -07:00
Michael Bolin 0f9982b769 ci: run Windows argument-comment-lint via native Bazel 2026-03-28 14:47:55 -07:00
Michael Bolin 7133cfd318 Merge 150de48a83 into sapling-pr-archive-bolinfest 2026-03-28 14:39:09 -07:00
Michael Bolin 150de48a83 ci: align just bazel test targets with workflow exclusions 2026-03-28 14:38:56 -07:00
Michael Bolin 019190a7ff merge commit for archive created by Sapling 2026-03-28 14:37:08 -07:00
Michael Bolin fe087ad8e3 ci: run Windows argument-comment-lint via native Bazel 2026-03-28 14:37:03 -07:00
Michael Bolin a68e4df144 merge commit for archive created by Sapling 2026-03-28 14:34:32 -07:00
Michael Bolin 5fd0d21616 ci: keep rust-ci-full Windows argument-comment-lint on wrapper 2026-03-28 14:34:16 -07:00
Michael Bolin 5f62826a66 merge commit for archive created by Sapling 2026-03-28 14:27:58 -07:00
Michael Bolin 3565dc32e6 ci: run Windows argument-comment-lint via native Bazel 2026-03-28 14:27:52 -07:00
Michael Bolin 4e27a87ec6 codex-tools: extract configured tool specs (#16129)
## Why

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

After `ToolSpec` moved into `codex-tools`, `codex-core` still owned
`ConfiguredToolSpec` and `create_tools_json_for_responses_api()`. Both
are data-model and serialization helpers rather than runtime
orchestration, so keeping them in `core/src/tools/registry.rs` and
`core/src/tools/spec.rs` left passive tool-definition code coupled to
`codex-core` longer than necessary.

## What changed

- moved `ConfiguredToolSpec` into `codex-rs/tools/src/tool_spec.rs`
- moved `create_tools_json_for_responses_api()` into
`codex-rs/tools/src/tool_spec.rs`
- re-exported the new surface from `codex-rs/tools/src/lib.rs`, which
remains exports-only
- updated `core/src/client.rs`, `core/src/tools/registry.rs`, and
`core/src/tools/router.rs` to consume the extracted types and serializer
from `codex-tools`
- moved the tool-list serialization test into
`codex-rs/tools/src/tool_spec_tests.rs`
- added focused unit coverage for `ConfiguredToolSpec::name()`
- simplified `core/src/tools/spec_tests.rs` to use the extracted
`ConfiguredToolSpec::name()` directly and removed the now-redundant
local `tool_name()` helper
- updated `codex-rs/tools/README.md` so the crate boundary reflects the
newly extracted tool-spec wrapper and serialization helper

## Test plan

- `cargo test -p codex-tools`
- `CARGO_TARGET_DIR=/tmp/codex-core-configured-spec cargo test -p
codex-core --lib tools::spec::`
- `CARGO_TARGET_DIR=/tmp/codex-core-configured-spec cargo test -p
codex-core --lib client::`
- `just fix -p codex-tools -p codex-core`
- `just argument-comment-lint`

## References

- #15923
- #15928
- #15944
- #15953
- #16031
- #16047
2026-03-28 14:24:14 -07:00
Michael Bolin 50fc5e30be merge commit for archive created by Sapling 2026-03-28 14:22:09 -07:00
Michael Bolin a7ee675f22 ci: run Windows argument-comment-lint via native Bazel 2026-03-28 14:21:52 -07:00
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