Skip to content

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! #8816

Closed as not planned

Description

@yuqx1561

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?

Image

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

Activity

  1. changed the title [-]"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![/-] [+]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![/+] on Jan 7, 2026
  2. etraut-openai commented on Jan 7, 2026

    @etraut-openai
    Contributor

    This is likely because you're using the "chat" wire API. We've announced that we are removing support for this older wire API at the end of this month, so it's unlikely that we will fix any bugs with it between now and then. Please switch to the "responses" wire API.

    If this diagnosis isn't correct, let me know and I'll reopen the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtool-callsIssues related to tool calling

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions