mirror of
https://github.com/zed-industries/zed.git
synced 2026-11-27 11:02:33 +01:00
10d1b2a564
Starting with GPT-6.2, OpenAI [appends top-level `instructions` after `input`](https://developers.openai.com/api/docs/guides/prompt-caching#how-prefix-matching-works), outside the cacheable prefix. [Like Codex](https://github.com/openai/codex/blob/9f2b87495bf979f6c1953cf00c98143981664914/codex-rs/core/src/client.rs#L1283-L1292), send Zed’s reusable system prompt as a leading `developer` message, including when replaying a native compaction window. Verified in a local Zed build with GPT-6.2 Sol: 98.4% of input tokens were cached on the final request. A live native-compaction replay probe also hit the cache on all four follow-up requests. All 137 focused tests passed. Release Notes: - Fixed prompt caching for reusable OpenAI system instructions on GPT-6.2 and later.