Skip to content

Kimi K3 prompt caching on OpenCode Zen stops after sending an image #41093

Closed

Description

@irth

Description

When using Kimi K3 on OpenCode 1.18.15 via OpenCode Zen prompt caching stops working when an image is first read, leading to huge cost / limit usage as the entire session gets cache misses on each subsequent prompt.

The same scenario doesn't happen when using Kimi K2.7 Code.

Attached are the two sessions + the image used for testing. The same thing happened orignaly when the model looked at Figma remote MCP screenshots, so its probably not tied to the image.

data from the opencode zen "usage" tab (cache reads from the popover after pressing the button)

Kimi K3

Date Model Displayed input total Input Cache read Output Cost
Aug 7, 5:13 PM kimi-k3 10204 10204 0 968 $0.0451
Aug 7, 5:12 PM kimi-k3 9742 9742 0 431 $0.0357
Aug 7, 5:12 PM kimi-k3 9385 557 8828 327 $0.0092
Aug 7, 5:11 PM kimi-k3 8829 165 8664 85 $0.0044
Aug 7, 5:11 PM kimi-k3 8665 140 8525 50 $0.0037
Aug 7, 5:11 PM kimi-k3 8526 270 8256 107 $0.0049
Aug 7, 5:10 PM kimi-k3 8257 97 8160 242 $0.0064
Aug 7, 5:09 PM kimi-k3 8161 77 8084 71 $0.0037
Aug 7, 5:09 PM kimi-k3 8085 8085 0 42 $0.0249
Aug 7, 5:09 PM gpt-5.4-nano 540 540 0 8 $0.0001

Kimi K2.7 Code

Date Model Displayed input total Input Cache read Output Cost
Aug 7, 5:28 PM kimi-k2.7-code 8486 190 8296 57 $0.0020
Aug 7, 5:28 PM kimi-k2.7-code 8298 186 8112 174 $0.0024
Aug 7, 5:28 PM kimi-k2.7-code 8114 521 7593 169 $0.0026
Aug 7, 5:28 PM kimi-k2.7-code 7594 58 7536 72 $0.0018
Aug 7, 5:27 PM kimi-k2.7-code 7537 40 7497 45 $0.0016
Aug 7, 5:27 PM kimi-k2.7-code 7498 7390 108 29 $0.0072
Aug 7, 5:27 PM gpt-5.4-nano 533 533 0 8 $0.0001

attachments

pearto.jpeg
kimik27.json
kimik3.json

Plugins

custom plugin which simply reads events and passes them to a server, basically "read only", + Ryan Vogel's Hark integration. I think 5.6 Luna was able to reproduce the same behaviour on a pure instance, but I didnt save the session

OpenCode version

1.18.15

Steps to reproduce

  1. Send enough text to get a cache write (system prompt makes this happen anyway)
  2. Send some more text - notice the previous turn gets read from cache
  3. Ask the model to look at an image
  4. Send another text prompt
  5. Notice 0 cache hits after the image has been introduced into the context

Screenshot and/or share link

Kimi K2.7 Code session (correct behavior): https://opncd.ai/share/suF32Wiv
Kimi K3 session (incorrect behavior): https://opncd.ai/share/GLk5qptt

Operating System

macOS 26.5.2

Terminal

iTerm2

Activity

  1. irth commented on Aug 7, 2026

    @irth
    Author

    fwiw - I managed to reproduce this on OpenCode 2 thru Zen, but not thru the Moonshot API provider

    I registered for Moonshot's API and set up OC 1.18.5 with the key, did the same experiment - cache read continued to grow after the image instead of dropping to 0.

    So this probably is a Zen specific issue.

    I am using Zen Black, not Go.

  2. irth commented on Aug 9, 2026

    @irth
    Author
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