+func TestPromptEndsWithTheInstructions(t *testing.T) {
+ text := prompt("Ada", "\nI am Lena. Keep replies short.\n\n")
+ require.Contains(t, text, `Do the user's tasks yourself, with your tools, following the user's instructions
+at the end of this prompt: who they are, how their files are organized and how
+they want work done.`)
+ require.True(t, strings.HasSuffix(text, "\n\n# The user's instructions\n\nI am Lena. Keep replies short."))
+}
+
+func TestPromptWithoutInstructionsHasNoClause(t *testing.T) {
+ for _, instructions := range []string{"", " \n\t"} {
+ text := prompt("Ada", instructions)
+ require.Contains(t, text, "Do the user's tasks yourself, with your tools.\n")
+ require.NotContains(t, text, "instructions")
+ }
+}
+