litellm - 💡(How to fix) Fix [Bug]: API Error: 400 litellm.BadRequestError: OpenAIException - an assistant message with 'tool_calls' must be followed by tool messages responding to each 'tool_call_id'. The following tool_call_ids did not have response messages: Bash:0, Bash:1.

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

⎿  API Error: 400 litellm.BadRequestError: OpenAIException - an assistant message with 'tool_calls' must be followed by tool messages responding to each ⎿  API Error: 400 litellm.BadRequestError: OpenAIException - an assistant message with 'tool_calls' must be followed by tool messages responding to each

RAW_BUFFERClick to expand / collapse

Check for existing issues

  • I have searched the existing issues and checked that my issue is not a duplicate.

What happened?

config in litellm:{ "model_name": "kimi-k2.6-online", "litellm_params": { "api_base": "https://api.kimi.com/coding/v1", "custom_llm_provider": "openai", "use_in_pass_through": false, "use_litellm_proxy": false, "use_chat_completions_api": true, "merge_reasoning_content_in_choices": true, "tags": [], "model": "kimi-k2.6", "guardrails": [], "drop_params": true, "extra_headers": { "User-Agent": "KimiCLI/1.5" }, "modify_params": true }, "model_info": { "id": "c88c7b74-79fa-47f6-9ca9-5a47c3515579", "db_model": true, "access_groups": [], "direct_access": true, "access_via_team_ids": [ "7cfb6bbb-9851-456e-b000-077e16fea159" ], "supports_tool_choice": true, "supports_function_calling": true, "supports_parallel_function_calling": true }, "provider": "openai", "litellm_model_name": "kimi-k2.6", "api_base": "https://api.kimi.com/coding/v1", "cleanedLitellmParams": { "custom_llm_provider": "openai", "use_in_pass_through": false, "use_litellm_proxy": false, "use_chat_completions_api": true, "merge_reasoning_content_in_choices": true, "tags": [], "guardrails": [], "drop_params": true, "extra_headers": { "User-Agent": "KimiCLI/1.5" }, "modify_params": true } },request fail,logs:shenlu@k8s-node1:/data/shenlu/claude-code$ claude ╭─── Claude Code v2.1.145 ─────────────────────────────────────────────────────────────────────────────────────╮ │ │ Tips for getting started │ │ Welcome back! │ Run /init to create a CLAUDE.md file with instructions for Claude │ │ │ ───────────────────────────────────────────────────────────────── │ │ ▐▛███▜▌ │ What's new │ │ ▝▜█████▛▘ │ Check the Claude Code changelog for updates │ │ ▘▘ ▝▝ │ │ │ │ │ │ kimi-k2.6-online · API Usage Billing │ │ │ /data/shenlu/claude-code │ │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

❯ 分析当前目录

Searched for 1 pattern, listed 1 directory (ctrl+o to expand)

● 用户要求分析当前目录。我需要查看当前目录的内容,了解项目结构。让我使用Bash工具来列出文件和目录。 ⎿  API Error: 400 litellm.BadRequestError: OpenAIException - an assistant message with 'tool_calls' must be followed by tool messages responding to each 'tool_call_id'. The following tool_call_ids did not have response messages: Bash:0, Bash:1. Received Model Group=kimi-k2.6-online Available Model Group Fallbacks=None

✻ Baked for 7s

Steps to Reproduce

config in litellm:{ "model_name": "kimi-k2.6-online", "litellm_params": { "api_base": "https://api.kimi.com/coding/v1", "custom_llm_provider": "openai", "use_in_pass_through": false, "use_litellm_proxy": false, "use_chat_completions_api": true, "merge_reasoning_content_in_choices": true, "tags": [], "model": "kimi-k2.6", "guardrails": [], "drop_params": true, "extra_headers": { "User-Agent": "KimiCLI/1.5" }, "modify_params": true }, "model_info": { "id": "c88c7b74-79fa-47f6-9ca9-5a47c3515579", "db_model": true, "access_groups": [], "direct_access": true, "access_via_team_ids": [ "7cfb6bbb-9851-456e-b000-077e16fea159" ], "supports_tool_choice": true, "supports_function_calling": true, "supports_parallel_function_calling": true }, "provider": "openai", "litellm_model_name": "kimi-k2.6", "api_base": "https://api.kimi.com/coding/v1", "cleanedLitellmParams": { "custom_llm_provider": "openai", "use_in_pass_through": false, "use_litellm_proxy": false, "use_chat_completions_api": true, "merge_reasoning_content_in_choices": true, "tags": [], "guardrails": [], "drop_params": true, "extra_headers": { "User-Agent": "KimiCLI/1.5" }, "modify_params": true } },request fail,logs:shenlu@k8s-node1:/data/shenlu/claude-code$ claude ╭─── Claude Code v2.1.145 ─────────────────────────────────────────────────────────────────────────────────────╮ │ │ Tips for getting started │ │ Welcome back! │ Run /init to create a CLAUDE.md file with instructions for Claude │ │ │ ───────────────────────────────────────────────────────────────── │ │ ▐▛███▜▌ │ What's new │ │ ▝▜█████▛▘ │ Check the Claude Code changelog for updates │ │ ▘▘ ▝▝ │ │ │ │ │ │ kimi-k2.6-online · API Usage Billing │ │ │ /data/shenlu/claude-code │ │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

❯ 分析当前目录

Searched for 1 pattern, listed 1 directory (ctrl+o to expand)

● 用户要求分析当前目录。我需要查看当前目录的内容,了解项目结构。让我使用Bash工具来列出文件和目录。 ⎿  API Error: 400 litellm.BadRequestError: OpenAIException - an assistant message with 'tool_calls' must be followed by tool messages responding to each 'tool_call_id'. The following tool_call_ids did not have response messages: Bash:0, Bash:1. Received Model Group=kimi-k2.6-online Available Model Group Fallbacks=None

✻ Baked for 7s

Relevant log output

What part of LiteLLM is this about?

No response

What LiteLLM version are you on ?

v1.85.0

Twitter / LinkedIn details

No response

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING