Skip to content

Document createHttpOptions on the Kotlin context cache config - #2115

Merged
happyhuman merged 4 commits into
mainfrom
docs-kotlin-cache-http-options
Aug 17, 2026
Merged

Document createHttpOptions on the Kotlin context cache config#2115
happyhuman merged 4 commits into
mainfrom
docs-kotlin-cache-http-options

Conversation

@happyhuman

@happyhuman happyhuman commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

ContextCacheConfig gained a fourth parameter, createHttpOptions, in
adk-kotlin 0.7.0. The Kotlin tab on docs/context/caching.md didn'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:

When the cache creation call exceeds the timeout, it fails and the request
proceeds without caching.

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

  • Kotlin-first, not a backfill. No other language documents this — Python and
    Java have no equivalent parameter at all (the Java record has exactly three
    components). So there's no sibling tab to mirror.
  • HttpOptions is 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.
  • Genuinely 0.7.0. HttpOptions.kt does not exist at v0.6.0 — the class
    ContextCacheConfig existed, the parameter did not.
  • Not changed: the ## Configuration settings prose list still documents only
    three options, under their Python names (min_tokens, ttl_seconds,
    cache_intervals). Adding a fourth would mean a Kotlin-only bullet in a
    Python-named list, so I left it. Happy to add it if you'd rather the list were
    complete.
  • Inline, matching the page's Python and Java tabs, so CI won't compile it.

Verification

Extracted the snippet, compiled and ran it against the 0.7.0 pin:

OK timeout=10s

verify_snippets.py passes all six levels.

Staged

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.
@netlify

netlify Bot commented Aug 11, 2026

Copy link
Copy Markdown

Deploy Preview for adk-docs-preview ready!

Name Link
🔨 Latest commit 9cd95da
🔍 Latest deploy log https://app.netlify.com/projects/adk-docs-preview/deploys/6a838a0da30bad0008540d0f
😎 Deploy Preview https://deploy-preview-2115--adk-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@wikaaaaa wikaaaaa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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

@happyhuman

Copy link
Copy Markdown
Collaborator Author

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

I added a sentence to address this. PTAL.

@happyhuman
happyhuman requested a review from wikaaaaa August 14, 2026 19:18
@happyhuman
happyhuman merged commit 5607a3c into main Aug 17, 2026
7 of 8 checks passed
@happyhuman
happyhuman deleted the docs-kotlin-cache-http-options branch August 17, 2026 22:24
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.

3 participants