Skip to content

core: session warming should target sessions currently open in the client #41003

Closed as not planned

Description

@Climberwy

Summary

V2 session warming currently appears to be globally enabled and based on a fixed time window. When warming is enabled, any session that receives a prompt is kept warm for approximately 30 minutes, even if it is no longer open or being viewed in the client.

This may cause unnecessary model requests and resource usage, especially when only a small number of sessions actually need to remain warm.

Environment

  • opencode version: opencode2 v0.0.0-next-16927
  • OS: Linux 6.6.87.2-microsoft-standard-WSL2 (WSL2, linux x64)
  • Terminal: TERM=xterm-256color; terminal program and color terminal are unavailable
  • Shell: /bin/bash
  • Install/channel: next
  • Active plugins: /home/wuyao/.config/opencode/plugins/slim-tools.ts

Reproduction

  1. Enable V2 session warming globally with "warming": true in the opencode configuration.
  2. Send a prompt in one or more sessions.
  3. Close or stop viewing one of those sessions while leaving the opencode client running.
  4. Wait during the configured warming duration, which defaults to approximately 30 minutes.
  5. Observe that the session continues to receive periodic keep-alive model requests.

Expected Behavior

Session warming should preferably target only sessions that are currently open in the client, since those are the sessions most likely to require preserved provider-side prompt caches or other short-lived session state.

It would also be useful to support per-session warming configuration or an explicit client-to-server list of sessions that should remain warm.

Actual Behavior

Session warming is configured globally and appears to identify sessions as warmable based on whether they recently received a prompt. The default duration is approximately 30 minutes, regardless of whether the session is still open in the client.

This definition of “recently active session” may be broader than necessary and can result in keep-alive requests for sessions that are no longer in use.

Additional Context

The current warming configuration exposes a global setting and a duration:

  • warming: globally enables or disables warming
  • warming.duration: time after the last active request to keep a session warm, defaulting to 30 minutes
  • warming.interval: interval between keep-alive requests, defaulting to 4 minutes

A possible improvement would be to use the client’s currently open session state as the primary warming criterion, while retaining an explicit configuration option for background or multi-client use cases.

No error or stack trace is available. The behavior is expected to be consistent whenever warming is enabled.

Activity

  1. github-actions commented on Oct 8, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions