@@ -2228,21 +2228,25 @@ describe("compaction-safeguard double-compaction guard", () => {
22282228 const compaction = expectCompactionResult ( result ) ;
22292229 expect ( compaction . summary ) . toContain ( "branch summary" ) ;
22302230 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+ ) ;
22442242 } ) ,
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 ) ;
22462250 } ) ;
22472251
22482252 it ( "continues when messages include real conversation content" , async ( ) => {
0 commit comments