Skip to content

Account for file images in context budgets and Guardian reviews - #46072

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/ee024204dcbe16e277fea9347c6a4d7fc120e18d
Sep 17, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/ee024204dcbe16e277fea9347c6a4d7fc120e18d

Conversation

@copyberry

@copyberry copyberry Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

Account for file images in context budgets and Guardian reviews

Why

File images contributed zero to history and compaction token estimates and were dropped from Guardian context. This undercounted context usage and omitted image evidence from reviews.

What changed

  • Estimate file images using the fixed resized-image cost, or 10,000 patch tokens for original detail because file references do not expose dimensions.
  • Charge file images against remote compaction and Guardian request budgets.
  • Preserve file images from user messages and tool outputs through Guardian selection and delivery, and deduplicate review images by file ID.
  • Apply transcript image count and byte limits to both reference types, counting file ID bytes rather than referenced file contents.

Testing

Add coverage for file-image estimates, selection limits, delivery, and compaction retention. Extend Guardian tests to verify file-image evidence reaches reviews and uploaded original-detail images trigger reviewer-history compaction.

## Why

File images contributed zero to history and compaction token estimates and were dropped from Guardian context. This undercounted context usage and omitted image evidence from reviews.

## What changed

- Estimate file images using the fixed resized-image cost, or 10,000 patch tokens for `original` detail because file references do not expose dimensions.
- Charge file images against remote compaction and Guardian request budgets.
- Preserve file images from user messages and tool outputs through Guardian selection and delivery, and deduplicate review images by file ID.
- Apply transcript image count and byte limits to both reference types, counting file ID bytes rather than referenced file contents.

## Testing

Add coverage for file-image estimates, selection limits, delivery, and compaction retention. Extend Guardian tests to verify file-image evidence reaches reviews and uploaded original-detail images trigger reviewer-history compaction.

GitOrigin-RevId: ee024204dcbe16e277fea9347c6a4d7fc120e18d
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/ee024204dcbe16e277fea9347c6a4d7fc120e18d branch from 78c08a1 to b974893 Compare September 17, 2026 01:38
@github-actions

Copy link
Copy Markdown
Contributor


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@copyberry
copyberry Bot merged commit b974893 into main Sep 17, 2026
1 check failed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/ee024204dcbe16e277fea9347c6a4d7fc120e18d branch September 17, 2026 01:38
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant