Skip to content

[BUG] Original user message missing in tool result request #10756

@jiapingzeng

Description

@jiapingzeng

Describe the bug

When sending tool result, the AG-UI chat plugin omits the original user message. Here is a sample conversation that involves making a frontend tool call.

First request:

{
  "threadId": "thread-1760940748631-z3nqfiz54",
  "runId": "run-1760940754619-5474pw01b",
  "messages": [
    {
      "id": "msg-1760940754618-iwcr80j92",
      "role": "user",
      "content": "execute ppl 'test'"
    }
  ],
  "tools": [ ...  ],
  "context": [ ... ],
  "state": {},
  "forwardedProps": {}
}

Second request (this sends the tool result, but the original message is missing):

{
  "threadId": "thread-1760940748631-z3nqfiz54",
  "runId": "run-1760940758654-0bbxb7cio",
  "messages": [
    {
      "id": "msg-1760940758654-n078w23ij",
      "role": "tool",
      "content": "{\"success\":true,\"executed\":true,\"query\":\"test\",\"message\":\"Query updated and executed\"}",
      "toolCallId": "call_TzZNuBWkeRSfpiexABFluglq"
    }
  ],
  "tools": [ ... ],
  "context": [ ... ],
  "state": {},
  "forwardedProps": {}
}

Expected behavior
In the second request, messages should contain both the original message and the tool result message.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions