Kiro Gateway Version
Current main at a5292ca (v2.4 development branch)
What happened?
Claude Code v2.1.215 can place runtime system reminders in messages[] using role: "system". Kiro Gateway rejects the request during Pydantic validation because AnthropicMessage.role only accepts user and assistant.
Minimal sanitized request shape:
{
"model": "<model-id>",
"messages": [
{"role": "user", "content": "<redacted>"},
{
"role": "system",
"content": [
{
"type": "text",
"text": "<runtime instructions redacted>",
"cache_control": {"type": "ephemeral"}
}
]
}
],
"system": [{"type": "text", "text": "<base system prompt redacted>"}]
}
The request never reaches the converter or Kiro runtime. A standard request through the same endpoint succeeds.
Expected behavior: before validating conversation roles, the Anthropic compatibility layer should preserve embedded system content by merging it into the top-level system field and remove those entries from messages[]. The same normalization should apply to /v1/messages/count_tokens.
Debug Logs
Sanitized validation output:
Validation error (422): [{
"type": "literal_error",
"loc": ["body", "messages", 1, "role"],
"msg": "Input should be 'user' or 'assistant'",
"input": "system"
}]
No prompts, tool definitions, credentials, account identifiers, local paths, or raw debug files are included.
Kiro Gateway Version
Current
mainata5292ca(v2.4 development branch)What happened?
Claude Code v2.1.215 can place runtime system reminders in
messages[]usingrole: "system". Kiro Gateway rejects the request during Pydantic validation becauseAnthropicMessage.roleonly acceptsuserandassistant.Minimal sanitized request shape:
{ "model": "<model-id>", "messages": [ {"role": "user", "content": "<redacted>"}, { "role": "system", "content": [ { "type": "text", "text": "<runtime instructions redacted>", "cache_control": {"type": "ephemeral"} } ] } ], "system": [{"type": "text", "text": "<base system prompt redacted>"}] }The request never reaches the converter or Kiro runtime. A standard request through the same endpoint succeeds.
Expected behavior: before validating conversation roles, the Anthropic compatibility layer should preserve embedded system content by merging it into the top-level
systemfield and remove those entries frommessages[]. The same normalization should apply to/v1/messages/count_tokens.Debug Logs
Sanitized validation output:
No prompts, tool definitions, credentials, account identifiers, local paths, or raw debug files are included.