Message has tool role, but there was no previous assistant message with a tool call! Message has tool role, but there was no previous assistant message with a tool call!

Resolved 💬 1 comment Opened Jan 7, 2026 by yuqx1561 Closed Jan 7, 2026

What version of Codex is running?

v0.79.0

What subscription do you have?

Plus

Which model were you using?

deepseek-reasoner

What platform is your computer?

Linux 7f3e348192e9 5.4.278-1.el7.elrepo.x86_64 #1 SMP Sun Jun 16 15:37:11 EDT 2024 x86_64 x86_64 x86_64 GNU/Linux

What issue are you seeing?

<img width="1865" height="718" alt="Image" src="https://github.com/user-attachments/assets/46ac4371-dc1f-4aa9-979c-01ecdce20636" />

What steps can reproduce the bug?

tool_call or shell command

What is the expected behavior?

{"error":{"message":"Message has tool role, but there was no previous assistant message with a tool call! Message has tool role, but there was no previous assistant message with a tool
call!","type":"BadRequestError","param":null,"code":400}}

Additional information

_No response_

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗