Anthropic provider: cache breakpoint lands on a thinking block (400: thinking.cache_control: Extra inputs are not permitted)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 78/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- rust
- Área
- backend-api-design
Línea de trabajo
Start in src/provider/anthropic.rs at Breakpoint 3 around lines 632–660, then inspect bridge_breakpoint around line 935 and the existing is_empty_text helper. Build the request described in the issue and check that thinking blocks never receive cache_control, while an earlier cacheable block still gets a breakpoint. Done means both breakpoint paths follow that rule.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Ask (narrow): in src/provider/anthropic.rs (0.27.9), never put cache_control on a thinking or redacted_thinking block. Anthropic accepts cache_control only on text / tool_use / tool_result / image / document blocks.
Where: Breakpoint 3 (~L632-660) scans back from the second-to-last message and sets cache_control on content.last_mut() whenever it is not an empty text block (is_empty_text, L921). bridge_breakpoint (L935) uses the same last-block rule. Neither excludes thinking blocks.
Trigger: any assistant message whose last block is thinking: a refusal (stop_reason: refusal) that kept only its thinking, an interrupted turn, or a thinking-only turn. Seen in yoyo Day 261 (yologdev/yoyo-evolve#1206):
error: API error: HTTP 400 Bad Request: messages.19.content.0.thinking.cache_control: Extra inputs are not permitted
Because the picker is deterministic, every following request rebuilds the same body, so the session may stay poisoned (not measured on yoagent; opencode reported exactly that for the same defect).
Fix shape used elsewhere (litellm aa3d59d0, antra-tess/membrane 2d405944 lastCacheableBlockIndex, opencode #51141): pick the last cacheable block in the message; if the message has none, keep scanning to the previous message. Same rule in bridge_breakpoint.
Test: a request built from [user, assistant(thinking only), user] has no cache_control on any thinking block and still has one breakpoint on an earlier cacheable block.
yoyo-side: #1206 tracks the yoyo test that pins this once a release ships.
- Lenguaje dominante
- Rust
- Estrellas
- 327
- Forks
- 46
- Merge medio
- 2 h 36 min
- PR fusionados (30 d)
- 107
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
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 yologdev/yoagent
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Los mantenedores suelen responder en 1 día
-
enhancement P3
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
enhancement P3
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
Todos los issues de yologdev/yoagent
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 5 días
-
bug studies ui
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
userFRM/egui-charts#3308 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
marketing
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
meerkat-lang/meerkat#279 ·
Los mantenedores suelen responder en 1 día