ag-ui protocol error - payload is not compliant with RunAgentInputSchema

Đang mở
#613 3 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@abhithesys đang làm issue này rồi.

Từ ngày 8/6/2026.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

I came across your work today and it does make sense to me to avoid using json and having a custom DSL is the right approach. Thanks for this great effort!

Bug - A server using ag-ui protocol rejects the message sent by openui

My setup:

  • A FastAPI backend that has an endpoint that uses RunAgentInput type for the input_data
  • An openui based application that uses apiUrl and not custom adapters/messageformats etc

Below is the zod definition from https://github.com/ag-ui-protocol/ag-ui/blob/88ce4bca9f6fec6d778367fc7c197c262ffbcf61/sdks/typescript/packages/core/src/types.ts#L209-L219

export const RunAgentInputSchema = z.object({
  threadId: z.string(),
  runId: z.string(),
  parentRunId: z.string().optional(),
  state: z.any(),
  messages: z.array(MessageSchema),
  tools: z.array(ToolSchema),
  context: z.array(ContextSchema),
  forwardedProps: z.any(),
  resume: z.array(ResumeEntrySchema).optional(),
});

Here is a sample payload received by my FastAPI server from OpenUI client

{'threadId': 'ephemeral', 'messages': [{'role': 'user', 'content': 'Hi', 'id': '5ac6b8f0-a17d-4208-a30b-65f8b2637086'}]}

As you can see the payload is missing many required fields (e.g. state, tools, context, forwardedProps)


All the samples in the repo, have following use case

<FullScreen
        processMessage={async ({ messages, abortController }) => {
          return fetch("/api/chat", {
            method: "POST",
            headers: { "Content-Type": "application/json" },
            body: JSON.stringify({
              messages: openAIMessageFormat.toApi(messages),
            }),
            signal: abortController.signal,
          });
        }}

The documentation says you can use either apiUrl or processMessage

Use apiUrl when your server is compliant with ag-ui

Mine is

<FullScreen
        apiUrl="/simple_agent"
      />

I believe processMessage in createChatStore here https://github.com/thesysdev/openui/blob/1f7c9cbc91e660c9598012733237be358792629d/packages/react-headless/src/store/createChatStore.ts#L209

is not respecting the ag-ui protocol and hence the issue


I am just few hours old with your framework (and even with ag-ui as such) so chances of misunderstanding are there.

Thanks again!

Regards
Kapil

Ngôn ngữ chính
TypeScript
Star
10k
Fork
698
Merge trung bình
1 ngày 6 giờ
Pull request đã merge (30 ngày)
158

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của thesysdev/openui

Tất cả issue của thesysdev/openui

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.