Skip to content

fix(rpc): 修复 U+2028/U+2029 拆断 NDJSON 导致会话超时 - #557

Merged
vastsa merged 3 commits into
mainfrom
merge/pr-553
Sep 17, 2026
Merged

vastsa merged 3 commits into
mainfrom
merge/pr-553

Conversation

@vastsa

@vastsa vastsa commented Sep 17, 2026

Copy link
Copy Markdown
Owner

问题与修复

Closes #548
Lands #553

会话内容含 U+2028 / U+2029 时,Node readline 会把一条合法 JSON 消息拆开,造成 session.get / agent.prompt 超时。本分支保留 #553 的 LF 分帧读取器,并补上落地加固:

  • 读取器单测改到 packages/shared,不再从 desktop 直接 import .ts
  • 契约测试锁死三条 Node RPC 读口不得再用 readline
  • 中文 spec / E2E 文档与英文对齐

验证

  • packages/shared ndjson 单测 5/5
  • desktop rpc-lifecycle-contract 14/14
  • pnpm test:e2e:rpc-unicode 通过(真实 HostProcess/AgentSidecar,隔离存储,本地 fixture 模型)
  • pnpm docs:check 通过

候选版本

  • Task/PR candidate: 见本 PR head(已 rebase 到当前 origin/main
  • Environment: macOS arm64 / Node 24;host-core 使用已有 debug 二进制(Rust 未改)

zszz3 and others added 3 commits September 18, 2026 01:04
Read stdio frames at LF boundaries so valid Unicode text cannot split
requests or responses and strand their pending RPCs. Share the reader
across all three Node transport inputs and clean up on teardown.

Cover UTF-8 chunk boundaries and the real host/sidecar persistence and
prompt paths using isolated storage and a loopback provider.

fixes #548
Keep the translated specification structure and E2E traceability table aligned with the authoritative transport contract.
Keep the Unicode-separator transport fix. Run the reader tests through
the shared package compiler instead of importing TypeScript from desktop,
translate the zh-CN framing notes, and reject readline regressions on
the three Node stdio RPC paths.
Copilot AI lite review requested due to automatic review settings September 17, 2026 17:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@vastsa
vastsa merged commit 2f22f6c into main Sep 17, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants