Skip to content

test: add regression test for issue #196 (Anthropic 1-hour cache TTL)#378

Merged
robert-j-y merged 4 commits intomainfrom
devin/1769563457-issue-196-cache-ttl-test
Jan 28, 2026
Merged

test: add regression test for issue #196 (Anthropic 1-hour cache TTL)#378
robert-j-y merged 4 commits intomainfrom
devin/1769563457-issue-196-cache-ttl-test

Conversation

@robert-j-y
Copy link
Contributor

@robert-j-y robert-j-y commented Jan 28, 2026

Description

Adds a regression test for issue #196 following the pattern established in PR #369.

The test uses the exact code structure from the issue report:

  • System message + user message with 3 text parts
  • Uses cacheControl (camelCase) exactly as the user reported
  • Includes ttl: '1h' parameter for 1-hour caching

The test verifies:

  • The TTL parameter is accepted by the OpenRouter API without errors
  • Cache is populated on first call and hit on subsequent calls (cachedTokens > 0)

Updates since last revision

  • Removed root cause analysis from header comment (keeping only known facts per reviewer feedback)
  • Removed redundant inline comments throughout the test file

Human Review Checklist

  • Test structure matches the exact code pattern from issue 1 hour prompt caching problem #196 (system message + 3 text parts with cacheControl camelCase)
  • Cache hit verification (cachedTokens > 0) is appropriate and not flaky
  • Header comment describes only known facts (no speculative root cause analysis)

Checklist

  • I have run pnpm stylecheck and pnpm typecheck
  • I have run pnpm test and all tests pass
  • I have added tests for my changes (if applicable)
  • I have updated documentation (if applicable) - N/A

Changeset

  • I have run pnpm changeset to create a changeset file (empty changeset for test-only change)

Requested by: Robert Yeakel (@robert-j-y)
Link to Devin run: https://app.devin.ai/sessions/2d9573034b76446baf55558962afa10f

devin-ai-integration bot and others added 4 commits January 28, 2026 01:24
Co-Authored-By: Robert Yeakel <robert.yeakel@openrouter.ai>
…trol camelCase)

Co-Authored-By: Robert Yeakel <robert.yeakel@openrouter.ai>
… facts)

Co-Authored-By: Robert Yeakel <robert.yeakel@openrouter.ai>
Co-Authored-By: Robert Yeakel <robert.yeakel@openrouter.ai>
@robert-j-y robert-j-y merged commit ff33984 into main Jan 28, 2026
2 checks passed
@robert-j-y robert-j-y deleted the devin/1769563457-issue-196-cache-ttl-test branch January 28, 2026 02:23
kesavan-byte pushed a commit to osm-API/ai-sdk-provider that referenced this pull request Feb 13, 2026
…our cache TTL) (OpenRouterTeam#378)

* test: add regression test for issue OpenRouterTeam#196 (Anthropic 1-hour cache TTL)

Co-Authored-By: Robert Yeakel <robert.yeakel@openrouter.ai>

* test: update issue OpenRouterTeam#196 test to match exact issue structure (cacheControl camelCase)

Co-Authored-By: Robert Yeakel <robert.yeakel@openrouter.ai>

* test: remove root cause analysis from header comment (keep only known facts)

Co-Authored-By: Robert Yeakel <robert.yeakel@openrouter.ai>

* test: remove redundant comments from issue OpenRouterTeam#196 test

Co-Authored-By: Robert Yeakel <robert.yeakel@openrouter.ai>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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.

1 participant

Comments