Weigh moving the chat bridge to pi's TypeScript SDK and the AI SDK stream helpers

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

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ó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go, node.js, typescript
Lĩnh vực
backend, devtools

Hướng nghiên cứu

Read the comparison and decision recorded in this issue, then inspect internal/chatbridge and the gateway contract in internal/gateway/chat. The issue lists the existing bridge tests to preserve: streaming, stop, reload, canceled dialogs, pi exiting mid-reply, and idle and extra conversations. If the decision is to move, done means the /api/chat routes and UI still work unchanged and those test cases have equivalents.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Summary

The chat bridge in the chat pod (internal/chatbridge, from #34) runs pi in RPC mode, one process per active conversation, and translates pi's events into the AI SDK's UI message stream in Go. In review of #34, @aktech suggested using pi's TypeScript SDK with the AI SDK's createUIMessageStream instead. This issue is to weigh that move on its own, after #34 and #46 merge.

Motivation

Less code to own. The SDK route would replace the RPC process pool (pi.go, and the pool and its locking in bridge.go), the event translation (translate.go) and the SSE writer: about 1,200 lines of Go, plus their tests. The pool needed a fix for two races in review (72178e2), which an in-process SDK would not have.

What it costs:

  • The bridge becomes a Node service in the chat pod instead of a subcommand of the javo binary.
  • New npm dependencies, through the DEPS rules (exact pins, at least 14 days old, audit clean).
  • The bridge's tests are rewritten, and its contract with the gateway (internal/gateway/chat) must stay the same: routes, error codes, the stream, and refusing the app proxy.

Acceptance criteria

  • A short comparison: lines owned, dependencies added, how conversations are kept and listed, how a reply is stopped, and how memory and processes are bounded per pod.
  • A decision recorded here: move, or keep RPC.
  • If moving: the gateway's /api/chat routes and the UI work unchanged, and the bridge's current tests (streaming, stop, reload, dialogs canceled, pi exiting mid-reply, idle and extra conversations) have equivalents.

Out of scope

  • Changes to the chat UI or the /api/chat contract.
Ngôn ngữ chính
Go
Star
5
Fork
0
Merge trung bình
21 giờ 13 phút
Pull request đã merge (30 ngày)
53

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

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 nebari-dev/tapas

Tất cả issue của nebari-dev/tapas

Issue tương tự

Thêm issue về Go

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.