Skip to content

Fix Messages API cache breakpoint placement#4608

Merged
jeanduplessis merged 1 commit into
mainfrom
fix/messages-cache-breakpoint-placement
Jul 17, 2026
Merged

Fix Messages API cache breakpoint placement#4608
jeanduplessis merged 1 commit into
mainfrom
fix/messages-cache-breakpoint-placement

Conversation

@chrarnoldus

Copy link
Copy Markdown
Contributor

Summary

  • place Messages API cache breakpoints on the final cacheable content block
  • remove ineffective top-level cache control while preserving its TTL
  • document that Vercel AI Gateway does not honor top-level cache control

Verification

  • Finished in 18ms on 2 files using 2 threads.
  • focused Jest attempted but blocked by unavailable PostgreSQL during global setup
  • web typecheck attempted but exceeded the 120-second environment limit

Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
@chrarnoldus chrarnoldus self-assigned this Jul 17, 2026
@kilo-code-bot

kilo-code-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

Reviewed the refactor moving Messages API cache breakpoints from the ineffective top-level cache_control onto the last cacheable content block, with logic and edge cases (thinking-only blocks, string content, preserved TTL) covered by matching test updates; no high-confidence bugs, security issues, or breaking changes found.

Files Reviewed (2 files)
  • apps/web/src/lib/ai-gateway/providers/openrouter/request-helpers.ts
  • apps/web/src/tests/openrouter-request-helpers.test.ts

Reviewed by claude-sonnet-5 · Input: 14 · Output: 4.9K · Cached: 258.8K

Review guidance: REVIEW.md from base branch main

@jeanduplessis
jeanduplessis merged commit 420262e into main Jul 17, 2026
15 checks passed
@jeanduplessis
jeanduplessis deleted the fix/messages-cache-breakpoint-placement branch July 17, 2026 08:31
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