Files
rhan-oaiandpakrym-oai 7a48857579 Backport retained-image compaction budgeting to 0.150 (#41003)
## Summary

Backport #40994 to the 0.150 stable release line. Enable
`compaction_image_budget` by default so retained images count against
the existing remote-compaction token budget and older images are trimmed
as needed. Explicitly disabling the feature preserves the previous
behavior.

The runtime change is a clean cherry-pick of
`528fd7ace5ec0a1c2a387dcb9c76a09f3fa011ee`. The implementation is
already present in 0.150.0; only the feature default/stability and the
existing integration test expectations change.

CI-only corrections address failures already present in the public
release base: recognize the valid `OFlags::WRONLY` identifier in
codespell, remove the obsolete code-mode manifest-feature exception,
remove an unused test import left by the public export, and stage the
code-mode host beside the CLI in SDK tests. The SDK staging change
matches the existing internal workflow. These changes do not alter CLI
runtime behavior or dependencies.

## Validation

- Existing integration coverage exercises default/on/off behavior across
repeated compactions and checks retained images in follow-up requests.
- `just test -p codex-features`: 39 passed, none skipped.
- `just test -p codex-core --test all
remote_compact_v2_charges_retained_images_to_token_budget`: all three
default/on/off cases passed.
- `just test -p codex-core --lib image_budget_tests`: 4 passed.
- `python3 .github/scripts/verify_cargo_workspace_manifests.py`, the
pinned codespell check for the affected identifier, pinned `just fmt`,
and `git diff --check` passed.
- CI must pass on the final head before release.

## Release

Targets `release/0.150`, based on the source commit for 0.150.0
(`076f17c114b0a82d7235552ccec5ff2d69f3266a`). Intended for the next
0.150 stable patch.

---------

Co-authored-by: pakrym-oai <pakrym@openai.com>
2026-08-26 17:40:43 -07:00
..

Workflow Strategy

The workflows in this directory are split so that pull requests get fast, review-friendly signal while main still gets the full cross-platform verification pass.

Pull Requests

  • Required checks run against GitHub's synthetic merge commit, not the pull request head alone. This includes changes already on main and catches conflicts before they reach the branch.
  • bazel.yml is the main pre-merge verification path for Rust code. It runs Bazel test and Bazel clippy on the supported Bazel targets, including the generated Rust test binaries needed to lint inline #[cfg(test)] code.
  • rust-ci.yml keeps the Cargo-native PR checks intentionally small:
    • cargo fmt --check
    • cargo shear
    • argument-comment-lint on Linux, macOS, and Windows
    • tools/argument-comment-lint package tests when the lint or its workflow wiring changes

Post-Merge On main

  • bazel.yml also runs on pushes to main. This re-verifies the merged Bazel path and helps keep the BuildBuddy caches warm.
  • rust-ci-full.yml is the full Cargo-native verification workflow. It keeps the heavier checks off the PR path while still validating them after merge:
    • the full Cargo clippy matrix
    • the full Cargo nextest matrix via per-platform archive-backed shards
    • Windows ARM64 nextest archives cross-compiled on Windows x64, then replayed on native Windows ARM64 shards
    • release-profile Cargo builds
    • cross-platform argument-comment-lint
    • Linux remote-env tests

Rule Of Thumb

  • If a build/test/clippy check can be expressed in Bazel, prefer putting the PR-time version in bazel.yml.
  • Keep rust-ci.yml fast enough that it usually does not dominate PR latency.
  • Reserve rust-ci-full.yml for heavyweight Cargo-native coverage that Bazel does not replace yet.