test: mine compaction branch messages · openclaw/openclaw@3e425dd
shakkernerd
·
2026-05-13
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -2228,21 +2228,25 @@ describe("compaction-safeguard double-compaction guard", () => {
|
2228 | 2228 | const compaction = expectCompactionResult(result); |
2229 | 2229 | expect(compaction.summary).toContain("branch summary"); |
2230 | 2230 | expect(compaction.summary).not.toContain("No prior history."); |
2231 | | -expect(mockSummarizeInStages).toHaveBeenCalledWith( |
2232 | | -expect.objectContaining({ |
2233 | | -messages: expect.arrayContaining([ |
2234 | | -expect.objectContaining({ |
2235 | | -role: "custom", |
2236 | | -customType: "cron-request", |
2237 | | -content: "prepare the daily report", |
2238 | | -}), |
2239 | | -expect.objectContaining({ |
2240 | | -role: "toolResult", |
2241 | | -toolName: "read", |
2242 | | -}), |
2243 | | -]), |
| 2231 | +expect(mockSummarizeInStages).toHaveBeenCalledTimes(1); |
| 2232 | +const summarizeCall = requireRecord(mockCallArg(mockSummarizeInStages)); |
| 2233 | +const messages = requireArray(summarizeCall.messages); |
| 2234 | +expect( |
| 2235 | +messages.some((message) => { |
| 2236 | +const record = requireRecord(message); |
| 2237 | +return ( |
| 2238 | +record.role === "custom" && |
| 2239 | +record.customType === "cron-request" && |
| 2240 | +record.content === "prepare the daily report" |
| 2241 | +); |
2244 | 2242 | }), |
2245 | | -); |
| 2243 | +).toBe(true); |
| 2244 | +expect( |
| 2245 | +messages.some((message) => { |
| 2246 | +const record = requireRecord(message); |
| 2247 | +return record.role === "toolResult" && record.toolName === "read"; |
| 2248 | +}), |
| 2249 | +).toBe(true); |
2246 | 2250 | }); |
2247 | 2251 | |
2248 | 2252 | it("continues when messages include real conversation content", async () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。