anomalyco / anomalyco/opencode
core: session warming should target sessions currently open in the client
@nexxeln is already working on this.
Since Aug 7, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
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
- Enable V2 session warming globally with
"warming": truein the opencode configuration. - Send a prompt in one or more sessions.
- Close or stop viewing one of those sessions while leaving the opencode client running.
- Wait during the configured warming duration, which defaults to approximately 30 minutes.
- 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 warmingwarming.duration: time after the last active request to keep a session warm, defaulting to 30 minuteswarming.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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.