Client or integration
Codex App
Area
Provider adapter
Summary
In OpenCodex 2.53.0, the Anthropic adapter dynamically calculates image downscaling tiers based on relative recency (initialPosition in anthropic-image-normalize.ts).
When a session appends a new image, earlier images in conversation history are pushed into lower resolution tiers (e.g. dropping from 2000px to 1024px) and re-encoded. This mutates past request bytes and completely invalidates Anthropic's prompt prefix cache, causing substantial token waste and cache misses on subsequent turns.
Expected behavior: Once an image is normalized and sent within a conversation, its encoded bytes/tier should remain immutable across future turns.
Reproduction
- Send an initial turn with 6 images through the Anthropic adapter. Note the encoded base64 hash/size of Image 1.
- In the next turn, append a 7th image to the session.
- Inspect the outgoing Anthropic payload:
- Observed: Image 1 dropped from Tier 1 (2000px) to Tier 2 (1024px); its base64 payload mutated, breaking the prefix cache.
- Expected: Image 1 retains its initial resolution and base64 encoding; prefix cache remains intact.
Version
2.53.0
Operating system
macOS 15.2
Provider and model
anthropic / claude-5-sonnet, openAi / gpt-6,googel / gemini-3.8-flash
Logs or error output
Affected files:
- src/adapters/anthropic-image-codec.ts (tier configs: 6 @ 2000px, 14 @ 1024px, older @ 700px)
- src/adapters/anthropic-image-normalize.ts (line 132 recalculating initialPosition dynamically)
- src/adapters/anthropic.ts (calling normalization per request)
Screenshots and supporting files
No response
Redacted configuration
Checks
Client or integration
Codex App
Area
Provider adapter
Summary
In OpenCodex 2.53.0, the Anthropic adapter dynamically calculates image downscaling tiers based on relative recency (
initialPositioninanthropic-image-normalize.ts).When a session appends a new image, earlier images in conversation history are pushed into lower resolution tiers (e.g. dropping from 2000px to 1024px) and re-encoded. This mutates past request bytes and completely invalidates Anthropic's prompt prefix cache, causing substantial token waste and cache misses on subsequent turns.
Expected behavior: Once an image is normalized and sent within a conversation, its encoded bytes/tier should remain immutable across future turns.
Reproduction
Version
2.53.0
Operating system
macOS 15.2
Provider and model
anthropic / claude-5-sonnet, openAi / gpt-6,googel / gemini-3.8-flash
Logs or error output
Screenshots and supporting files
No response
Redacted configuration
Checks