Skip to content

Allow injecting model catalog caches - #36992

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/eef957a317910b8502a0c20f8fc112f689d5e389
Aug 4, 2026
Merged

Allow injecting model catalog caches#36992
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/eef957a317910b8502a0c20f8fc112f689d5e389

Conversation

@copyberry

@copyberry copyberry Bot commented Aug 4, 2026

Copy link
Copy Markdown

Allow injecting model catalog caches

What changed

  • Add the public asynchronous ModelsCache contract and cache entry/error types.
  • Let model providers and OpenAiModelsManager accept caller-provided cache implementations while retaining the existing file-backed cache by default.
  • Treat cache read failures as misses, keep cache write failures non-fatal, and support refreshing an entry's TTL after ETag revalidation.
  • Continue to prefer an explicitly configured static model catalog over an injected cache.

Testing

  • Cover injected cache hits, read and write failures, TTL refreshes, and end-to-end model selection.
  • Verify that the file-backed implementation satisfies the new cache contract and does not serve expired entries before revalidation.

## What changed

- Add the public asynchronous `ModelsCache` contract and cache entry/error types.
- Let model providers and `OpenAiModelsManager` accept caller-provided cache implementations while retaining the existing file-backed cache by default.
- Treat cache read failures as misses, keep cache write failures non-fatal, and support refreshing an entry's TTL after ETag revalidation.
- Continue to prefer an explicitly configured static model catalog over an injected cache.

## Testing

- Cover injected cache hits, read and write failures, TTL refreshes, and end-to-end model selection.
- Verify that the file-backed implementation satisfies the new cache contract and does not serve expired entries before revalidation.

GitOrigin-RevId: eef957a317910b8502a0c20f8fc112f689d5e389
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/eef957a317910b8502a0c20f8fc112f689d5e389 branch from b701286 to 44cb66e Compare August 4, 2026 23:04
@copyberry
copyberry Bot merged commit 44cb66e into main Aug 4, 2026
30 of 32 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/eef957a317910b8502a0c20f8fc112f689d5e389 branch August 4, 2026 23:05
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 4, 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