[GH-ISSUE #31] BUG: Error 422 on Claude code, after an initial success message #22

Closed
opened 2026-02-27 07:17:29 +03:00 by kerem · 4 comments
Owner

Originally created by @cristianadrielbraun on GitHub (Jan 11, 2026).
Original GitHub issue: https://github.com/jwadow/kiro-gateway/issues/31

Kiro Gateway Version

Latest 6ce52d9 commit

What happened?

Hello guys!
Okay so I was trying the gateway with CC, and I'm able to reproduce this consistently:

  • Open Claude Code, say hi (or whatever). I get a response message BUT I still see a 422 in the logs
  • Send a second message. Second message fails with error 422. Every single time
    I tried with the latest Claude Code version but also with a few versions older

for the settings.json of claude, I'm using the ANTHROPIC_AUTH_TOKEN variable with the key; the ANTHROPIC_BASE_URL for the host. I experimented with a few extras like CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC, which in the logs, made the first message to NOT show a "422", but starting with the second we're back at 422

PS: enabling "errors" in the devug mode didn't generate any file, I had to go all the way to "debug"

Happy to help with more testing

Debug Logs

app_logs.txt
request_body.json
kiro_request_body.json

Originally created by @cristianadrielbraun on GitHub (Jan 11, 2026). Original GitHub issue: https://github.com/jwadow/kiro-gateway/issues/31 ### Kiro Gateway Version Latest 6ce52d9 commit ### What happened? Hello guys! Okay so I was trying the gateway with CC, and I'm able to reproduce this consistently: - Open Claude Code, say hi (or whatever). I get a response message BUT I still see a 422 in the logs - Send a second message. Second message fails with error 422. Every single time I tried with the latest Claude Code version but also with a few versions older for the settings.json of claude, I'm using the ANTHROPIC_AUTH_TOKEN variable with the key; the ANTHROPIC_BASE_URL for the host. I experimented with a few extras like CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC, which in the logs, made the first message to NOT show a "422", but starting with the second we're back at 422 PS: enabling "errors" in the devug mode didn't generate any file, I had to go all the way to "debug" Happy to help with more testing ### Debug Logs [app_logs.txt](https://github.com/user-attachments/files/24547311/app_logs.txt) [request_body.json](https://github.com/user-attachments/files/24547312/request_body.json) [kiro_request_body.json](https://github.com/user-attachments/files/24547313/kiro_request_body.json)
kerem 2026-02-27 07:17:29 +03:00
  • closed this issue
  • added the
    bug
    fixed
    labels
Author
Owner

@jwadow commented on GitHub (Jan 11, 2026):

Hello again @cristianadrielbraun, I've improved the logger; it now catches 422 errors correctly.
Run git pull (update to latest), specify DEBUG_MODE=errors, wait for an error, and send me a new set of logs.

P.S. The logs you sent me are incorrect; they're actually successful requests, because that's the only thing it caught, haha

<!-- gh-comment-id:3733820748 --> @jwadow commented on GitHub (Jan 11, 2026): Hello again @cristianadrielbraun, I've improved the logger; it now catches 422 errors correctly. Run `git pull` (update to latest), specify `DEBUG_MODE=errors`, wait for an error, and send me a new set of logs. P.S. The logs you sent me are incorrect; they're actually successful requests, because that's the only thing it caught, haha
Author
Owner

@cristianadrielbraun commented on GitHub (Jan 11, 2026):

Okay so for some reason it's still not generating logs in the debug folder.. but I can show you the errors I'm getting in the server output if that's helpful:

2026-01-11 03:07:17 | ERROR | kiro.exceptions:validation_exception_handler:88 - Validation error (422): [{'type': 'string_type', 'loc': ['body', 'messages', 1, 'content', 'str'], 'msg': 'Input should be a valid string', 'input': [{'type': 'thinking', 'thinking': '\nThe user is greeting me casually. I should respond in a friendly but concise manner, as per my instructions to keep responses short and avoid unnecessary emojis or excessive praise.\n', 'signature': 'sig_8d3c146929cf410e8f4a7f1204ae7814'}, {'type': 'text', 'text': 'Hello! How can I help you today?', 'cache_control': {'type': 'ephemeral'}}]}, {'type': 'literal_error', 'loc': ['body', 'messages', 1, 'content', 'list[union[TextContentBlock,ImageContentBlock,ToolUseContentBlock,ToolResultContentBlock]]', 0, 'TextContentBlock', 'type'], 'msg': "Input should be 'text'", 'input': 'thinking', 'ctx': {'expected': "'text'"}}, {'type': 'missing', 'loc': ['body', 'messages', 1, 'content', 'list[union[TextContentBlock,ImageContentBlock,ToolUseContentBlock,ToolResultContentBlock]]', 0, 'TextContentBlock', 'text'], 'msg': 'Field required', 'input': {'type': 'thinking', 'thinking': '\nThe user is greeting me casually. I should respond in a friendly but concise manner, as per my instructions to keep responses short and avoid unnecessary emojis or excessive praise.\n', 'signature': 'sig_8d3c146929cf410e8f4a7f1204ae7814'}}, {'type': 'literal_error', 'loc': ['body', 'messages', 1, 'content', 'list[union[TextContentBlock,ImageContentBlock,ToolUseContentBlock,ToolResultContentBlock]]', 0, 'ImageContentBlock', 'type'], 'msg': "Input should be 'image'", 'input': 'thinking', 'ctx': {'expected': "'image'"}}, {'type': 'missing', 'loc': ['body', 'messages', 1, 'content', 'list[union[TextContentBlock,ImageContentBlock,ToolUseContentBlock,ToolResultContentBlock]]', 0, 'ImageContentBlock', 'source'], 'msg': 'Field required', 'input': {'type': 'thinking', 'thinking': '\nThe user is greeting me casually. I should respond in a friendly but concise manner, as per my instructions to keep responses short and avoid unnecessary emojis or excessive praise.\n', 'signature': 'sig_8d3c146929cf410e8f4a7f1204ae7814'}}, {'type': 'literal_error', 'loc': ['body', 'messages', 1, 'content', 'list[union[TextContentBlock,ImageContentBlock,ToolUseContentBlock,ToolResultContentBlock]]', 0, 'ToolUseContentBlock', 'type'], 'msg': "Input should be 'tool_use'", 'input': 'thinking', 'ctx': {'expected': "'tool_use'"}}, {'type': 'missing', 'loc': ['body', 'messages', 1, 'content', 'list[union[TextContentBlock,ImageContentBlock,ToolUseContentBlock,ToolResultContentBlock]]', 0, 'ToolUseContentBlock', 'id'], 'msg': 'Field required', 'input': {'type': 'thinking', 'thinking': '\nThe user is greeting me casually. I should respond in a friendly but concise manner, as per my instructions to keep responses short and avoid unnecessary emojis or excessive praise.\n', 'signature': 'sig_8d3c146929cf410e8f4a7f1204ae7814'}}, {'type': 'missing', 'loc': ['body', 'messages', 1, 'content', 'list[union[TextContentBlock,ImageContentBlock,ToolUseContentBlock,ToolResultContentBlock]]', 0, 'ToolUseContentBlock', 'name'], 'msg': 'Field required', 'input': {'type': 'thinking', 'thinking': '\nThe user is greeting me casually. I should respond in a friendly but concise manner, as per my instructions to keep responses short and avoid unnecessary emojis or excessive praise.\n', 'signature': 'sig_8d3c146929cf410e8f4a7f1204ae7814'}}, {'type': 'missing', 'loc': ['body', 'messages', 1, 'content', 'list[union[TextContentBlock,ImageContentBlock,ToolUseContentBlock,ToolResultContentBlock]]', 0, 'ToolUseContentBlock', 'input'], 'msg': 'Field required', 'input': {'type': 'thinking', 'thinking': '\nThe user is greeting me casually. I should respond in a friendly but concise manner, as per my instructions to keep responses short and avoid unnecessary emojis or excessive praise.\n', 'signature': 'sig_8d3c146929cf410e8f4a7f1204ae7814'}}, {'type': 'literal_error', 'loc': ['body', 'messages', 1, 'content', 'list[union[TextContentBlock,ImageContentBlock,ToolUseContentBlock,ToolResultContentBlock]]', 0, 'ToolResultContentBlock', 'type'], 'msg': "Input should be 'tool_result'", 'input': 'thinking', 'ctx': {'expected': "'tool_result'"}}, {'type': 'missing', 'loc': ['body', 'messages', 1, 'content', 'list[union[TextContentBlock,ImageContentBlock,ToolUseContentBlock,ToolResultContentBlock]]', 0, 'ToolResultContentBlock', 'tool_use_id'], 'msg': 'Field required', 'input': {'type': 'thinking', 'thinking': '\nThe user is greeting me casually. I should respond in a friendly but concise manner, as per my instructions to keep responses short and avoid unnecessary emojis or excessive praise.\n', 'signature': 'sig_8d3c146929cf410e8f4a7f1204ae7814'}}] 2026-01-11 03:07:17 | INFO | kiro.debug_logger:flush_on_error:310 - [DebugLogger] Error logs flushed to debug_logs (status=422) 2026-01-11 03:07:17 | INFO | logging:callHandlers:1737 - 127.0.0.1:45330 - "POST /v1/messages?beta=true HTTP/1.1" 422 2026-01-11 03:07:17 | ERROR | kiro.exceptions:validation_exception_handler:88 - Validation error (422): [{'type': 'string_type', 'loc': ['body', 'messages', 1, 'content', 'str'], 'msg': 'Input should be a valid string', 'input': [{'type': 'thinking', 'thinking': '\nThe user is greeting me casually. I should respond in a friendly but concise manner, as per my instructions to keep responses short and avoid unnecessary emojis or excessive praise.\n', 'signature': 'sig_8d3c146929cf410e8f4a7f1204ae7814'}, {'type': 'text', 'text': 'Hello! How can I help you today?', 'cache_control': {'type': 'ephemeral'}}]}, {'type': 'literal_error', 'loc': ['body', 'messages', 1, 'content', 'list[union[TextContentBlock,ImageContentBlock,ToolUseContentBlock,ToolResultContentBlock]]', 0, 'TextContentBlock', 'type'], 'msg': "Input should be 'text'", 'input': 'thinking', 'ctx': {'expected': "'text'"}}, {'type': 'missing', 'loc': ['body', 'messages', 1, 'content', 'list[union[TextContentBlock,ImageContentBlock,ToolUseContentBlock,ToolResultContentBlock]]', 0, 'TextContentBlock', 'text'], 'msg': 'Field required', 'input': {'type': 'thinking', 'thinking': '\nThe user is greeting me casually. I should respond in a friendly but concise manner, as per my instructions to keep responses short and avoid unnecessary emojis or excessive praise.\n', 'signature': 'sig_8d3c146929cf410e8f4a7f1204ae7814'}}, {'type': 'literal_error', 'loc': ['body', 'messages', 1, 'content', 'list[union[TextContentBlock,ImageContentBlock,ToolUseContentBlock,ToolResultContentBlock]]', 0, 'ImageContentBlock', 'type'], 'msg': "Input should be 'image'", 'input': 'thinking', 'ctx': {'expected': "'image'"}}, {'type': 'missing', 'loc': ['body', 'messages', 1, 'content', 'list[union[TextContentBlock,ImageContentBlock,ToolUseContentBlock,ToolResultContentBlock]]', 0, 'ImageContentBlock', 'source'], 'msg': 'Field required', 'input': {'type': 'thinking', 'thinking': '\nThe user is greeting me casually. I should respond in a friendly but concise manner, as per my instructions to keep responses short and avoid unnecessary emojis or excessive praise.\n', 'signature': 'sig_8d3c146929cf410e8f4a7f1204ae7814'}}, {'type': 'literal_error', 'loc': ['body', 'messages', 1, 'content', 'list[union[TextContentBlock,ImageContentBlock,ToolUseContentBlock,ToolResultContentBlock]]', 0, 'ToolUseContentBlock', 'type'], 'msg': "Input should be 'tool_use'", 'input': 'thinking', 'ctx': {'expected': "'tool_use'"}}, {'type': 'missing', 'loc': ['body', 'messages', 1, 'content', 'list[union[TextContentBlock,ImageContentBlock,ToolUseContentBlock,ToolResultContentBlock]]', 0, 'ToolUseContentBlock', 'id'], 'msg': 'Field required', 'input': {'type': 'thinking', 'thinking': '\nThe user is greeting me casually. I should respond in a friendly but concise manner, as per my instructions to keep responses short and avoid unnecessary emojis or excessive praise.\n', 'signature': 'sig_8d3c146929cf410e8f4a7f1204ae7814'}}, {'type': 'missing', 'loc': ['body', 'messages', 1, 'content', 'list[union[TextContentBlock,ImageContentBlock,ToolUseContentBlock,ToolResultContentBlock]]', 0, 'ToolUseContentBlock', 'name'], 'msg': 'Field required', 'input': {'type': 'thinking', 'thinking': '\nThe user is greeting me casually. I should respond in a friendly but concise manner, as per my instructions to keep responses short and avoid unnecessary emojis or excessive praise.\n', 'signature': 'sig_8d3c146929cf410e8f4a7f1204ae7814'}}, {'type': 'missing', 'loc': ['body', 'messages', 1, 'content', 'list[union[TextContentBlock,ImageContentBlock,ToolUseContentBlock,ToolResultContentBlock]]', 0, 'ToolUseContentBlock', 'input'], 'msg': 'Field required', 'input': {'type': 'thinking', 'thinking': '\nThe user is greeting me casually. I should respond in a friendly but concise manner, as per my instructions to keep responses short and avoid unnecessary emojis or excessive praise.\n', 'signature': 'sig_8d3c146929cf410e8f4a7f1204ae7814'}}, {'type': 'literal_error', 'loc': ['body', 'messages', 1, 'content', 'list[union[TextContentBlock,ImageContentBlock,ToolUseContentBlock,ToolResultContentBlock]]', 0, 'ToolResultContentBlock', 'type'], 'msg': "Input should be 'tool_result'", 'input': 'thinking', 'ctx': {'expected': "'tool_result'"}}, {'type': 'missing', 'loc': ['body', 'messages', 1, 'content', 'list[union[TextContentBlock,ImageContentBlock,ToolUseContentBlock,ToolResultContentBlock]]', 0, 'ToolResultContentBlock', 'tool_use_id'], 'msg': 'Field required', 'input': {'type': 'thinking', 'thinking': '\nThe user is greeting me casually. I should respond in a friendly but concise manner, as per my instructions to keep responses short and avoid unnecessary emojis or excessive praise.\n', 'signature': 'sig_8d3c146929cf410e8f4a7f1204ae7814'}}]

On claude code itself, this is what I see:

Image

is this helpful or do you require the debug files?

<!-- gh-comment-id:3733830407 --> @cristianadrielbraun commented on GitHub (Jan 11, 2026): Okay so for some reason it's still not generating logs in the debug folder.. but I can show you the errors I'm getting in the server output if that's helpful: `2026-01-11 03:07:17 | ERROR | kiro.exceptions:validation_exception_handler:88 - Validation error (422): [{'type': 'string_type', 'loc': ['body', 'messages', 1, 'content', 'str'], 'msg': 'Input should be a valid string', 'input': [{'type': 'thinking', 'thinking': '\nThe user is greeting me casually. I should respond in a friendly but concise manner, as per my instructions to keep responses short and avoid unnecessary emojis or excessive praise.\n', 'signature': 'sig_8d3c146929cf410e8f4a7f1204ae7814'}, {'type': 'text', 'text': 'Hello! How can I help you today?', 'cache_control': {'type': 'ephemeral'}}]}, {'type': 'literal_error', 'loc': ['body', 'messages', 1, 'content', 'list[union[TextContentBlock,ImageContentBlock,ToolUseContentBlock,ToolResultContentBlock]]', 0, 'TextContentBlock', 'type'], 'msg': "Input should be 'text'", 'input': 'thinking', 'ctx': {'expected': "'text'"}}, {'type': 'missing', 'loc': ['body', 'messages', 1, 'content', 'list[union[TextContentBlock,ImageContentBlock,ToolUseContentBlock,ToolResultContentBlock]]', 0, 'TextContentBlock', 'text'], 'msg': 'Field required', 'input': {'type': 'thinking', 'thinking': '\nThe user is greeting me casually. I should respond in a friendly but concise manner, as per my instructions to keep responses short and avoid unnecessary emojis or excessive praise.\n', 'signature': 'sig_8d3c146929cf410e8f4a7f1204ae7814'}}, {'type': 'literal_error', 'loc': ['body', 'messages', 1, 'content', 'list[union[TextContentBlock,ImageContentBlock,ToolUseContentBlock,ToolResultContentBlock]]', 0, 'ImageContentBlock', 'type'], 'msg': "Input should be 'image'", 'input': 'thinking', 'ctx': {'expected': "'image'"}}, {'type': 'missing', 'loc': ['body', 'messages', 1, 'content', 'list[union[TextContentBlock,ImageContentBlock,ToolUseContentBlock,ToolResultContentBlock]]', 0, 'ImageContentBlock', 'source'], 'msg': 'Field required', 'input': {'type': 'thinking', 'thinking': '\nThe user is greeting me casually. I should respond in a friendly but concise manner, as per my instructions to keep responses short and avoid unnecessary emojis or excessive praise.\n', 'signature': 'sig_8d3c146929cf410e8f4a7f1204ae7814'}}, {'type': 'literal_error', 'loc': ['body', 'messages', 1, 'content', 'list[union[TextContentBlock,ImageContentBlock,ToolUseContentBlock,ToolResultContentBlock]]', 0, 'ToolUseContentBlock', 'type'], 'msg': "Input should be 'tool_use'", 'input': 'thinking', 'ctx': {'expected': "'tool_use'"}}, {'type': 'missing', 'loc': ['body', 'messages', 1, 'content', 'list[union[TextContentBlock,ImageContentBlock,ToolUseContentBlock,ToolResultContentBlock]]', 0, 'ToolUseContentBlock', 'id'], 'msg': 'Field required', 'input': {'type': 'thinking', 'thinking': '\nThe user is greeting me casually. I should respond in a friendly but concise manner, as per my instructions to keep responses short and avoid unnecessary emojis or excessive praise.\n', 'signature': 'sig_8d3c146929cf410e8f4a7f1204ae7814'}}, {'type': 'missing', 'loc': ['body', 'messages', 1, 'content', 'list[union[TextContentBlock,ImageContentBlock,ToolUseContentBlock,ToolResultContentBlock]]', 0, 'ToolUseContentBlock', 'name'], 'msg': 'Field required', 'input': {'type': 'thinking', 'thinking': '\nThe user is greeting me casually. I should respond in a friendly but concise manner, as per my instructions to keep responses short and avoid unnecessary emojis or excessive praise.\n', 'signature': 'sig_8d3c146929cf410e8f4a7f1204ae7814'}}, {'type': 'missing', 'loc': ['body', 'messages', 1, 'content', 'list[union[TextContentBlock,ImageContentBlock,ToolUseContentBlock,ToolResultContentBlock]]', 0, 'ToolUseContentBlock', 'input'], 'msg': 'Field required', 'input': {'type': 'thinking', 'thinking': '\nThe user is greeting me casually. I should respond in a friendly but concise manner, as per my instructions to keep responses short and avoid unnecessary emojis or excessive praise.\n', 'signature': 'sig_8d3c146929cf410e8f4a7f1204ae7814'}}, {'type': 'literal_error', 'loc': ['body', 'messages', 1, 'content', 'list[union[TextContentBlock,ImageContentBlock,ToolUseContentBlock,ToolResultContentBlock]]', 0, 'ToolResultContentBlock', 'type'], 'msg': "Input should be 'tool_result'", 'input': 'thinking', 'ctx': {'expected': "'tool_result'"}}, {'type': 'missing', 'loc': ['body', 'messages', 1, 'content', 'list[union[TextContentBlock,ImageContentBlock,ToolUseContentBlock,ToolResultContentBlock]]', 0, 'ToolResultContentBlock', 'tool_use_id'], 'msg': 'Field required', 'input': {'type': 'thinking', 'thinking': '\nThe user is greeting me casually. I should respond in a friendly but concise manner, as per my instructions to keep responses short and avoid unnecessary emojis or excessive praise.\n', 'signature': 'sig_8d3c146929cf410e8f4a7f1204ae7814'}}] 2026-01-11 03:07:17 | INFO | kiro.debug_logger:flush_on_error:310 - [DebugLogger] Error logs flushed to debug_logs (status=422) 2026-01-11 03:07:17 | INFO | logging:callHandlers:1737 - 127.0.0.1:45330 - "POST /v1/messages?beta=true HTTP/1.1" 422 2026-01-11 03:07:17 | ERROR | kiro.exceptions:validation_exception_handler:88 - Validation error (422): [{'type': 'string_type', 'loc': ['body', 'messages', 1, 'content', 'str'], 'msg': 'Input should be a valid string', 'input': [{'type': 'thinking', 'thinking': '\nThe user is greeting me casually. I should respond in a friendly but concise manner, as per my instructions to keep responses short and avoid unnecessary emojis or excessive praise.\n', 'signature': 'sig_8d3c146929cf410e8f4a7f1204ae7814'}, {'type': 'text', 'text': 'Hello! How can I help you today?', 'cache_control': {'type': 'ephemeral'}}]}, {'type': 'literal_error', 'loc': ['body', 'messages', 1, 'content', 'list[union[TextContentBlock,ImageContentBlock,ToolUseContentBlock,ToolResultContentBlock]]', 0, 'TextContentBlock', 'type'], 'msg': "Input should be 'text'", 'input': 'thinking', 'ctx': {'expected': "'text'"}}, {'type': 'missing', 'loc': ['body', 'messages', 1, 'content', 'list[union[TextContentBlock,ImageContentBlock,ToolUseContentBlock,ToolResultContentBlock]]', 0, 'TextContentBlock', 'text'], 'msg': 'Field required', 'input': {'type': 'thinking', 'thinking': '\nThe user is greeting me casually. I should respond in a friendly but concise manner, as per my instructions to keep responses short and avoid unnecessary emojis or excessive praise.\n', 'signature': 'sig_8d3c146929cf410e8f4a7f1204ae7814'}}, {'type': 'literal_error', 'loc': ['body', 'messages', 1, 'content', 'list[union[TextContentBlock,ImageContentBlock,ToolUseContentBlock,ToolResultContentBlock]]', 0, 'ImageContentBlock', 'type'], 'msg': "Input should be 'image'", 'input': 'thinking', 'ctx': {'expected': "'image'"}}, {'type': 'missing', 'loc': ['body', 'messages', 1, 'content', 'list[union[TextContentBlock,ImageContentBlock,ToolUseContentBlock,ToolResultContentBlock]]', 0, 'ImageContentBlock', 'source'], 'msg': 'Field required', 'input': {'type': 'thinking', 'thinking': '\nThe user is greeting me casually. I should respond in a friendly but concise manner, as per my instructions to keep responses short and avoid unnecessary emojis or excessive praise.\n', 'signature': 'sig_8d3c146929cf410e8f4a7f1204ae7814'}}, {'type': 'literal_error', 'loc': ['body', 'messages', 1, 'content', 'list[union[TextContentBlock,ImageContentBlock,ToolUseContentBlock,ToolResultContentBlock]]', 0, 'ToolUseContentBlock', 'type'], 'msg': "Input should be 'tool_use'", 'input': 'thinking', 'ctx': {'expected': "'tool_use'"}}, {'type': 'missing', 'loc': ['body', 'messages', 1, 'content', 'list[union[TextContentBlock,ImageContentBlock,ToolUseContentBlock,ToolResultContentBlock]]', 0, 'ToolUseContentBlock', 'id'], 'msg': 'Field required', 'input': {'type': 'thinking', 'thinking': '\nThe user is greeting me casually. I should respond in a friendly but concise manner, as per my instructions to keep responses short and avoid unnecessary emojis or excessive praise.\n', 'signature': 'sig_8d3c146929cf410e8f4a7f1204ae7814'}}, {'type': 'missing', 'loc': ['body', 'messages', 1, 'content', 'list[union[TextContentBlock,ImageContentBlock,ToolUseContentBlock,ToolResultContentBlock]]', 0, 'ToolUseContentBlock', 'name'], 'msg': 'Field required', 'input': {'type': 'thinking', 'thinking': '\nThe user is greeting me casually. I should respond in a friendly but concise manner, as per my instructions to keep responses short and avoid unnecessary emojis or excessive praise.\n', 'signature': 'sig_8d3c146929cf410e8f4a7f1204ae7814'}}, {'type': 'missing', 'loc': ['body', 'messages', 1, 'content', 'list[union[TextContentBlock,ImageContentBlock,ToolUseContentBlock,ToolResultContentBlock]]', 0, 'ToolUseContentBlock', 'input'], 'msg': 'Field required', 'input': {'type': 'thinking', 'thinking': '\nThe user is greeting me casually. I should respond in a friendly but concise manner, as per my instructions to keep responses short and avoid unnecessary emojis or excessive praise.\n', 'signature': 'sig_8d3c146929cf410e8f4a7f1204ae7814'}}, {'type': 'literal_error', 'loc': ['body', 'messages', 1, 'content', 'list[union[TextContentBlock,ImageContentBlock,ToolUseContentBlock,ToolResultContentBlock]]', 0, 'ToolResultContentBlock', 'type'], 'msg': "Input should be 'tool_result'", 'input': 'thinking', 'ctx': {'expected': "'tool_result'"}}, {'type': 'missing', 'loc': ['body', 'messages', 1, 'content', 'list[union[TextContentBlock,ImageContentBlock,ToolUseContentBlock,ToolResultContentBlock]]', 0, 'ToolResultContentBlock', 'tool_use_id'], 'msg': 'Field required', 'input': {'type': 'thinking', 'thinking': '\nThe user is greeting me casually. I should respond in a friendly but concise manner, as per my instructions to keep responses short and avoid unnecessary emojis or excessive praise.\n', 'signature': 'sig_8d3c146929cf410e8f4a7f1204ae7814'}}]` On claude code itself, this is what I see: <img width="2422" height="1200" alt="Image" src="https://github.com/user-attachments/assets/34a5c2ff-da94-4100-84e6-e21e6ff500a0" /> is this helpful or do you require the debug files?
Author
Owner

@jwadow commented on GitHub (Jan 11, 2026):

@cristianadrielbraun, fixed it!

Turns out I missed one line. When Claude Code sends back the conversation history, it includes thinking blocks from previous responses. Our Pydantic models didnt know about that type so it was rejecting them with 422.

Just added ThinkingContentBlock to the union and now it works.

Do a git pull and try again, should be good now.

About the debug logs not showing up in the folder, thats weird because your console shows the flush happening:
[DebugLogger] Error logs flushed to debug_logs (status=422)

Maybe check if the debug_logs folder exists and has write permissions? Or if youre running the server from the project root? Let me know if it still doesnt work after the update.

<!-- gh-comment-id:3733854651 --> @jwadow commented on GitHub (Jan 11, 2026): @cristianadrielbraun, fixed it! Turns out I missed one line. When Claude Code sends back the conversation history, it includes `thinking` blocks from previous responses. Our Pydantic models didnt know about that type so it was rejecting them with 422. Just added `ThinkingContentBlock` to the union and now it works. Do a `git pull` and try again, should be good now. About the debug logs not showing up in the folder, thats weird because your console shows the flush happening: `[DebugLogger] Error logs flushed to debug_logs (status=422)` Maybe check if the `debug_logs` folder exists and has write permissions? Or if youre running the server from the project root? Let me know if it still doesnt work after the update.
Author
Owner

@cristianadrielbraun commented on GitHub (Jan 11, 2026):

I know this is closed already but I just wanted to thank you, looks like it's working now. amazing!

<!-- gh-comment-id:3733857296 --> @cristianadrielbraun commented on GitHub (Jan 11, 2026): I know this is closed already but I just wanted to thank you, looks like it's working now. amazing!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/kiro-gateway-jwadow#22
No description provided.