Skip to content

Conversation

@ibetitsmike
Copy link
Contributor

@ibetitsmike ibetitsmike commented Nov 28, 2025

SDK's providerOptions.anthropic.cacheControl isn't translated to raw cache_control for tools/content parts. Fixed via HTTP-level fetch wrapper injecting cache_control on last tool and second-to-last message.

Also: extended cache detection to gateway providers (mux-gateway:anthropic/...), fixed array content handling, tools now recreated via createTool() (SDK requires providerOptions at creation).

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

- Use getProviderFetch() instead of defaultFetchWithUnlimitedTimeout when
  wrapping Anthropic fetch to preserve user-configured custom fetch (proxies, etc.)
- Handle provider-defined tools (like Anthropic's webSearch) by spreading
  providerOptions directly instead of recreating with createTool()
  (provider-defined tools have type: 'provider-defined' and cannot be recreated)
- Add test for provider-defined tool handling
@ibetitsmike ibetitsmike merged commit 15d1de9 into main Nov 28, 2025
18 of 19 checks passed
@ibetitsmike ibetitsmike deleted the mike/anthropic-cache-improvements branch November 28, 2025 13:22
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