Skip to content

[FEATURE]: Ability to set "warming" settings on a per model and per agent basis #53457

Closed

Description

@kwinz

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

What is missing, problem descripton

Currently in opencode v2.0.21 there is no way to set a warming setting on a per model basis. Different models have wildly differnt cache TTLs and cached input costs.

This is problematic when mixing different models for the main agent and subagents in one project.

E.g. the default cache TTL for Model A is 5min, while cached reads only cost 5%
and default cache TTL for Model B is 30min, while cached reads cost 10%

Only a global, or project level:

  "warming": {
    "interval": "4 minutes",
    "duration": "1 hour"
  }

is optimal for Model A for up to 80min, but overly aggressive and wasteful for Model B.

Suggestion

Support ( per model and/or per provider ) and per agent overrides for warming.

{
  "$schema": "https://opencode.ai/config.json",

  "warming": {
    // Default for sessions that don't match an override
    "enabled": false,

    "models": {
      "anthropic/claude-opus-5-5": {
        "enabled": true,
        "interval": "4 minutes",
        "duration": "1 hour"
      },

      "openai/gpt-6.1": {
        "enabled": true,
        "interval": "25 minutes",
        "duration": "1 hour"
      }
    },

   "providers": {
      "openai": {
        "enabled": true,
        "interval": "25 minutes",
        "duration": "1 hour"
      }
    },

    "agents": {
      "review": false,
      "audit": {
        "enabled": true,
        "interval": "4 minutes",
        "duration": "2 hours"
      }
    }
  }
}

Precedence would be
agent > model > provider > global

Related: #41003, #43628

Activity

  1. github-actions commented on Oct 6, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    • #51109: Proposes configurable prompt-cache TTL per agent and provider/model, overlapping with the requested model- and agent-specific cache behavior.
    • #41003: Discusses session warming configuration, including per-session warming options.
  2. kwinz commented on Oct 6, 2026

    @kwinz
    Author

    #51109 is related but not the same, since it concerns the cache TTL setting for the few model providers that support setting one. This feature request in contrast is about opencode2's native warming feature.

    #41003 was already identified as related in the above feature request. It is about session warming should target sessions currently open in the client, but also explicitly mentions V2 warming is globally configured today and indicates that this feature request would be an improvement.

  3. rekram1-node commented on Oct 9, 2026

    @rekram1-node
    Collaborator

    yes 100% will support this, maybe not this exact shape but the idea of the feature would be supported per model/provider... idk about per agent tho, maybe via plugin but feels weird cramming everything into a config file

  4. bhagirathsinh-vaghela commented on Oct 11, 2026

    @bhagirathsinh-vaghela

    On defaults: a ping is a cache read of the whole context and a cold resume is one cache write of it, so warming pays off for only about (write price − read price) ÷ read price pings, whatever the context size. With Anthropic's 5-minute write at 1.25x, that's about 11 pings at a 0.1x read, 24 at 0.05x and 49 at 0.025x, i.e. roughly 56 minutes, 2 hours and 4 hours at one ping every 5 minutes. So a per-model duration could default to that break-even instead of a fixed hour. I wrote this up for my fork's keep-warm here, and this table has each provider's read price and lifetime.

  5. opencodejr commented on Oct 27, 2026

    @opencodejr
    Contributor

    Thanks for the detailed request, @kwinz! To restate it: you'd like warming settings (enabled, interval, duration) to be overridable per agent, per model and per provider, with precedence agent > model > provider > global. That way models with different cache TTLs and cached-read prices can each get a suitable keep-alive schedule.

    Right now warming is a single global or project-level setting, applied the same way to every top-level session. Subagent sessions (child sessions) aren't kept warm at all right now, which affects your main-agent/subagent setup.

    Maintainers will consider this. Related issues:

  6. rekram1-node commented on Nov 1, 2026

    @rekram1-node
    Collaborator

    You can configure it per model/provider in next release, for now leaving off the agent configs, a little more awkward there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions