You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: add create_http_options to ContextCacheConfig for cache creation timeout control #4703
needs review[Status] The PR/issue is awaiting review from the maintainerservices[Component] This issue is related to runtime services, e.g. sessions, memory, artifacts, etc
CachedContent.create() calls to Vertex AI can take 30-40 seconds, blocking the user's request for the entire duration. There is currently no way to set a timeout or other HTTP options on the cache creation call — ADK constructs the CreateCachedContentConfig internally without exposing the http_options field.
Proposed Solution
Add a create_http_options: Optional[types.HttpOptions] field to ContextCacheConfig that gets passed through to the CreateCachedContentConfig when creating a cache. This allows users to control timeout and other HTTP settings on cache creation calls.
When the cache creation call exceeds the configured timeout, it fails gracefully and the request proceeds without caching — the same behavior as if caching were disabled for that turn.
The genai.Client accepts http_options at construction time (and ADK 1.26 supports bring-your-own-client), but a client-level timeout applies to all API calls — generate_content, caches.create, caches.delete, etc. Cache creation is uniquely slow (~38s) while other calls are fast, so a per-operation timeout is needed.
Design
Zero behavior change when unset: create_http_options=None (default) preserves existing behavior exactly
@abhinavmaddineni Thank you for submitting this feature request. It’s currently under review by our team, and I’ll keep you posted on any updates. We appreciate your input!
needs review[Status] The PR/issue is awaiting review from the maintainerservices[Component] This issue is related to runtime services, e.g. sessions, memory, artifacts, etc
Activity
feat: add create_http_options to ContextCacheConfig for cache creatio…
klateefa commentedon Mar 5, 2026
@abhinavmaddineni Thank you for submitting this feature request. It’s currently under review by our team, and I’ll keep you posted on any updates. We appreciate your input!
DeanChensj commentedon Mar 5, 2026
Hi @xuanyang15 , can you take a look?
feat: add create_http_options to ContextCacheConfig for cache creatio…
feat: add create_http_options to ContextCacheConfig for cache creatio…