Support OpenAI prompt_cache_breakpoint on Responses API input content
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 56/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- typescript
- Área
- api
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 16.7k
- Forks
- 808
- Merge medio
- 11 h 3 min
- PR fusionados (30 d)
- 840
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Effect-TS/effect
-
PgClient: withTransaction dies instead of failing with SqlError when the server ends the sessionPosiblemente ocupada @effect-bot la tomó hoy. Abierto
Effect-TS/effect#10290 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
shorthand for mapping over tagged union schemaPosiblemente ocupada @effect-bot la tomó hace 1 día. Abiertoenhancement
Effect-TS/effect#10286 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Cluster: A way to remove processed requests from storagePosiblemente ocupada @effect-bot la tomó hace 2 días. Abiertoenhancement
Effect-TS/effect#10239 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
cluster: a runner that lost its shard lock can still write replies and messages for that shardAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 47/100
Los mantenedores suelen responder en 1 día
Todos los issues de Effect-TS/effect
Issues similares
-
area: cli bug flake ready-for-agent
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
gazetta-studio/gazetta-studio#1772 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
microsoft/playwright#43875 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
README translations: ja, ko, deAbiertodocumentation good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
feature
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
calagopus/panel#285 · 1 comentario ·
Los mantenedores suelen responder en 1 día