The problem
Copilot CLI never caches anything when talking to Claude models through ucode. Every request pays full price, even though the same big system/tool prompt repeats on every turn.
Why
ucode always tells Copilot to use its openai connection mode for every model, including Claude. That mode has no way to mark "cache this part" — Anthropic's caching only works over Anthropic's own API format, which Copilot also supports (anthropic mode), but ucode never uses it for Copilot.
Complication
Copilot's anthropic mode only works right on newer versions. On anything below Copilot 1.0.81-6, Copilot sends a request parameter that current Claude models (Sonnet 5, Opus 5) reject outright — every request would just fail. So the fix has to check the installed Copilot version and only switch modes when it's new enough; older Copilot stays on the old (working, uncached) path.
Fix
PR #495. Verified against a real workspace: caching now shows up in Databricks' own usage table for Copilot + Claude, on Copilot 1.0.81-6 and newer.
The problem
Copilot CLI never caches anything when talking to Claude models through ucode. Every request pays full price, even though the same big system/tool prompt repeats on every turn.
Why
ucode always tells Copilot to use its
openaiconnection mode for every model, including Claude. That mode has no way to mark "cache this part" — Anthropic's caching only works over Anthropic's own API format, which Copilot also supports (anthropicmode), but ucode never uses it for Copilot.Complication
Copilot's
anthropicmode only works right on newer versions. On anything below Copilot 1.0.81-6, Copilot sends a request parameter that current Claude models (Sonnet 5, Opus 5) reject outright — every request would just fail. So the fix has to check the installed Copilot version and only switch modes when it's new enough; older Copilot stays on the old (working, uncached) path.Fix
PR #495. Verified against a real workspace: caching now shows up in Databricks' own usage table for Copilot + Claude, on Copilot 1.0.81-6 and newer.