Skip to content

Conversation

@lupuletic
Copy link
Contributor

@lupuletic lupuletic commented Jun 12, 2025

  • Update model ID check from 'anthropic/claude-3' to 'anthropic/claude-' to include both Claude 3 and Claude 4 models
  • Add comprehensive test coverage for Claude 4 models (sonnet-4, opus-4)
  • Ensure cache breakpoints are properly applied for performance optimization
  • Verify non-Claude models continue to work without caching

Fixes caching support for claude-sonnet-4-20250514 and claude-opus-4-20250514 models, enabling cost savings and improved response times.

Related GitHub Issue

Closes: #

Description

Test Procedure

Type of Change

  • 🐛 Bug Fix: Non-breaking change that fixes an issue.
  • New Feature: Non-breaking change that adds functionality.
  • 💥 Breaking Change: Fix or feature that would cause existing functionality to not work as expected.
  • ♻️ Refactor: Code change that neither fixes a bug nor adds a feature.
  • 💅 Style: Changes that do not affect the meaning of the code (white-space, formatting, etc.).
  • 📚 Documentation: Updates to documentation files.
  • ⚙️ Build/CI: Changes to the build process or CI configuration.
  • 🧹 Chore: Other changes that don't modify src or test files.

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Code Quality:
    • My code adheres to the project's style guidelines.
    • There are no new linting errors or warnings (npm run lint).
    • All debug code (e.g., console.log) has been removed.
  • Testing:
    • New and/or updated tests have been added to cover my changes.
    • All tests pass locally (npm test).
    • The application builds successfully with my changes.
  • Branch Hygiene: My branch is up-to-date (rebased) with the main branch.
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Changeset: A changeset has been created using npm run changeset if this PR includes user-facing changes or dependency updates.
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Screenshots / Videos

Documentation Updates

Additional Notes

Get in Touch


Important

Enable prompt caching for Claude 4 models and add tests for cache breakpoints in unbound.ts.

  • Behavior:
    • Update model ID check in unbound.ts from 'anthropic/claude-3' to 'anthropic/claude-' to include Claude 4 models.
    • Ensure cache breakpoints are applied for Claude 3 and 4 models in unbound.ts.
    • Verify non-Claude models continue to function without caching in unbound.ts.
  • Tests:
    • Add test coverage for Claude 4 models (claude-sonnet-4-20250514, claude-opus-4-20250514) in unbound.test.ts.
    • Test cache breakpoints for Claude 3, Claude 4, and non-Claude models in unbound.test.ts.

This description was created by Ellipsis for d37e86f. You can customize this summary. It will automatically update as commits are pushed.

- Update model ID check from 'anthropic/claude-3' to 'anthropic/claude-'
  to include both Claude 3 and Claude 4 models
- Add comprehensive test coverage for Claude 4 models (sonnet-4, opus-4)
- Ensure cache breakpoints are properly applied for performance optimization
- Verify non-Claude models continue to work without caching

Fixes caching support for claude-sonnet-4-20250514 and claude-opus-4-20250514
models, enabling cost savings and improved response times.
@lupuletic lupuletic requested review from cte, jr and mrubens as code owners June 12, 2025 09:19
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jun 12, 2025
...convertToOpenAiMessages(messages),
]

if (modelId.startsWith("anthropic/claude-3")) {
Copy link
Contributor Author

@lupuletic lupuletic Jun 12, 2025

Choose a reason for hiding this comment

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

this will cause issues for haiku -- should be limited to models that support caching

})
})

describe("cache breakpoints", () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider parameterizing the cache breakpoint tests for Claude 3, Claude Sonnet 4, and Claude Opus 4 models to reduce duplication and improve maintainability.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jun 12, 2025
Add support for Claude 3 and 3.5 Haiku models in caching logic
based on Unbound API indicating `supportsPromptCaching: true`.

Updates pattern matching to include:
- anthropic/claude-3-haiku-*
- anthropic/claude-3-5-haiku-*
@lupuletic lupuletic closed this Jun 12, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Jun 12, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jun 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants