Skip to content

Revert ChatGoogle cached_content forwarding - #4900

Merged
MagMueller merged 1 commit into
mainfrom
revert-google-cached-content
May 23, 2026
Merged

MagMueller merged 1 commit into
mainfrom
revert-google-cached-content

Conversation

@MagMueller

@MagMueller MagMueller commented May 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Why

Cloud explicit caching does not need the OSS convenience API: the gateway injects cached_content through a copied ChatGoogle.config dict on its request-local model. Keeping the public field/kwarg exposes a sharp edge because Gemini rejects cachedContent calls that also send live system_instruction, which normal ChatGoogle messages can still do.

Tests

  • uv run pytest tests/ci/models/test_llm_google.py -q
  • uv run pre-commit run --all-files

Summary by cubic

Reverts ChatGoogle cached_content forwarding to Gemini and removes the field and per-call passthrough. This avoids Gemini errors when cachedContent is sent with live system_instruction; the gateway still injects caching, so the obsolete unit test is removed.

Written for commit 22939a2. Summary will update on new commits. Review in cubic

@github-actions

Copy link
Copy Markdown

Agent Task Evaluation Results: 2/2 (100%)

View detailed results
Task Result Reason
browser_use_pip ✅ Pass Skipped - API key not available (fork PR or missing secret)
amazon_laptop ✅ Pass Skipped - API key not available (fork PR or missing secret)

Check the evaluate-tasks job for detailed task execution logs.

@MagMueller
MagMueller merged commit a402567 into main May 23, 2026
97 checks passed
@MagMueller
MagMueller deleted the revert-google-cached-content branch May 23, 2026 19:06
r266-tech pushed a commit to r266-tech/browser-use that referenced this pull request May 26, 2026
## Summary
- Revert browser-use#4889 (`ChatGoogle.cached_content` field and per-call
`cached_content` forwarding).
- Remove the now-unused cached-content unit test.

## Why
Cloud explicit caching does not need the OSS convenience API: the
gateway injects `cached_content` through a copied `ChatGoogle.config`
dict on its request-local model. Keeping the public field/kwarg exposes
a sharp edge because Gemini rejects cachedContent calls that also send
live `system_instruction`, which normal `ChatGoogle` messages can still
do.

## Tests
- `uv run pytest tests/ci/models/test_llm_google.py -q`
- `uv run pre-commit run --all-files`


<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Reverts `ChatGoogle` `cached_content` forwarding to Gemini and removes
the field and per-call passthrough. This avoids Gemini errors when
`cachedContent` is sent with live `system_instruction`; the gateway
still injects caching, so the obsolete unit test is removed.

<sup>Written for commit 22939a2.
Summary will update on new commits. <a
href="https://cubic.dev/pr/browser-use/browser-use/pull/4900?utm_source=github">Review
in cubic</a></sup>

<!-- End of auto-generated description by cubic. -->
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