Commit Graph
10777 Commits
Author SHA1 Message Date
Michael Bolin c3f901c4cb Merge 5c3db6d578 into sapling-pr-archive-bolinfest 2026-03-31 17:38:43 -07:00
Michael Bolin 5c3db6d578 Extract tool config into codex-tools 2026-03-31 17:38:37 -07:00
Michael Bolin dedd1c386a fix: suppress status card expect_used warnings after #16351 (#16378)
## Why

Follow-up to #16351.

That PR synchronized Bazel clippy lint levels with Cargo, but two
intentional `expect()` calls in `codex-rs/tui/src/status/card.rs` still
tripped `clippy::expect_used` (I believe #16201 raced with #16351, which
is why it was missed).
2026-03-31 17:38:26 -07:00
Michael Bolin b80e57aef3 Merge ba8176b3b7 into sapling-pr-archive-bolinfest 2026-03-31 17:29:59 -07:00
Michael Bolin 89db1077a0 Merge f6aac79202 into sapling-pr-archive-bolinfest 2026-03-31 17:29:26 -07:00
Michael Bolin f6aac79202 fix: suppress clippy violations that raced with #16351 2026-03-31 17:29:21 -07:00
Michael Bolin 2c4f49f6fb Merge 201fc3847b into sapling-pr-archive-bolinfest 2026-03-31 17:25:36 -07:00
Michael Bolin 201fc3847b fix: suppress clippy violations that raced with #16351 2026-03-31 17:25:29 -07:00
Michael Bolin ba8176b3b7 Extract tool config into codex-tools 2026-03-31 17:12:11 -07:00
Michael Bolin 2e942ce830 ci: sync Bazel clippy lints and fix uncovered violations (#16351)
## Why

Follow-up to #16345, the Bazel clippy rollout in #15955, and the cleanup
pass in #16353.

`cargo clippy` was enforcing the workspace deny-list from
`codex-rs/Cargo.toml` because the member crates opt into `[lints]
workspace = true`, but Bazel clippy was only using `rules_rust` plus
`clippy.toml`. That left the Bazel lane vulnerable to drift:
`clippy.toml` can tune lint behavior, but it cannot set
allow/warn/deny/forbid levels.

This PR now closes both sides of the follow-up. It keeps `.bazelrc` in
sync with `[workspace.lints.clippy]`, and it fixes the real clippy
violations that the newly-synced Windows Bazel lane surfaced once that
deny-list started matching Cargo.

## What Changed

- added `.github/scripts/verify_bazel_clippy_lints.py`, a Python check
that parses `codex-rs/Cargo.toml` with `tomllib`, reads the Bazel
`build:clippy` `clippy_flag` entries from `.bazelrc`, and reports
missing, extra, or mismatched lint levels
- ran that verifier from the lightweight `ci.yml` workflow so the sync
check does not depend on a Rust toolchain being installed first
- expanded the `.bazelrc` comment to explain the Cargo `workspace =
true` linkage and why Bazel needs the deny-list duplicated explicitly
- fixed the Windows-only `codex-windows-sandbox` violations that Bazel
clippy reported after the sync, using the same style as #16353: inline
`format!` args, method references instead of trivial closures, removed
redundant clones, and replaced SID conversion `unwrap` and `expect`
calls with proper errors
- cleaned up the remaining cross-platform violations the Bazel lane
exposed in `codex-backend-client` and `core_test_support`

## Testing

Key new test introduced by this PR:

`python3 .github/scripts/verify_bazel_clippy_lints.py`
2026-03-31 17:09:48 -07:00
Michael Bolin c980215c2c Merge d7aa3eecf2 into sapling-pr-archive-bolinfest 2026-03-31 16:38:02 -07:00
Michael Bolin d7aa3eecf2 docs: update argument_comment_lint instructions in AGENTS.md 2026-03-31 16:37:47 -07:00
Eric Traut ae057e0bb9 Fix stale /status rate limits in active TUI sessions (#16201)
Fix stale weekly limit in `/status` (#16194): /status reused the
session’s cached rate-limit snapshot, so the weekly remaining limit
could stay frozen within an active session.

With this change, we now dynamically update the rate limits after status
is displayed.

I needed to delete a few low-value test cases from the chatWidget tests
because the test.rs file is really large, and the new tests in this PR
pushed us over the 512K mandated limit. I'm working on a separate PR to
refactor that test file.
2026-03-31 17:03:05 -06:00
Eric Traut 424e532a6b Refactor chatwidget tests into topical modules (#16361)
Problem: `chatwidget/tests.rs` had grown into a single oversized test
blob that was hard to maintain and exceeded the repo's blob size limit.

Solution: split the chatwidget tests into topical modules with a thin
root `tests.rs`, shared helper utilities, preserved snapshot naming, and
hermetic test config so the refactor stays stable and passes the
`codex-tui` test suite.
2026-03-31 16:45:58 -06:00
Michael Bolin ca3d36bc60 merge commit for archive created by Sapling 2026-03-31 15:36:28 -07:00
Michael Bolin a1f9eda176 ci: sync Bazel clippy lints and fix uncovered violations 2026-03-31 15:36:14 -07:00
Michael Bolin d560ed70a8 Merge b7d5f40280 into sapling-pr-archive-bolinfest 2026-03-31 15:14:50 -07:00
Michael Bolin b7d5f40280 ci: sync Bazel clippy lints and fix uncovered violations 2026-03-31 15:14:19 -07:00
Michael Bolin 28873317f4 Merge d689bb5e32 into sapling-pr-archive-bolinfest 2026-03-31 15:13:36 -07:00
Michael Bolin d689bb5e32 ci: sync Bazel clippy lints and fix uncovered violations 2026-03-31 15:13:29 -07:00
Michael Bolin 9a8730f31e ci: verify codex-rs Cargo manifests inherit workspace settings (#16353)
## Why

Bazel clippy now catches lints that `cargo clippy` can still miss when a
crate under `codex-rs` forgets to opt into workspace lints. The concrete
example here was `codex-rs/app-server/tests/common/Cargo.toml`: Bazel
flagged a clippy violation in `models_cache.rs`, but Cargo did not
because that crate inherited workspace package metadata without
declaring `[lints] workspace = true`.

We already mirror the workspace clippy deny list into Bazel after
[#15955](https://github.com/openai/codex/pull/15955), so we also need a
repo-side check that keeps every `codex-rs` manifest opted into the same
workspace settings.

## What changed

- add `.github/scripts/verify_cargo_workspace_manifests.py`, which
parses every `codex-rs/**/Cargo.toml` with `tomllib` and verifies:
  - `version.workspace = true`
  - `edition.workspace = true`
  - `license.workspace = true`
  - `[lints] workspace = true`
- top-level crate names follow the `codex-*` / `codex-utils-*`
conventions, with explicit exceptions for `windows-sandbox-rs` and
`utils/path-utils`
- run that script in `.github/workflows/ci.yml`
- update the current outlier manifests so the check is enforceable
immediately
- fix the newly exposed clippy violations in the affected crates
(`app-server/tests/common`, `file-search`, `feedback`,
`shell-escalation`, and `debug-client`)






---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/16353).
* #16351
* __->__ #16353
2026-03-31 21:59:28 +00:00
Michael Bolin 04ec9ef8af Fix Windows external bearer refresh test (#16366)
## Why

https://github.com/openai/codex/pull/16287 introduced a change to
`codex-rs/login/src/auth/auth_tests.rs` that uses a PowerShell helper to
read the next token from `tokens.txt` and rewrite the remainder back to
disk. On Windows, `Get-Content` can return a scalar when the file has
only one remaining line, so `$lines[0]` reads the first character
instead of the full token. That breaks the external bearer refresh test
once the token list is nearly exhausted.

https://github.com/openai/codex/pull/16288 introduced similar changes to
`codex-rs/core/src/models_manager/manager_tests.rs` and
`codex-rs/core/tests/suite/client.rs`.

These went unnoticed because the failures showed up when the test was
run via Cargo on Windows, but not in our Bazel harness. Figuring out
that Cargo-vs-Bazel delta will happen in a follow-up PR.

## Verification

On my Windows machine, I verified `cargo test` passes when run in
`codex-rs/login` and `codex-rs/core`. Once this PR is merged, I will
keep an eye on
https://github.com/openai/codex/actions/workflows/rust-ci-full.yml to
verify it goes green.

## What changed

- Wrap `Get-Content -Path tokens.txt` in `@(...)` so the script always
gets array semantics before counting, indexing, and rewriting the
remaining lines.
2026-03-31 14:44:54 -07:00
Michael Bolin 847dbd1c26 merge commit for archive created by Sapling 2026-03-31 14:34:50 -07:00
Michael Bolin d0f053c39b ci: verify codex-rs Cargo manifests inherit workspace settings 2026-03-31 14:34:31 -07:00
Michael Bolin b9e6f8f440 ci: verify Bazel clippy lints stay synced with Cargo workspace 2026-03-31 14:34:31 -07:00
Michael Bolin 308cb3006e Merge d4f97462a6 into sapling-pr-archive-bolinfest 2026-03-31 14:22:14 -07:00
Michael Bolin d4f97462a6 ci: verify Bazel clippy lints stay synced with Cargo workspace 2026-03-31 14:22:07 -07:00
Michael Bolin 1707cd523a ci: verify codex-rs Cargo manifests inherit workspace settings 2026-03-31 14:22:07 -07:00
Michael Bolin bc38a59393 merge commit for archive created by Sapling 2026-03-31 14:08:04 -07:00
Michael Bolin 1f748b1fe8 ci: verify Bazel clippy lints stay synced with Cargo workspace 2026-03-31 14:07:54 -07:00
Michael Bolin af3f6cbfb7 ci: verify codex-rs Cargo manifests inherit workspace settings 2026-03-31 14:07:54 -07:00
Michael Bolin aefa684b80 merge commit for archive created by Sapling 2026-03-31 14:04:01 -07:00
Michael Bolin 5565515429 ci: verify Bazel clippy lints stay synced with Cargo workspace 2026-03-31 14:03:42 -07:00
Michael Bolin b977dc96dc ci: verify codex-rs Cargo manifests inherit workspace settings 2026-03-31 14:03:42 -07:00
Eric Traut 103acdfb06 Refactor external auth to use a single trait (#16356)
## Summary
- Replace the separate external auth enum and refresher trait with a
single `ExternalAuth` trait in login auth flow
- Move bearer token auth behind `BearerTokenRefresher` and update
`AuthManager` and app-server wiring to use the generic external auth API
2026-03-31 14:54:18 -06:00
Eric Traut 0fe873ad5f Fix PR babysitter review comment monitoring (#16363)
## Summary
- prioritize newly surfaced review comments ahead of CI and mergeability
handling in the PR babysitter watcher
- keep `--watch` running for open PRs even when they are currently
merge-ready so later review feedback is not missed
2026-03-31 14:25:32 -06:00
Michael Bolin 2f85a4c5fa merge commit for archive created by Sapling 2026-03-31 12:32:55 -07:00
Michael Bolin 4c319c117a ci: verify Bazel clippy lints stay synced with Cargo workspace 2026-03-31 12:32:38 -07:00
Michael Bolin 4d1c91f417 ci: verify codex-rs Cargo manifests inherit workspace settings 2026-03-31 12:32:38 -07:00
rhan-oai e8de4ea953 [codex-analytics] thread events (#15690)
- add event for thread initialization
- thread/start, thread/fork, thread/resume
- feature flagged behind `FeatureFlag::GeneralAnalytics`
- does not yet support threads started by subagents

PR stack:
- --> [[telemetry] thread events
#15690](https://github.com/openai/codex/pull/15690)
- [[telemetry] subagent events
#15915](https://github.com/openai/codex/pull/15915)
- [[telemetry] turn events
#15591](https://github.com/openai/codex/pull/15591)
- [[telemetry] steer events
#15697](https://github.com/openai/codex/pull/15697)
- [[telemetry] queued prompt data
#15804](https://github.com/openai/codex/pull/15804)


Sample extracted logs in Codex-backend
```
INFO     | 2026-03-29 16:39:37 | codex_backend.routers.analytics_events | analytics_events.track_analytics_events:398 | Tracked analytics event codex_thread_initialized thread_id=019d3bf7-9f5f-7f82-9877-6d48d1052531 product_surface=codex product_client_id=CODEX_CLI client_name=codex-tui client_version=0.0.0 rpc_transport=in_process experimental_api_enabled=True codex_rs_version=0.0.0 runtime_os=macos runtime_os_version=26.4.0 runtime_arch=aarch64 model=gpt-5.3-codex ephemeral=False thread_source=user initialization_mode=new subagent_source=None parent_thread_id=None created_at=1774827577 | 
INFO     | 2026-03-29 16:45:46 | codex_backend.routers.analytics_events | analytics_events.track_analytics_events:398 | Tracked analytics event codex_thread_initialized thread_id=019d3b84-5731-79d0-9b3b-9c6efe5f5066 product_surface=codex product_client_id=CODEX_CLI client_name=codex-tui client_version=0.0.0 rpc_transport=in_process experimental_api_enabled=True codex_rs_version=0.0.0 runtime_os=macos runtime_os_version=26.4.0 runtime_arch=aarch64 model=gpt-5.3-codex ephemeral=False thread_source=user initialization_mode=resumed subagent_source=None parent_thread_id=None created_at=1774820022 | 
INFO     | 2026-03-29 16:45:49 | codex_backend.routers.analytics_events | analytics_events.track_analytics_events:398 | Tracked analytics event codex_thread_initialized thread_id=019d3bfd-4cd6-7c12-a13e-48cef02e8c4d product_surface=codex product_client_id=CODEX_CLI client_name=codex-tui client_version=0.0.0 rpc_transport=in_process experimental_api_enabled=True codex_rs_version=0.0.0 runtime_os=macos runtime_os_version=26.4.0 runtime_arch=aarch64 model=gpt-5.3-codex ephemeral=False thread_source=user initialization_mode=forked subagent_source=None parent_thread_id=None created_at=1774827949 | 
INFO     | 2026-03-29 17:20:29 | codex_backend.routers.analytics_events | analytics_events.track_analytics_events:398 | Tracked analytics event codex_thread_initialized thread_id=019d3c1d-0412-7ed2-ad24-c9c0881a36b0 product_surface=codex product_client_id=CODEX_SERVICE_EXEC client_name=codex_exec client_version=0.0.0 rpc_transport=in_process experimental_api_enabled=True codex_rs_version=0.0.0 runtime_os=macos runtime_os_version=26.4.0 runtime_arch=aarch64 model=gpt-5.3-codex ephemeral=False thread_source=user initialization_mode=new subagent_source=None parent_thread_id=None created_at=1774830027 | 
```

Notes
- `product_client_id` gets canonicalized in codex-backend
- subagent threads are addressed in a following pr
2026-03-31 12:16:44 -07:00
jif-oai 868ac158d7 feat: log db better maintenance (#16330)
Run a DB clean-up more frequently with an incremental `VACCUM` in it
2026-03-31 19:15:44 +02:00
Michael Bolin d53d2db436 Merge e94a91e8ea into sapling-pr-archive-bolinfest 2026-03-31 09:59:44 -07:00
Michael Bolin e94a91e8ea ci: verify Bazel clippy lints stay synced with Cargo workspace 2026-03-31 09:59:34 -07:00
Michael Bolin c26c1c071d merge commit for archive created by Sapling 2026-03-31 09:57:42 -07:00
Michael Bolin 20ab10d982 ci: verify codex-rs Cargo manifests inherit workspace settings 2026-03-31 09:57:24 -07:00
Eric Traut f396454097 Route TUI /feedback submission through the app server (#16184)
The TUI’s `/feedback` flow was still uploading directly through the
local feedback crate, which bypassed app-server behavior such as
auth-derived feedback tags like chatgpt_user_id and made TUI feedback
handling diverge from other clients. It also meant that remove TUI
sessions failed to upload the correct feedback logs and session details.

Testing: Manually tested `/feedback` flow and confirmed that it didn't
regress.
2026-03-31 10:36:47 -06:00
Michael Bolin ce11bd4353 Merge fdb5c20763 into sapling-pr-archive-bolinfest 2026-03-31 09:30:57 -07:00
Michael Bolin fdb5c20763 ci: verify Bazel clippy lints stay synced with Cargo workspace 2026-03-31 09:30:47 -07:00
Michael Bolin 03b2465591 fix: fix clippy issue caught by cargo but not bazel (#16345)
I noticed that
https://github.com/openai/codex/actions/workflows/rust-ci-full.yml
started failing on my own PR,
https://github.com/openai/codex/pull/16288, even though CI was green
when I merged it.

Apparently, it introduced a lint violation that was [correctly!] caught
by our Cargo-based clippy runner, but not our Bazel-based one.

My next step is to figure out the reason for the delta between the two
setups, but I wanted to get us green again quickly, first.
2026-03-31 16:01:06 +00:00
Michael Bolin 8d0d89eda1 merge commit for archive created by Sapling 2026-03-31 08:44:44 -07:00