test: check compaction branch summary input · openclaw/openclaw@e6b32e6
shakkernerd
·
2026-05-12
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -2201,22 +2201,21 @@ describe("compaction-safeguard double-compaction guard", () => {
|
2201 | 2201 | const compaction = expectCompactionResult(result); |
2202 | 2202 | expect(compaction.summary).toContain("branch summary"); |
2203 | 2203 | expect(compaction.summary).not.toContain("No prior history."); |
2204 | | -expect(mockSummarizeInStages).toHaveBeenCalled(); |
2205 | | -const summaryCall = mockSummarizeInStages.mock.calls[0]?.[0]; |
2206 | | -const summaryMessages = summaryCall?.messages ?? []; |
2207 | | -const cronRequest = summaryMessages.find( |
2208 | | -(message) => |
2209 | | -message.role === "custom" && |
2210 | | -"customType" in message && |
2211 | | -message.customType === "cron-request", |
2212 | | -) as { content?: unknown } | undefined; |
2213 | | -expect(cronRequest?.content).toBe("prepare the daily report"); |
2214 | | -expect( |
2215 | | -summaryMessages.some( |
2216 | | -(message) => |
2217 | | -message.role === "toolResult" && "toolName" in message && message.toolName === "read", |
2218 | | -), |
2219 | | -).toBe(true); |
| 2204 | +expect(mockSummarizeInStages).toHaveBeenCalledWith( |
| 2205 | +expect.objectContaining({ |
| 2206 | +messages: expect.arrayContaining([ |
| 2207 | +expect.objectContaining({ |
| 2208 | +role: "custom", |
| 2209 | +customType: "cron-request", |
| 2210 | +content: "prepare the daily report", |
| 2211 | +}), |
| 2212 | +expect.objectContaining({ |
| 2213 | +role: "toolResult", |
| 2214 | +toolName: "read", |
| 2215 | +}), |
| 2216 | +]), |
| 2217 | +}), |
| 2218 | +); |
2220 | 2219 | }); |
2221 | 2220 | |
2222 | 2221 | it("continues when messages include real conversation content", async () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。