Document createHttpOptions on the Kotlin context cache config - #2115
Merged
Conversation
ContextCacheConfig gained a fourth parameter, createHttpOptions, in adk-kotlin 0.7.0. It bounds the CachedContent.create() call specifically, and is fail-open: when the create exceeds the timeout it fails and the request proceeds uncached, so it is a latency guard rather than a correctness switch. The snippet says so, since that is the part the signature does not convey. No other language documents this. Python and Java have no equivalent parameter at all -- the Java record has exactly three components -- so this is Kotlin-first rather than a backfill. HttpOptions is ADK's own com.google.adk.kt.types.HttpOptions, deliberately not the backend SDK's, so the import matters: two other types share the name. Extracted, compiled and ran the snippet against the 0.7.0 pin: OK timeout=10s.
✅ Deploy Preview for adk-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
wikaaaaa
approved these changes
Aug 14, 2026
wikaaaaa
left a comment
Collaborator
There was a problem hiding this comment.
It is not a Kotlin-first feature, Python supported it before Kotlin did (https://github.com/google/adk-python/blob/main/src/google/adk/agents/context_cache_config.py#L84).
So maybe the ## Configuration settings prose should mention it as well? LGTM either way
Collaborator
Author
I added a sentence to address this. PTAL. |
wikaaaaa
approved these changes
Aug 17, 2026
joefernandez
approved these changes
Aug 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ContextCacheConfiggained a fourth parameter,createHttpOptions, inadk-kotlin 0.7.0. The Kotlin tab on
docs/context/caching.mddidn't show it.4 added lines: one argument, one comment, two imports.
What it does, and why the comment is there
It bounds the
CachedContent.create()call specifically — and it is fail-open.From the KDoc:
So it's a latency guard, not a correctness switch. That's the part the signature
doesn't convey, so it's the only thing the comment says.
Notes for reviewers
Java have no equivalent parameter at all (the Java record has exactly three
components). So there's no sibling tab to mirror.
HttpOptionsis ADK's own type,com.google.adk.kt.types.HttpOptions,deliberately not the backend SDK's, so that cache config stays independent of
any particular backend. Two other types share the name (Kotlin GenAI, Java
GenAI), which makes the import line worth a glance.
HttpOptions.ktdoes not exist at v0.6.0 — the classContextCacheConfigexisted, the parameter did not.## Configuration settingsprose list still documents onlythree options, under their Python names (
min_tokens,ttl_seconds,cache_intervals). Adding a fourth would mean a Kotlin-only bullet in aPython-named list, so I left it. Happy to add it if you'd rather the list were
complete.
Verification
Extracted the snippet, compiled and ran it against the 0.7.0 pin:
verify_snippets.pypasses all six levels.Staged