GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(core): configure session warming per provider and model by rekram1-node · Pull Request #60025 · anomalyco/opencode

Conversation

@rekram1-node

@rekram1-node rekram1-node commented Oct 28, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Refs #53457

Problem

Session warming has one global setting, so every model gets the same keep-alive interval and on/off choice, even though providers have very different cache lifetimes, and local models should usually never be warmed.

Change

cache.warming in provider and model settings overrides the top-level warming. It takes the same values: true, false or { interval, duration }. The keep-alive prompt stays a top-level setting.

"warming": true,
"providers": {
  "anthropic": {
    "settings": { "cache": { "warming": { "duration": "1 hour" } } },
    "models": { "claude-haiku-5-5": { "settings": { "cache": { "warming": false } } } }
  },
  "ollama": { "settings": { "cache": { "warming": false } } }
}
model cache.warming → provider cache.warming → top-level warming
  • Provider and model settings already merge, so the warming plugin reads cache.warming from the session's catalog model.
  • Variants can't set it: variant settings exclude cache.
  • Settings hold JSON, so interval and duration are strings here. The plugin parses them, and an invalid value logs a warning and falls back to the top-level setting.
  • Subagent sessions are still never warmed.

Added by the opencode bot (AI-generated).

Related: #53457

Public API: adds cache.warming to provider/model settings and the Provider.CacheWarming schema (backwards compatible)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@github-actions github-actions Bot added the contributor label Oct 28, 2026
opencodejr[bot]
opencodejr Bot reviewed Oct 28, 2026
View reviewed changes

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

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 approach looks sound: settings already merge provider → model, so reading cache.warming from the catalog model gives the layering described, and only cache.ttl is forwarded to providers, so the new key doesn't leak into requests. I didn't run warming end to end. A scratch test confirmed the merged settings decode as expected (provider and model objects merge, a model false wins, an invalid duration falls back), and packages/core type-checks with tsc -b.

Public API: adds cache.warming (boolean | { prompt?, interval?, duration? }, durations as strings) to provider and model settings, both in config and in the Model.Info.settings the API returns. Also adds the Provider.CacheWarming OpenAPI component and its generated client type. Backwards compatible: purely additive, and existing top-level warming configs behave as before.

Concerns:

  • A partial override doesn't inherit from the top-level object (see the inline comment).
  • The plugin has no tests for this. A small one covering how a model false overrides the provider and top-level settings, and the fallback for an invalid value, would guard the new precedence.

Related: #53457

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/core/src/plugin/warming.ts Outdated
const decoded = configured === undefined ? undefined : Option.getOrUndefined(decodeWarming(configured))
if (configured !== undefined && decoded === undefined)
yield* Effect.logWarning("invalid cache.warming setting; using the top-level warming setting", { model: ref })
const warming = decoded ?? Config.latest(yield* config.entries(), "warming")

@opencodejr opencodejr Bot Oct 28, 2026

Copy link
Copy Markdown
Contributor

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.

When a provider or model sets an object, it replaces the top-level warming completely and the missing fields come from the built-in defaults, not from the top-level object. For example, top-level { prompt: "…", interval: "2 minutes" } plus provider { duration: "1 hour" } gives the default prompt and a 4-minute interval for that provider. If you mean the override to work field by field, merge the decoded value over the top-level object when both are objects. Otherwise it may be worth stating in the schema description that an object replaces the top-level setting.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
opencodejr[bot]
opencodejr Bot reviewed Oct 28, 2026
View reviewed changes

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

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 reuses the per-event resolveModel lookup that the prompt plugins already use, so the warming and prompt plugins share one catalog lookup per request. Failures and models missing from the catalog still fall back to the top-level warming. packages/core type-checks with tsc -b, and the warming config and optimize plugin tests pass (14 tests). I still haven't run warming end to end.

The public API is unchanged since my last review: this commit adds nothing beyond cache.warming and Provider.CacheWarming, which are backwards compatible.

The earlier point about partial overrides falling back to the built-in defaults instead of the top-level object isn't addressed by this commit. Nothing new to raise.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
opencodejr[bot]
opencodejr Bot reviewed Oct 28, 2026
View reviewed changes

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

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 partial-override point: a provider or model cache.warming object now layers over the top-level warming object, not straight over the built-in defaults. A quick check of the merge (top-level { prompt, interval: "2 minutes" } plus provider { duration: "1 hour" }) kept the custom prompt and the 2-minute interval and applied the 1-hour duration. packages/core type-checks with tsc -b, and the warming config tests pass. I haven't run warming end to end.

Public API compared with dev: adds cache.warming (boolean | { interval?, duration? }) to provider and model settings (config and Model.Info.settings), plus the Provider.CacheWarming OpenAPI component and its generated client type. Backwards compatible. Since my last review, prompt was dropped from that new type before release, so it breaks nothing.

Nothing new to raise.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@rekram1-node
feat(core): configure session warming per provider and model
39c00f9
@rekram1-node
rekram1-node force-pushed the model-warming branch from c6e234e to 39c00f9 Compare October 31, 2026 22:28
opencodejr[bot]
opencodejr Bot reviewed Oct 31, 2026
View reviewed changes

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

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 rebase onto dev fits cleanly with the new "auto" interval from #60969. cache.warming is decoded with the same ConfigWarming.Warming schema as the top-level setting, so a provider or model can set interval: "auto" and it resolves from that model's cache.ttl. The partial-override merge from the previous round is still in place. packages/core type-checks with tsc -b, and the warming and normalization config tests pass. I haven't run warming end to end.

Public API compared with dev: adds cache.warming (boolean | { interval?, duration? }) to provider and model settings, plus the Provider.CacheWarming OpenAPI component and its generated client type. Backwards compatible.

One small gap worth closing: the Provider.CacheWarming interval description only mentions durations, though "auto" is accepted, and services/www/src/docs/content/warming.mdx doesn't cover per-provider or per-model cache.warming yet.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@github-actions github-actions Bot mentioned this pull request Oct 31, 2026
📊 AI CLI 工具社区动态日报 2026-11-01 litang9/big_model_radar#635
Open
rekram1-node added 2 commits October 31, 2026 20:50
@rekram1-node
feat(schema): show "auto" in per-model warming interval
b3eb8a8
@rekram1-node
refactor(core): tidy per-model warming lookup
efcbe2e
opencodejr[bot]
opencodejr Bot reviewed Nov 1, 2026
View reviewed changes

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

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 Provider.CacheWarming interval description now says that "auto" is accepted, which addresses that part of my last note. The lookup refactor doesn't change behaviour. packages/core type-checks with tsc -b, and the warming and normalization config tests pass. I haven't run warming end to end.

Public API compared with dev: adds cache.warming (boolean | { interval?: "auto" | string, duration?: string }) to provider and model settings, plus the Provider.CacheWarming OpenAPI component and its generated client type. Backwards compatible.

Nothing new to raise.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@rekram1-node
rekram1-node merged commit 296074a into dev Nov 1, 2026
20 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@rekram1-node
rekram1-node deleted the model-warming branch November 1, 2026 02:05
@kelos-bot kelos-bot Bot mentioned this pull request Nov 1, 2026
[kanon-fake-strategist] Render hooks per agent capability and add OpenCode hook support kelos-dev/kanon#100
Open
@rekram1-node rekram1-node mentioned this pull request Nov 4, 2026
fix(core): keep one warming loop per session and ignore compaction #61724
Open
@amrkmn amrkmn mentioned this pull request Nov 7, 2026
opencode 2.2.6 amrkmn/homebrew-tap#1217
Closed
1 task
This was referenced Nov 7, 2026
feat: opencode release v2.2.6 sprisa/opencode-server#84
Merged
Tool release: OpenCode 2 v2.2.6 (was v2.2.5) agent-sh/agnix#1808
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@opencodejr opencodejr[bot] opencodejr[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

contributor

Projects

None yet

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.

1 participant

@rekram1-node
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.