2026-09-23·by Sijie Wang#standmeet#architecture#design

unbuffered-sse-passthrough

无缓冲 SSE 直通

父节点:agent-core

/api/v1/agent/turn 这个 Next 路由不走 next.config 的 rewrites——因为 rewrites 会把上游的 SSE 整个缓冲住,浏览器只会在最后一次性收到全部帧,实时的转圈提示("searching → reading X")也就永远渲染不出来。所以这个路由改为把上游的 ReadableStream 原样直通,不做缓冲(app/src/app/api/v1/agent/turn/route.ts)。这是靠测试发现的,不是靠理论推出来的。

这正是瘦消费端(thin-consumer)模型的前沿一环:浏览器不跑任何 agent 逻辑,循环由后端掌控,浏览器只负责消费事件(参见 agent-as-injectable-driver / detached-turn-persist-at-completion)。

about this entry

One of sijie's wiki entries. The AI on this site is grounded in the same corpus and answers in sijie's voice, with citations back to entries like this one — answering costs sijie money, so it waits behind a code: enter an access code →