/compact doesn't utilize prompt caching #7411

Open
opened 2026-02-16 18:07:05 -05:00 by yindo · 1 comment
Owner

Originally created by @zaidka on GitHub (Jan 24, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

When calling /compact, it seems like prompt caching isn't being used. Regular messages in the same session do get cache hits, so the caching setup is working - it just doesn't seem to apply to /compact.

Plugins

None

OpenCode version

1.1.34

Steps to reproduce

  1. Connect OpenCode to a model served by llama.cpp. May or may not be reproducible with other providers.
  2. Have a back and forth conversation and confirm prompt caching is being used either by looking at the server logs, or judging by time to first token.
  3. Run /compact command and observe prompt caching not get used.

Screenshot and/or share link

No response

Operating System

Fedora 43

Terminal

ptyxis

Originally created by @zaidka on GitHub (Jan 24, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description When calling /compact, it seems like prompt caching isn't being used. Regular messages in the same session do get cache hits, so the caching setup is working - it just doesn't seem to apply to /compact. ### Plugins None ### OpenCode version 1.1.34 ### Steps to reproduce 1. Connect OpenCode to a model served by llama.cpp. May or may not be reproducible with other providers. 2. Have a back and forth conversation and confirm prompt caching is being used either by looking at the server logs, or judging by time to first token. 3. Run /compact command and observe prompt caching not get used. ### Screenshot and/or share link _No response_ ### Operating System Fedora 43 ### Terminal ptyxis
yindo added the bug label 2026-02-16 18:07:05 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 24, 2026):

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

  • #5416: [FEATURE]: Anthropic (and others) caching improvement - discusses caching optimization for Anthropic models
  • #6068: [BUG]: Auto compaction not triggering reliably with Anthropic models - related to compaction not working correctly with certain models
  • #8394: [BUG] Compactation Fails Agent forgets everything - compaction-related failures that might affect caching behavior

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 24, 2026): This issue might be a duplicate of existing issues. Please check: - #5416: [FEATURE]: Anthropic (and others) caching improvement - discusses caching optimization for Anthropic models - #6068: [BUG]: Auto compaction not triggering reliably with Anthropic models - related to compaction not working correctly with certain models - #8394: [BUG] Compactation Fails Agent forgets everything - compaction-related failures that might affect caching behavior Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7411