



















@@ -68,14 +68,24 @@ describe("guardSessionManager integration", () => {
6868.getEntries()
6969.filter((e) => e.type === "message")
7070.map((e) => (e as { message: AgentMessage }).message);
71-const serialized = JSON.stringify(messages);
727173-expect(serialized).not.toContain("the email is peter@dc.io");
74-expect(serialized).not.toContain("contact peter@dc.io");
75-expect(serialized).not.toContain("peter@dc.io\\n");
76-expect(serialized).toContain('"thinking":"the email is peter@d***.io"');
77-expect(serialized).toContain('"text":"contact peter@d***.io"');
78-expect(serialized).toContain('"text":"peter@d***.io\\n"');
79-expect(serialized).toContain('"/tmp/peter@dc.io"');
72+expect(messages).toEqual([
73+{
74+role: "assistant",
75+content: [
76+{ type: "thinking", thinking: "the email is peter@d***.io", thinkingSignature: "sig" },
77+{ type: "text", text: "contact peter@d***.io" },
78+{ type: "toolCall", id: "call_1", name: "read", arguments: { path: "/tmp/peter@dc.io" } },
79+],
80+stopReason: "toolUse",
81+},
82+{
83+role: "toolResult",
84+toolCallId: "call_1",
85+toolName: "read",
86+content: [{ type: "text", text: "peter@d***.io\n" }],
87+isError: false,
88+},
89+]);
8090});
8191});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。