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

未关闭
#613 3 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@abhithesys 已经在做这个了。

开始于 2026年6月8日。

评估

这个 Issue 还没有评估数据。

描述

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

主要语言
TypeScript
星标
10k
派生
698
平均合并
1 天 6 小时
30 天内合并 PR
158

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

thesysdev/openui 的其他 Issue

查看 thesysdev/openui 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。