PARAS MADAN
All writing

Latest in AI

How to check GPT-6.2 prompt caching in Zed 1.29.3

Zed 1.29.3 fixes how the native agent sends reusable OpenAI instructions. Here's how to check cache reads before and after compaction without logging prompts.

If a long Zed Agent thread keeps sending the same instructions, you might expect later requests to reuse them. On the GPT-6.2 Responses API, their position in the request matters. Zed's 1.29.3 stable release, shipped November 20, changes that position so the reusable instructions can be cached. The fix also covers how Zed puts the instructions back when it replays a provider-compacted conversation.

If you're checking whether the update helped, compare cached input on a few follow-up requests. The total token count in the Agent Panel answers a different question: how much context the current thread uses.

What moved in the request

With GPT-6.2 and later, OpenAI processes the top-level instructions value after input. The tokens in that field are billed as uncached even if an earlier part of the request hits the cache. OpenAI's prefix matching guide recommends putting stable instructions first in a developer message instead.

The stable Zed patch does that when building a Responses request. It puts the current system prompt in the first developer message, ahead of any restored compaction items, while leaving those items intact. A follow-up can now share that initial text with an earlier request even when the body of the conversation is different.

Make sure you're testing the right route

Start a native Zed Agent thread using the OpenAI provider and the same GPT-6.2 model for every turn. Check the provider icon in the Agent Panel model selector; the same model name can appear under multiple providers. If you're using direct API billing, the OpenAI API setup page shows where to configure it.

The editor version alone won't tell you how an external Codex or OpenCode agent sends its requests. Those agents run separately and typically own their model configuration, as Zed's agent setup guide explains. A custom OpenAI-compatible endpoint can also use Chat Completions instead of Responses. Test the route you actually want to diagnose before comparing the numbers.

Compare a few turns in one thread

Use a throwaway workspace and the built-in Minimal profile, which doesn't provide project tools. Start with a synthetic text sample long enough to leave more than 1,024 unchanged input tokens, the minimum cacheable prefix for these models. Ask for a short summary, then ask two small follow-up questions in the same thread. Keep the model and profile fixed, and run the turns close together.

If your existing diagnostics expose Responses usage, record only usage.input_tokens and usage.input_tokens_details.cached_tokens for each request. OpenAI also links to its Prompt Caching Dashboard in the monitoring section if you want a broader view. A cold first request isn't a failure. Look for reads on follow-up requests, and don't capture prompts or credentials to get the counts.

Check what happens after compaction

Run /compact in the same thread and verify that a Context Compacted entry appears, as described in Zed's Agent Panel docs. Then send two more short follow-ups. Where your provider uses native compaction, the patch keeps the current instructions ahead of the compacted window; it doesn't make every rewritten portion of the conversation cacheable.

The Zed maintainer's test reported cache hits on four follow-ups after native compaction. Use that as evidence that reuse works on the tested path, not as a target rate. A short prefix or a changed provider, model or early context can still leave you with few cached tokens. If you only see context size in the editor, record the run as unmeasured rather than calling it a cache miss.

I'm Paras Madan. I help AI teams explain technical releases with guides that show developers what changed and how to check their own setup. Book a 30-minute call.