Commit Graph
10791 Commits
Author SHA1 Message Date
Michael Bolin 0c6a595d1d auth: let AuthManager own external bearer auth 2026-03-30 17:33:19 -07:00
Michael Bolin d6c965ac5e core: support dynamic auth tokens for model providers 2026-03-30 17:33:19 -07:00
Michael Bolin 86131560f0 merge commit for archive created by Sapling 2026-03-30 17:24:40 -07:00
Michael Bolin 4e7d4648ef auth: generalize external auth tokens for bearer-only sources 2026-03-30 17:24:10 -07:00
Michael Bolin c0dac22598 core: support dynamic auth tokens for model providers 2026-03-30 17:24:10 -07:00
Michael Bolin 3da331840c auth: let AuthManager own external bearer auth 2026-03-30 17:24:10 -07:00
Michael Bolin 4b438b7b82 Merge c1c63e8f83 into sapling-pr-archive-bolinfest 2026-03-30 16:56:54 -07:00
Michael Bolin c1c63e8f83 core: support dynamic auth tokens for model providers 2026-03-30 16:55:43 -07:00
Michael Bolin 0cca7998a8 merge commit for archive created by Sapling 2026-03-30 16:51:54 -07:00
Michael Bolin 770ed064cf core: support dynamic auth tokens for model providers 2026-03-30 16:51:30 -07:00
Michael Bolin 4127419694 auth: let AuthManager own external bearer auth 2026-03-30 16:27:55 -07:00
Michael Bolin b397919da1 auth: generalize external auth tokens for bearer-only sources 2026-03-30 16:20:45 -07:00
Michael Bolin 2f37a8058d merge commit for archive created by Sapling 2026-03-30 15:41:21 -07:00
Michael Bolin 7c5ddebcae core: support dynamic auth tokens for model providers 2026-03-30 15:41:07 -07:00
Michael Bolin e953180be9 auth: generalize ExternalAuthTokens for bearer-only refreshers 2026-03-30 15:40:51 -07:00
Michael Bolin 19f0d196d1 ci: run Windows argument-comment-lint via native Bazel (#16120)
## Why

Follow-up to #16106.

`argument-comment-lint` already runs as a native Bazel aspect on Linux
and macOS, but Windows is still the long pole in `rust-ci`. To move
Windows onto the same native Bazel lane, the toolchain split has to let
exec-side helper binaries build in an MSVC environment while still
linting repo crates as `windows-gnullvm`.

Pushing the Windows lane onto the native Bazel path exposed a second
round of Windows-only issues in the mixed exec-toolchain plumbing after
the initial wrapper/target fixes landed.

## What Changed

- keep the Windows lint lanes on the native Bazel/aspect path in
`rust-ci.yml` and `rust-ci-full.yml`
- add a dedicated `local_windows_msvc` platform for exec-side helper
binaries while keeping `local_windows` as the `windows-gnullvm` target
platform
- patch `rules_rust` so `repository_set(...)` preserves explicit
exec-platform constraints for the generated toolchains, keep the
Windows-specific bootstrap/direct-link fixes needed for the nightly lint
driver, and expose exec-side `rustc-dev` `.rlib`s to the MSVC sysroot
- register the custom Windows nightly toolchain set with MSVC exec
constraints while still exposing both `x86_64-pc-windows-msvc` and
`x86_64-pc-windows-gnullvm` targets
- enable `dev_components` on the custom Windows nightly repository set
so the MSVC exec helper toolchain actually downloads the
compiler-internal crates that `clippy_utils` needs
- teach `run-argument-comment-lint-bazel.sh` to enumerate concrete
Windows Rust rules, normalize the resulting labels, and skip explicitly
requested incompatible targets instead of failing before the lint run
starts
- patch `rules_rust` build-script env propagation so exec-side
`windows-msvc` helper crates drop forwarded MinGW include and linker
search paths as whole flag/path pairs instead of emitting malformed
`CFLAGS`, `CXXFLAGS`, and `LDFLAGS`
- export the Windows VS/MSVC SDK environment in `setup-bazel-ci` and
pass the relevant variables through `run-bazel-ci.sh` via `--action_env`
/ `--host_action_env` so Bazel build scripts can see the MSVC and UCRT
headers on native Windows runs
- add inline comments to the Windows `setup-bazel-ci` MSVC environment
export step so it is easier to audit how `vswhere`, `VsDevCmd.bat`, and
the filtered `GITHUB_ENV` export fit together
- patch `aws-lc-sys` to skip its standalone `memcmp` probe under Bazel
`windows-msvc` build-script environments, which avoids a Windows-native
toolchain mismatch that blocked the lint lane before it reached the
aspect execution
- patch `aws-lc-sys` to prefer its bundled `prebuilt-nasm` objects for
Bazel `windows-msvc` build-script runs, which avoids missing
`generated-src/win-x86_64/*.asm` runfiles in the exec-side helper
toolchain
- annotate the Linux test-only callsites in `codex-rs/linux-sandbox` and
`codex-rs/core` that the wider native lint coverage surfaced

## Patches

This PR introduces a large patch stack because the Windows Bazel lint
lane currently depends on behavior that upstream dependencies do not
provide out of the box in the mixed `windows-gnullvm` target /
`windows-msvc` exec-toolchain setup.

- Most of the `rules_rust` patches look like upstream candidates rather
than OpenAI-only policy. Preserving explicit exec-platform constraints,
forwarding the right MSVC/UCRT environment into exec-side build scripts,
exposing exec-side `rustc-dev` artifacts, and keeping the Windows
bootstrap/linker behavior coherent all look like fixes to the Bazel/Rust
integration layer itself.
- The two `aws-lc-sys` patches are more tactical. They special-case
Bazel `windows-msvc` build-script environments to avoid a `memcmp` probe
mismatch and missing NASM runfiles. Those may be harder to upstream
as-is because they rely on Bazel-specific detection instead of a general
Cargo/build-script contract.
- Short term, carrying these patches in-tree is reasonable because they
unblock a real CI lane and are still narrow enough to audit. Long term,
the goal should not be to keep growing a permanent local fork of either
dependency.
- My current expectation is that the `rules_rust` patches are less
controversial and should be broken out into focused upstream proposals,
while the `aws-lc-sys` patches are more likely to be temporary escape
hatches unless that crate wants a more general hook for hermetic build
systems.

Suggested follow-up plan:

1. Split the `rules_rust` deltas into upstream-sized PRs or issues with
minimized repros.
2. Revisit the `aws-lc-sys` patches during the next dependency bump and
see whether they can be replaced by an upstream fix, a crate upgrade, or
a cleaner opt-in mechanism.
3. Treat each dependency update as a chance to delete patches one by one
so the local patch set only contains still-needed deltas.

## Verification

- `./.github/scripts/run-argument-comment-lint-bazel.sh
--config=argument-comment-lint --keep_going`
- `RUNNER_OS=Windows
./.github/scripts/run-argument-comment-lint-bazel.sh --nobuild
--config=argument-comment-lint --platforms=//:local_windows
--keep_going`
- `cargo test -p codex-linux-sandbox`
- `cargo test -p codex-core shell_snapshot_tests`
- `just argument-comment-lint`

## References

- #16106
2026-03-30 15:32:04 -07:00
Andrey Mishchenko 390b644b21 Update code mode exec() instructions (#16279) 2026-03-30 12:31:13 -10:00
Michael Bolin e9eff3f36d merge commit for archive created by Sapling 2026-03-30 15:12:22 -07:00
Michael Bolin 0110a82808 core: support dynamic auth tokens for model providers 2026-03-30 15:12:15 -07:00
Michael Bolin 6475f6e229 merge commit for archive created by Sapling 2026-03-30 14:41:48 -07:00
Michael Bolin 84ed96f3f7 core: support dynamic auth tokens for model providers 2026-03-30 14:41:33 -07:00
Michael Bolin f06f0a7f3e auth: generalize ExternalAuthTokens for bearer-only refreshers 2026-03-30 14:32:02 -07:00
rhan-oai 28a9807f84 [codex-analytics] refactor analytics to use reducer architecture (#16225)
- rework codex analytics crate to use reducer / publish architecture
- in anticipation of extensive codex analytics
2026-03-30 14:27:12 -07:00
Michael Bolin db6c7f9c4c merge commit for archive created by Sapling 2026-03-30 14:02:46 -07:00
Michael Bolin d4cf2faae8 core: unify request auth and 401 recovery plumbing 2026-03-30 14:02:34 -07:00
Michael Bolin 056d9e482b core: support dynamic auth tokens for model providers 2026-03-30 14:02:34 -07:00
Michael Bolin 19c6336f57 Merge c75c3ab31a into sapling-pr-archive-bolinfest 2026-03-30 13:59:58 -07:00
Michael Bolin c75c3ab31a core: support dynamic auth tokens for model providers 2026-03-30 13:59:49 -07:00
Michael Bolin 65a3e63f1c core: unify request auth and 401 recovery plumbing 2026-03-30 13:59:49 -07:00
Michael Bolin 47954f929e merge commit for archive created by Sapling 2026-03-30 13:59:22 -07:00
Michael Bolin 46c6201955 core: support dynamic auth tokens for model providers 2026-03-30 13:59:02 -07:00
Michael Bolin 99f4516bac core: unify request auth and 401 recovery plumbing 2026-03-30 13:59:02 -07:00
Michael Bolin a18f9c883f Merge bcacd8dc8a into sapling-pr-archive-bolinfest 2026-03-30 13:50:09 -07:00
Michael Bolin bcacd8dc8a core: support dynamic auth tokens for model providers 2026-03-30 13:49:43 -07:00
Michael Bolin 74fb048777 core: unify request auth and 401 recovery plumbing 2026-03-30 13:49:13 -07:00
Michael Bolin dd2520cd06 merge commit for archive created by Sapling 2026-03-30 13:20:36 -07:00
Michael Bolin 807527f9e7 core: support dynamic auth tokens for model providers 2026-03-30 13:20:28 -07:00
Michael Bolin 1ac9b70fd4 merge commit for archive created by Sapling 2026-03-30 12:47:07 -07:00
Michael Bolin f0677065e2 add support for dynamic auth token for model provider 2026-03-30 12:46:44 -07:00
Michael Bolin da3f36bca7 Merge be08ad0e4b into sapling-pr-archive-bolinfest 2026-03-30 12:13:13 -07:00
Michael Bolin be08ad0e4b add support for dynamic auth token for model provider 2026-03-30 12:13:05 -07:00
Michael Bolin 9313c49e4c fix: close Bazel argument-comment-lint CI gaps (#16253)
## Why

The Bazel-backed `argument-comment-lint` CI path had two gaps:

- Bazel wildcard target expansion skipped inline unit-test crates from
`src/` modules because the generated `*-unit-tests-bin` `rust_test`
targets are tagged `manual`.
- `argument-comment-mismatch` was still only a warning in the Bazel and
packaged-wrapper entrypoints, so a typoed `/*param_name*/` comment could
still pass CI even when the lint detected it.

That left CI blind to real linux-sandbox examples, including the missing
`/*local_port*/` comment in
`codex-rs/linux-sandbox/src/proxy_routing.rs` and typoed argument
comments in `codex-rs/linux-sandbox/src/landlock.rs`.

## What Changed

- Added `tools/argument-comment-lint/list-bazel-targets.sh` so Bazel
lint runs cover `//codex-rs/...` plus the manual `rust_test`
`*-unit-tests-bin` targets.
- Updated `just argument-comment-lint`, `rust-ci.yml`, and
`rust-ci-full.yml` to use that helper.
- Promoted both `argument-comment-mismatch` and
`uncommented-anonymous-literal-argument` to errors in every strict
entrypoint:
  - `tools/argument-comment-lint/lint_aspect.bzl`
  - `tools/argument-comment-lint/src/bin/argument-comment-lint.rs`
  - `tools/argument-comment-lint/wrapper_common.py`
- Added wrapper/bin coverage for the stricter lint flags and documented
the behavior in `tools/argument-comment-lint/README.md`.
- Fixed the now-covered callsites in
`codex-rs/linux-sandbox/src/proxy_routing.rs`,
`codex-rs/linux-sandbox/src/landlock.rs`, and
`codex-rs/core/src/shell_snapshot_tests.rs`.

This keeps the Bazel target expansion narrow while making the Bazel and
prebuilt-linter paths enforce the same strict lint set.

## Verification

- `python3 -m unittest discover -s tools/argument-comment-lint -p
'test_*.py'`
- `cargo +nightly-2025-09-18 test --manifest-path
tools/argument-comment-lint/Cargo.toml`
- `just argument-comment-lint`
2026-03-30 11:59:50 -07:00
Michael Bolin 0822eddb34 merge commit for archive created by Sapling 2026-03-30 11:40:57 -07:00
Michael Bolin cb2f809c0a fix: address coverage gap in argument-comment-lint 2026-03-30 11:40:51 -07:00
Michael Bolin 0532d91efd merge commit for archive created by Sapling 2026-03-30 11:35:59 -07:00
Michael Bolin 172ae48e90 fix: address coverage gap in argument-comment-lint 2026-03-30 11:35:53 -07:00
Michael Bolin 68935eaae7 merge commit for archive created by Sapling 2026-03-30 11:11:02 -07:00
Michael Bolin 481dcac051 fix: address coverage gap in argument-comment-lint 2026-03-30 11:10:52 -07:00
Michael Bolin f56789fd70 Merge 81ac8343be into sapling-pr-archive-bolinfest 2026-03-30 10:57:25 -07:00
Michael Bolin 81ac8343be fix: address coverage gap in argument-comment-lint 2026-03-30 10:57:21 -07:00