Skip to content

(Closed MR) - #5944

Closed
a2105z wants to merge 2 commits into
genkit-ai:mainfrom
a2105z:feat/go-anthropic-prompt-caching
Closed

a2105z wants to merge 2 commits into
genkit-ai:mainfrom
a2105z:feat/go-anthropic-prompt-caching

Conversation

@a2105z

@a2105z a2105z commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

(Closed MR)

a2105z added 2 commits August 3, 2026 03:24
Attach JS-parity cache_control metadata to content and system text
blocks, and surface cache creation/read token usage in Custom.
Skip nil content parts and guard applyCacheControl against a nil block.

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

Copy link
Copy Markdown
Contributor

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 adds ephemeral prompt caching support for the Anthropic Go plugin, mirroring the JS SDK behavior. It introduces cache control helpers, preserves cache metadata on system prompts and user content blocks, and exposes cache usage statistics in the response. The review feedback points out several critical issues regarding potential nil pointer dereferences and map assignment panics in both the production code and tests, which should be addressed to ensure stability.

Comment thread go/plugins/internal/anthropic/anthropic.go
Comment thread go/plugins/internal/anthropic/anthropic.go
Comment thread go/plugins/internal/anthropic/cache.go
Comment thread go/plugins/internal/anthropic/cache_test.go
@a2105z a2105z closed this Aug 4, 2026
@a2105z
a2105z deleted the feat/go-anthropic-prompt-caching branch August 4, 2026 22:28
@a2105z a2105z changed the title feat(go/plugins/anthropic): support prompt caching via cache_control (Closed MR) Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant