grep -q "$1" "$work/output"
}
-# The next word has 13 characters. Its preceding line has 60, so the
-# combined line has 74 characters and cannot fit the 72-column limit.
+# The next word has 13 characters. Its preceding line has 60, so the combined
+# line has 74 characters and cannot fit the 72-column limit.
accept <<'MESSAGE'
Reflow comments and expand event literals
ID: whatsappTestAna.String(),
Name: "Ana",
}
+
require.NoError(t, test.messages.routes.Set("whatsapp:"+chat.ID, "Missing"))
whatsappRouteTestAdd(t, inbox, chat, "Please check the plan.")
require.NoError(t, inbox.deliver(t.Context(), test.loops[0], WhatsAppLink{}, true))
ID: whatsappTestAna.String(),
Name: "Ana",
}
+
require.NoError(t, first.messages.routes.Set("whatsapp:"+chat.ID, "Garden"))
whatsappRouteTestAdd(t, inbox, chat, "Keep the gate plan.")
require.NoError(t, inbox.deliver(t.Context(), first.loops[0], WhatsAppLink{}, true))
Name: "Garden plans",
Group: true,
}
+
require.NoError(t, test.messages.routes.Set("whatsapp:"+first.ID, "Garden"))
require.NoError(t, test.messages.routes.Set("whatsapp:"+second.ID, "Garden"))
ID: whatsappTestAna.String(),
Name: "Ana",
}
+
require.NoError(t, test.messages.routes.Set("whatsapp:"+garden.ID, "Garden"))
require.NoError(t, test.messages.routes.Set("whatsapp:"+library.ID, "Library"))
inbox.waitForCatchup()
ID: whatsappTestAna.String(),
Name: "Ana",
}
+
require.NoError(t, first.messages.routes.Set("whatsapp:"+chat.ID, "Garden"))
require.NoError(t, os.Mkdir(first.messages.path, 0o700))
whatsappRouteTestAdd(t, inbox, chat, "Keep the gate plan.")
// grow between batches. The view goes out as the same messages as in the
// request before, while their lines give the same text, and the new lines
// follow as one new message. So the end of the view of each earlier turn stays
-// a message end. On the ChatGPT backend, the first request of a turn with this
-// layout read the view of the turn before from the prompt cache in each of 10
-// turns, and with the view in one message it missed once in 5.
+// a message end. Stable message boundaries let the model reuse the unchanged
+// view prefix from its prompt cache instead of invalidating it when new lines
+// arrive.
//
// The first message starts with "<chat>\n". The closing tag goes into the state
// message after the view, so that no view message changes when lines come. The