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

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
重构
描述清晰度
基本清楚
活跃度
活跃
技术栈
go, node.js, typescript
领域
backend, devtools

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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.
主要语言
Go
星标
5
派生
0
平均合并
21 小时 13 分钟
30 天内合并 PR
53

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

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

nebari-dev/tapas 的其他 Issue

查看 nebari-dev/tapas 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

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