Repository navigation
v0.12.1 – /v1/messages accepts Claude Code's system messages (router 0.6.1)
Router 0.6.1, agent unchanged (0.16.0). Fix for /v1/messages with Claude Code 2.x, found in the first acceptance run against the real CLI.
- What went wrong: Claude Code sends a message with
role: systeminsidemessages(hints to the model after the first user turn, text blocks withcache_control). The public Messages API has no such role, and router 0.6.0 rejected the request with 400messages.1: role must be 'user' or 'assistant'. - Now: such a message goes on to Ollama as a
systemmessage at the same position; empty ones are dropped. thinking: {type: adaptive, display: omitted}, as Claude Code sends it, givesthink: true. Withdisplay: omittedthe router returns thinking blocks without text, as the API does, and sendspingevents while the model thinks, so the stream does not go silent for minutes.- Selftest and end-to-end suite cover the request shape Claude Code 2.1 sends (
?beta=true,context_management,output_config).
Deutsch
Router 0.6.1. Claude Code 2.x schickt innerhalb von messages eine Nachricht mit role: system, die es in der öffentlichen API nicht gibt; 0.6.0 lehnte die Anfrage mit 400 ab. Solche Nachrichten gehen jetzt an derselben Stelle als system-Nachricht an Ollama. thinking: {type: adaptive, display: omitted} ergibt think: true und Denkblöcke ohne Text, mit ping-Ereignissen, solange das Modell denkt.