Support OpenAI prompt_cache_breakpoint on Responses API input content
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 56/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- typescript
- Ambito
- api
Direzione di ricerca
Start with the InputTextContent, InputImageContent, InputFileContent, and InputContent definitions in packages/ai/openai/src/OpenAiSchema.ts, then inspect the system, user, image, and PDF conversions in packages/ai/openai/src/OpenAiLanguageModel.ts. Define an OpenAI-specific way to carry a breakpoint through prompt conversion and verify that the intended input_text, input_image, and input_file blocks emit it without conflating request-level cache options.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Support OpenAI prompt_cache_breakpoint on Responses API input content
Summary
@effect/ai-openai currently has no way to mark an explicit OpenAI prompt-cache breakpoint on a Responses API input content block.
OpenAI's GPT-5.6 prompt-caching API supports prompt_cache_breakpoint on input_text, input_image, and input_file blocks. This is distinct from prompt_cache_key, which is a request-level cache-routing control.
Version checked
@effect/[email protected]mainatc9b56ab- OpenAI documentation checked on 2026-08-01
Why this matters
GPT-5.6 and later cache exact prefixes at cache breakpoints. With the default implicit policy, the service places a breakpoint at the latest user or tool message. If a stable system prompt or document is followed by changing content, the implicit breakpoint can repeatedly select a changing prefix instead of the stable reusable prefix.
An explicit breakpoint lets an application mark the end of the stable prefix. Combined with prompt_cache_options.mode: "explicit", it can also prevent writes for changing suffixes.
See OpenAI's current documentation for the behavior and supported blocks:
Evidence in Effect
The high-level Responses content schemas have no breakpoint field:
InputTextContent,InputImageContent, andInputFileContentcontain the supported content data but noprompt_cache_breakpoint.InputContentis the union of those three schemas.
The prompt translator constructs those blocks without a breakpoint:
- System messages are converted to an
input_textblock. - User text and image parts are converted to
input_textandinput_imageblocks. - PDF parts are converted to
input_fileblocks.
A repository-wide search of packages/ai/openai and packages/ai/openai-compat at c9b56ab507f224426ee8388dc450da447ec4715f finds no prompt_cache_breakpoint or prompt_cache_options support.
Expected behavior
Effect prompt content should provide an OpenAI-specific way to request:
{
"type": "input_text",
"text": "stable reusable instructions",
"prompt_cache_breakpoint": {
"mode": "explicit"
}
}
The same capability should be representable for input_image and input_file parts supported by OpenAI.
The exact Effect API could use provider options on prompt parts or another provider-specific mechanism. The important behavior is that the marker survives prompt conversion and is emitted on the intended content block.
Request-level prompt_cache_key and prompt_cache_options support is tracked separately in #6830 because those fields belong to OpenAiLanguageModel.Config rather than individual prompt content blocks.
Related work
- #6342 reported that encoding system messages as strings prevented OpenAI cache hits.
- #6549 changed system-message encoding to an
input_textblock, which is one of the content types on which OpenAI now supports explicit breakpoints. - #6504 / #6519 added the cache-write usage accounting needed to measure explicit caching behavior.
- Lingua principale
- TypeScript
- Stelle
- 16.7k
- Fork
- 808
- Merge medio
- 11h 3m
- PR unite (30g)
- 839
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Effect-TS/effect
-
Support OpenTelemetry JS SDK v3 and replace deprecated tracing peers in Effect v4Forse già presa @effect-bot l’ha presa oggi. Aperta
Effect-TS/effect#10328 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
PersistedQueue: offer option that de-duplicates an id only while it is pending or processingForse già presa @effect-bot l’ha presa 1 giorno fa. Aperta
Effect-TS/effect#10313 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
shorthand for mapping over tagged union schemaForse già presa @effect-bot l’ha presa 1 giorno fa. Apertaenhancement
Effect-TS/effect#10286 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Cluster: A way to remove processed requests from storageForse già presa @effect-bot l’ha presa 3 giorni fa. Apertaenhancement
Effect-TS/effect#10239 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
cluster: a runner that lost its shard lock can still write replies and messages for that shardAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Effect-TS/effect
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
-
bug needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
DSpace/dspace-angular#6511 ·
I maintainer di solito rispondono entro 1 giorno
-
area: frontend area:byok bug severity:low
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
Phone app shows Unknown for a remote machine whose key changedForse già presa @janicduplessis l’ha presa oggi. Apertaarea: mobile priority: P3 type: bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
appandflow/stim#5006 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Area - Local to Cloud Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
microsoft/vscode-mssql#23209 ·
I maintainer di solito rispondono entro 1 giorno