Skip to content

TokenRouter 0.1.288

Choose a tag to compare

@github-actions github-actions released this 21 Sep 15:14
· 330 commits to main since this release

AI API Gateway Platform - 将 AI 订阅配额分发和管理

  • 上游在 SSE 事件中途断连(HTTP/2 client connection lost、连接被 reset 等)时,网关不再把"没有换行结尾的半截帧"透传给客户端,也不再把随后补发的合成错误帧粘进同一个 SSE 事件
  • 修复前:客户端收到的 data 是两个 JSON 挤在一个字段,严格客户端(如 opencode)报 Invalid ... stream event 并中断整轮对话
  • 修复后:客户端只收到完整事件 + 一个独立错误事件,能读到真实原因(如 Upstream response stream was interrupted)
  • 共享 SSE scanner 丢弃未以换行结束的残行并记录 droppedFragment;raw Chat Completions 路径把该信号补回截断判定,只收到残行的请求仍按上游截断处理,不会退化成 200 成功
  • 注入合成错误帧前补 SSE 事件边界空行(对齐上游 TokenFlux#1479 的做法),仅在本请求已写出响应体字节时补,避免流首多出空事件
  • 新增 6 个回归测试并做变异校验(去掉修复即失败,并复现线上畸形帧);同步 Project Doc 流式边界不变量

📥 Installation

Docker:

# GitHub Container Registry
docker pull ghcr.io/yegetables/tokenrouter:0.1.288

One-line install (Linux):

curl -sSL https://raw.githubusercontent.com/yegetables/TokenRouter/main/deploy/install.sh | sudo bash

Manual download:
Download the appropriate archive for your platform from the assets below.

📚 Documentation