Feature: AG-UI protocol as native gateway endpoint
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- zig
- Lĩnh vực
- api
Hướng nghiên cứu
Start by reading the existing /a2a gateway endpoint and /v1/chat/completions SSE handling; the issue names no source files or tests. Then map the requested AG-UI request fields and SSE events to the existing streaming flow, including the optional gateway toggle and CORS requirement. Done means POST /ag-ui accepts the described request and emits the corresponding AG-UI events.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
Add AG-UI (Agent-UI) protocol support as a native gateway endpoint at POST /ag-ui, similar to the existing /a2a endpoint. AG-UI is a streaming SSE protocol used by platforms like DataRobot, CopilotKit, and others for connecting agent backends to frontend UIs.
Motivation
NullClaw already supports A2A for agent-to-agent communication (#700). AG-UI is the complementary protocol for agent-to-frontend communication. Without native support, users must run a sidecar proxy (~200 lines of Zig) that translates between NullClaw's /v1/chat/completions SSE and AG-UI SSE events. This works but adds unnecessary complexity and an extra process.
We're currently running this exact sidecar in production at DataRobot — a 64KB static Zig binary that translates the protocol. It works well, but the translation is mechanical and would be better handled natively in the gateway.
What AG-UI looks like
POST /ag-ui accepts a JSON body with messages[] (chat history) and threadId, then streams SSE events:
event: RUN_STARTED
data: {"runId":"...","threadId":"..."}
event: TEXT_MESSAGE_START
data: {"messageId":"...","role":"assistant"}
event: TEXT_MESSAGE_CONTENT
data: {"messageId":"...","delta":"Hello"}
event: TEXT_MESSAGE_CONTENT
data: {"messageId":"...","delta":" world"}
event: TEXT_MESSAGE_END
data: {"messageId":"..."}
event: TOOL_CALL_START
data: {"toolCallId":"...","toolCallName":"search_api"}
event: TOOL_CALL_ARGS
data: {"toolCallId":"...","delta":"{\"query\": \"...\"}"}
event: TOOL_CALL_END
data: {"toolCallId":"..."}
event: RUN_FINISHED
data: {"runId":"...","threadId":"..."}
Translation from existing /v1/chat/completions SSE
The mapping is straightforward:
| NullClaw chat completion chunk | AG-UI event |
|---|---|
First chunk with choices[0].delta.role |
TEXT_MESSAGE_START |
choices[0].delta.content |
TEXT_MESSAGE_CONTENT |
choices[0].delta.tool_calls[].function.name |
TOOL_CALL_START |
choices[0].delta.tool_calls[].function.arguments |
TOOL_CALL_ARGS |
choices[0].finish_reason == "tool_calls" |
TOOL_CALL_END |
choices[0].finish_reason == "stop" |
TEXT_MESSAGE_END + RUN_FINISHED |
Proposed implementation
Add AG-UI as a gateway endpoint alongside the existing ones:
/health — existing
/webhook — existing
/a2a — existing (agent-to-agent)
/ag-ui — NEW (agent-to-frontend)
/v1/chat/completions — existing
The implementation would:
- Parse the AG-UI request body → extract messages + threadId
- Forward as a
/v1/chat/completionsrequest internally (streaming) - Translate the streaming chunks to AG-UI SSE events
- Include CORS headers (AG-UI clients are typically browser-based)
Config could reuse the existing gateway config with an optional toggle:
{
"gateway": {
"ag_ui": true
}
}
Reference
- AG-UI Protocol Spec
- CopilotKit AG-UI SDK
- Our working sidecar proxy: ~200 lines of Zig doing this translation — happy to contribute as a starting point for the native implementation
Why this fits NullClaw
NullClaw already has the best multi-protocol gateway story (A2A, MCP client, 19 channels, OpenAI-compatible API). AG-UI is the missing piece for frontend integration. Adding it natively would make NullClaw a complete drop-in backend for any AI-powered UI.
- Ngôn ngữ chính
- Zig
- Star
- 8.1k
- Fork
- 945
- Merge trung bình
- 7 giờ 13 phút
- Pull request đã merge (30 ngày)
- 1
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
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của nullclaw/nullclaw
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
nullclaw/nullclaw#1078 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ci: gate Docker image changes on PRs and before release publishCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
nullclaw/nullclaw#993 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
web_search: Exa rejects requests because Content-Type is sent twice (exa:InvalidResponse)Có thể đã có người làm @Krakazybik đã nhận 2 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 1 ngày
-
tracking: OpenClaw parity PRs for streaming, channel UX and provider reasoning (#1057-#1065)Đang mở
Độ khó 4/5 Hơn một tuần Mức phù hợp với người mới 12/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của nullclaw/nullclaw
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Discovered ports from service discovery are never propagated to modules in Module.load()Có thể đã có người làm @vishalmore90 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
OWASP/Nettacker#1828 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
voidzero-dev/void#677 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
sjkim1127/Reversecore_MCP#363 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
lidge-jun/opencodex#8101 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày