@@ -37,8 +37,6 @@ describe("llmDialog", () => {
3737 apiUrl : new URL ( import . meta. url ) ,
3838 storageManager,
3939 } ) ;
40- // Use push mode for llmDialog tests
41- runtime . scheduler . disablePullMode ( ) ;
4240 tx = runtime . edit ( ) ;
4341
4442 const { commontools } = createBuilder ( ) ;
@@ -156,11 +154,8 @@ describe("llmDialog", () => {
156154 const result = runtime . run ( tx , testRecipe , { } , resultCell ) ;
157155 tx . commit ( ) ;
158156
159- // Wait for initial processing (if any)
160- await runtime . idle ( ) ;
161-
162157 // Get the addMessage handler
163- const addMessage = result . key ( "addMessage" ) . get ( ) ;
158+ const addMessage = await result . key ( "addMessage" ) . pull ( ) ;
164159
165160 // Send initial message
166161 addMessage . send ( {
@@ -302,9 +297,7 @@ describe("llmDialog", () => {
302297 const result = runtime . run ( tx , testRecipe , { } , resultCell ) ;
303298 tx . commit ( ) ;
304299
305- await runtime . idle ( ) ;
306-
307- const addMessage = result . key ( "addMessage" ) . get ( ) ;
300+ const addMessage = await result . key ( "addMessage" ) . pull ( ) ;
308301
309302 // Send initial message
310303 addMessage . send ( {
@@ -323,7 +316,7 @@ describe("llmDialog", () => {
323316 expect ( toolCalled ) . toBe ( true ) ;
324317
325318 // Verify the conversation history
326- const messages = result . key ( "messages" ) . get ( ) ! ;
319+ const messages = ( await result . key ( "messages" ) . pull ( ) ) ! ;
327320 expect ( messages ) . toHaveLength ( 4 ) ;
328321 expect ( messages [ 1 ] . role ) . toBe ( "assistant" ) ;
329322 const content = messages [ 1 ] . content as any [ ] ;
@@ -437,9 +430,7 @@ describe("llmDialog", () => {
437430 const result = runtime . run ( tx , testRecipe , { } , resultCell ) ;
438431 tx . commit ( ) ;
439432
440- await runtime . idle ( ) ;
441-
442- const addMessage = result . key ( "addMessage" ) . get ( ) ;
433+ const addMessage = await result . key ( "addMessage" ) . pull ( ) ;
443434
444435 // Send message to trigger pin
445436 addMessage . send ( {
@@ -451,7 +442,7 @@ describe("llmDialog", () => {
451442 await expect ( waitForMessages ( result , 4 ) ) . resolves . toBeUndefined ( ) ;
452443
453444 // Verify pinned cells
454- const pinnedCells = result . key ( "pinnedCells" ) . get ( ) ;
445+ const pinnedCells = await result . key ( "pinnedCells" ) . pull ( ) ;
455446 expect ( pinnedCells ) . toBeDefined ( ) ;
456447 expect ( Array . isArray ( pinnedCells ) ) . toBe ( true ) ;
457448 expect ( pinnedCells ?. length ) . toBe ( 1 ) ;
@@ -607,9 +598,7 @@ describe("llmDialog", () => {
607598 const result = runtime . run ( tx , testRecipe , { } , resultCell ) ;
608599 tx . commit ( ) ;
609600
610- await runtime . idle ( ) ;
611-
612- const addMessage = result . key ( "addMessage" ) . get ( ) ;
601+ const addMessage = await result . key ( "addMessage" ) . pull ( ) ;
613602
614603 // First pin a cell
615604 addMessage . send ( {
@@ -621,7 +610,7 @@ describe("llmDialog", () => {
621610 await expect ( waitForMessages ( result , 4 ) ) . resolves . toBeUndefined ( ) ;
622611
623612 // Verify cell was pinned
624- let pinnedCells = result . key ( "pinnedCells" ) . get ( ) ;
613+ let pinnedCells = await result . key ( "pinnedCells" ) . pull ( ) ;
625614 expect ( pinnedCells ?. length ) . toBe ( 1 ) ;
626615 expect ( pinnedCells ?. [ 0 ] . path ) . toBe ( cellPath ) ;
627616
@@ -635,7 +624,7 @@ describe("llmDialog", () => {
635624 await expect ( waitForMessages ( result , 8 ) ) . resolves . toBeUndefined ( ) ;
636625
637626 // Verify pinned cells is now empty
638- pinnedCells = result . key ( "pinnedCells" ) . get ( ) ;
627+ pinnedCells = await result . key ( "pinnedCells" ) . pull ( ) ;
639628 expect ( pinnedCells ) . toBeDefined ( ) ;
640629 expect ( Array . isArray ( pinnedCells ) ) . toBe ( true ) ;
641630 expect ( pinnedCells ?. length ) . toBe ( 0 ) ;
@@ -714,9 +703,7 @@ describe("llmDialog", () => {
714703 const result = runtime . run ( tx , testRecipe , { } , resultCell ) ;
715704 tx . commit ( ) ;
716705
717- await runtime . idle ( ) ;
718-
719- const addMessage = result . key ( "addMessage" ) . get ( ) ;
706+ const addMessage = await result . key ( "addMessage" ) . pull ( ) ;
720707
721708 // Send message
722709 addMessage . send ( {
@@ -728,7 +715,7 @@ describe("llmDialog", () => {
728715 await expect ( waitForMessages ( result , 2 ) ) . resolves . toBeUndefined ( ) ;
729716
730717 // Verify context cells appear in pinnedCells output
731- const pinnedCells = result . key ( "pinnedCells" ) . get ( ) ;
718+ const pinnedCells = await result . key ( "pinnedCells" ) . pull ( ) ;
732719 expect ( pinnedCells ) . toBeDefined ( ) ;
733720 expect ( Array . isArray ( pinnedCells ) ) . toBe ( true ) ;
734721 expect ( pinnedCells ?. length ) . toBe ( 1 ) ;
@@ -850,9 +837,7 @@ describe("llmDialog", () => {
850837 const result = runtime . run ( tx , testRecipe , { } , resultCell ) ;
851838 tx . commit ( ) ;
852839
853- await runtime . idle ( ) ;
854-
855- const addMessage = result . key ( "addMessage" ) . get ( ) ;
840+ const addMessage = await result . key ( "addMessage" ) . pull ( ) ;
856841
857842 // Send message to trigger pin
858843 addMessage . send ( {
@@ -864,7 +849,7 @@ describe("llmDialog", () => {
864849 await expect ( waitForMessages ( result , 4 ) ) . resolves . toBeUndefined ( ) ;
865850
866851 // Verify pinnedCells output contains both context cell and tool-pinned cell
867- const pinnedCells = result . key ( "pinnedCells" ) . get ( ) ;
852+ const pinnedCells = await result . key ( "pinnedCells" ) . pull ( ) ;
868853 expect ( pinnedCells ) . toBeDefined ( ) ;
869854 expect ( Array . isArray ( pinnedCells ) ) . toBe ( true ) ;
870855 expect ( pinnedCells ?. length ) . toBe ( 2 ) ;
0 commit comments