Skip to content

fix(ai): cache OpenRouter tool results - #6941

Merged
badlogic merged 1 commit into
earendil-works:mainfrom
mteam88:fix/openrouter-tool-result-cache-breakpoint
Jul 22, 2026
Merged

fix(ai): cache OpenRouter tool results#6941
badlogic merged 1 commit into
earendil-works:mainfrom
mteam88:fix/openrouter-tool-result-cache-breakpoint

Conversation

@mteam88

@mteam88 mteam88 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • allow Anthropic-style cache markers on trailing OpenAI tool messages
  • advance the cached conversation prefix across tool-only turns
  • add regression coverage for moving the marker from the earlier user message to the tool result

Related to #6940.

Testing

  • npm run check
  • HOME="$(mktemp -d)" ./test.sh

@badlogic badlogic added the inprogress Issue is being worked on label Jul 22, 2026
@badlogic

Copy link
Copy Markdown
Collaborator

Reviewed. This is safe to merge: OpenRouter accepts cache_control on text blocks in tool messages, and the native Anthropic path already applies the equivalent marker to tool_result blocks. The regression coverage is sufficient. I’m handling the stale docs and ~anthropic/*-latest generator metadata separately.

This comment is AI-generated by /wr

@badlogic
badlogic merged commit bc41f61 into earendil-works:main Jul 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

inprogress Issue is being worked on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants