fix(gateway,channelbridge,turnreply): p 标签半包写入侧规整(修「整条塌成一段」)
裁定(已发安卓):**能修**,走**写入侧规整** —— 不指望模型输出、不动客户端。 - 新增 internal/runtime/turnreply/paragraph.go 的 NormalizeParagraphs: 把未被 <p> 包裹的段落补上 <p>(按空行分段;<action>/<narration> 段也包进 <p>, 与正确形态 <p><action>…</action>…</p> 一致) - **幂等**守门断言:已完全包裹的文本逐字不变(防二次加工) - 落点覆盖 Web 与 IM 两条落库路径(gateway/session_turn_reply.go、channelbridge/turnreply.go、 proactive.go)⇒ 两边共用同一份规整文本 ⇒ **历史一次性变好、两个客户端零改动**、渲染口径不分叉 (测试与变异详见切片报告)
This commit is contained in:
1 parent
d532eb3fcd
commit
5de708a560
17 files changed
+721
-46
No files matched your search
@@ -280,8 +280,8 @@ func TestWSInboundChatDrivesOwnerTurn(t *testing.T) {
|
||||
if got[0].Role != history.RoleUser || got[1].Role != history.RoleAssistant {
|
||||
t.Fatalf("persisted roles = %q, %q, want user then assistant", got[0].Role, got[1].Role)
|
||||
}
|
||||
if got[1].Content != "reply" {
|
||||
t.Fatalf("persisted reply = %q, want the runner's text", got[1].Content)
|
||||
if got[1].Content != storedParagraph("reply") {
|
||||
t.Fatalf("persisted reply = %q, want the runner's text in its canonical (paragraph-wrapped) form", got[1].Content)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user