GeezerVison is showing github.com — feat(core): time session warming from the model's cache TTL by rekram1-node · Pull Request #60969 · anomalyco/opencode
Conversation
rekram1-node
commented
Oct 31, 2026
•
edited by opencodejr
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Problem
Warming pings every model on the same fixed interval (4 minutes by default), whatever its prompt cache lifetime. That's too often for long caches and wasted on models that don't cache at all.
Change
warming.interval accepts "auto": ping at 90% of the model's cache.ttl, and skip models without one.
"warming": { "interval": "auto", "duration": "2 hours" },
"providers": { "anthropic": { "settings": { "cache": { "ttl": "1h" } } } }
interval "auto" + cache.ttl "5m" → ping every 4.5 minutes
interval "auto" + no cache.ttl → not warmed
interval unset / a duration → unchanged
Additive: existing configs behave the same. Only cache.ttl you set yourself counts for now; per-model defaults can come from models.dev later. The warming docs explain "auto" and that duration must exceed the interval for long TTLs.
Added by the opencode bot (AI-generated).
Related: #53457, #43628
Public API: warming.interval accepts "auto" in addition to a duration string (backwards compatible)
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recommend approving: "auto" works as described and existing configs behave the same.
I ran the warming plugin with a stub plugin context and a simulated clock. With a "5m" cache TTL it pings every 4.5 minutes, models without a cache.ttl are never scheduled, and a fixed interval behaves as before. On the base, "auto" fails config decoding. Config tests and the packages/core type check pass.
Public API: the warming.interval config key now accepts "auto" as well as a duration string. That change also shows up in the OpenAPI spec (anyOf the "auto" enum or a string) and in the generated client type ("auto" | (string & {})). It is backwards compatible: existing configs and callers are unaffected.
Concerns (non-blocking):
- A long cache lifetime under the default
duration silently never warms (see the inline comment).
- The new
"auto" path has no test. A small plugin test covering "TTL present" and "no TTL" with a simulated clock would cover the new behaviour.
Related: #53457, #43628
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new commit addresses the earlier point: when the computed (or configured) interval isn't shorter than duration, warming is now skipped with a warning instead of failing silently. I reran the plugin with a simulated clock: "auto" behaves as before (4.5-minute pings for "5m", none without a TTL), and "1h" with the default duration now logs the warning. The same check covers fixed intervals, which never pinged before in that case either, so the warning is the only change. Config tests and the packages/core type check pass. Public API is unchanged since the last review (warming.interval accepts "auto", backwards compatible). Nothing new to flag.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 4, 2026
This was referenced Nov 7, 2026
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|