The API call is missing reasoning_content and the messages is corrupted when the command that the agent executed fails and the agent is loading until the API sends back 400 error.
We must ensure that the sequence of the messages is correct so the API of the vendor doesn't throw 400.
{"level":"info","timestamp":"2026-04-29T19:58:56.099+0200","caller":"middlewares/logger.go:24","msg":"request received","method":"POST","host":"localhost:8080","path":"/v1/chat/completions"}
{"level":"info","timestamp":"2026-04-29T19:58:56.102+0200","caller":"middlewares/logger.go:24","msg":"request received","method":"POST","host":"0.0.0.0:8080","path":"/proxy/deepseek/chat/completions"}
{"level":"error","timestamp":"2026-04-29T19:58:56.537+0200","caller":"core/provider.go:128","msg":"non-200 status code","provider":"Deepseek","statusCode":400,"operation":"Error generating streaming chat completion","error":"{\"error\":{\"message\":\"The `reasoning_content` in the thinking mode must be passed back to the API.\",\"type\":\"invalid_request_error\",\"param\":null,\"code\":\"invalid_request_error\"}}"}
{"level":"error","timestamp":"2026-04-29T19:58:56.537+0200","caller":"api/routes.go:589","msg":"failed to start streaming","provider":"deepseek","error":"{\"error\":{\"message\":\"The `reasoning_content` in the thinking mode must be passed back to the API.\",\"type\":\"invalid_request_error\",\"param\":null,\"code\":\"invalid_request_error\"}}"}
{"level":"info","timestamp":"2026-04-29T19:59:06.542+0200","caller":"middlewares/logger.go:24","msg":"request received","method":"POST","host":"localhost:8080","path":"/v1/chat/completions"}
{"level":"info","timestamp":"2026-04-29T19:59:06.543+0200","caller":"middlewares/logger.go:24","msg":"request received","method":"POST","host":"0.0.0.0:8080","path":"/proxy/deepseek/chat/completions"}
{"level":"error","timestamp":"2026-04-29T19:59:06.909+0200","caller":"core/provider.go:128","msg":"non-200 status code","provider":"Deepseek","statusCode":400,"operation":"Error generating streaming chat completion","error":"{\"error\":{\"message\":\"The `reasoning_content` in the thinking mode must be passed back to the API.\",\"type\":\"invalid_request_error\",\"param\":null,\"code\":\"invalid_request_error\"}}"}
{"level":"error","timestamp":"2026-04-29T19:59:06.909+0200","caller":"api/routes.go:589","msg":"failed to start streaming","provider":"deepseek","error":"{\"error\":{\"message\":\"The `reasoning_content` in the thinking mode must be passed back to the API.\",\"type\":\"invalid_request_error\",\"param\":null,\"code\":\"invalid_request_error\"}}"}
{"level":"info","timestamp":"2026-04-29T19:59:17.452+0200","caller":"middlewares/logger.go:24","msg":"request received","method":"POST","host":"localhost:8080","path":"/v1/chat/completions"}
{"level":"info","timestamp":"2026-04-29T19:59:17.453+0200","caller":"middlewares/logger.go:24","msg":"request received","method":"POST","host":"0.0.0.0:8080","path":"/proxy/deepseek/chat/completions"}
{"level":"error","timestamp":"2026-04-29T19:59:17.940+0200","caller":"core/provider.go:128","msg":"non-200 status code","provider":"Deepseek","statusCode":400,"operation":"Error generating streaming chat completion","error":"{\"error\":{\"message\":\"The `reasoning_content` in the thinking mode must be passed back to the API.\",\"type\":\"invalid_request_error\",\"param\":null,\"code\":\"invalid_request_error\"}}"}
{"level":"error","timestamp":"2026-04-29T19:59:17.940+0200","caller":"api/routes.go:589","msg":"failed to start streaming","provider":"deepseek","error":"{\"error\":{\"message\":\"The `reasoning_content` in the thinking mode must be passed back to the API.\",\"type\":\"invalid_request_error\",\"param\":null,\"code\":\"invalid_request_error\"}}"}
Summary
The API call is missing reasoning_content and the messages is corrupted when the command that the agent executed fails and the agent is loading until the API sends back 400 error.
We must ensure that the sequence of the messages is correct so the API of the vendor doesn't throw 400.
Steps to reproduce
Logs