Skip to content

feat: add GPT-5.6 prompt cache retention - #5

Merged
smolpaws merged 2 commits into
mainfrom
feature/gpt56-prompt-cache-retention
Jul 13, 2026
Merged

feat: add GPT-5.6 prompt cache retention#5
smolpaws merged 2 commits into
mainfrom
feature/gpt56-prompt-cache-retention

Conversation

@smolpaws

Copy link
Copy Markdown
Owner

Summary

  • add persisted promptCacheRetention / promptCacheKey profile fields
  • default direct OpenAI GPT-5.6 Responses and Chat request bodies to prompt_cache_retention: "24h"
  • gate the fields to known-safe direct OpenAI GPT-5.6 routes and strip them for LiteLLM/OpenRouter aliases, unsupported models, and ChatGPT subscription/Codex endpoints
  • document official prompt-caching docs tension plus live OpenAI Responses/Chat probes, including the 5,412-token repeated-prefix cache proof

Live probe highlights

  • Responses prompt_cache_retention: "24h": 200 and echoed "24h"
  • Chat prompt_cache_retention: "24h": 200 with cache usage fields
  • prompt_cache_options.ttl: "24h": 400 on both Responses and Chat; only "30m" was accepted
  • Identical 5,412-token prefix + stable prompt_cache_key produced first-run cache write of 5,409 tokens and subsequent 5,409 cached tokens on both Responses and Chat

Verification

  • npm test
  • npm run typecheck
  • npm run lint
  • npm run build

Stacking

This PR was created by an AI agent (OpenHands) on behalf of Engel Nyst.

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@enyst, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 41 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 94755063-2a6b-4962-93d2-5d0a010a7b68

📥 Commits

Reviewing files that changed from the base of the PR and between aa91ef2 and f61c9f2.

📒 Files selected for processing (12)
  • docs/PROMPT_CACHE_RETENTION.md
  • docs/README.md
  • docs/TRANSPILE_PLAN.md
  • src/conversation/__tests__/event-log-parity.test.ts
  • src/conversation/__tests__/event-log.test.ts
  • src/conversation/__tests__/local-conversation.test.ts
  • src/llm/__tests__/openai-client.test.ts
  • src/llm/index.ts
  • src/llm/openai.ts
  • src/llm/provider-quirks.ts
  • src/settings/__tests__/settings.test.ts
  • src/settings/index.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Co-authored-by: smolpaws <engel@enyst.org>

Co-authored-by: openhands <openhands@all-hands.dev>
@enyst
enyst force-pushed the feature/gpt56-prompt-cache-retention branch from 6f58d45 to 330b0a7 Compare July 13, 2026 19:56
@smolpaws
smolpaws changed the base branch from feature/provider-native-reasoning-docs to main July 13, 2026 19:56
@smolpaws

Copy link
Copy Markdown
Owner Author

@coderabbitai review

This review trigger was posted by an AI agent (OpenHands) on behalf of Engel Nyst.

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

@smolpaws purrs acknowledged 🐾 — hopping in to review the PR now. I'll take a close look at the new promptCacheRetention/promptCacheKey profile fields, the GPT-5.6 route gating logic, and the stacking on #4.

(=^・ω・^=)

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements GPT-5.6 prompt-cache retention support in the TypeScript SDK, introducing new profile fields (promptCacheRetention and promptCacheKey) and integrating them into OpenAI request builders. The feedback suggests improving model version matching using a regular expression to prevent false positives like gpt-5.60, and broadening the base URL check to support provider-branded custom or internal proxy URLs.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/llm/provider-quirks.ts
Comment thread src/llm/provider-quirks.ts
Co-authored-by: smolpaws <engel@enyst.org>

Co-authored-by: openhands <openhands@all-hands.dev>
@smolpaws
smolpaws merged commit 8cfcfcd into main Jul 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants