From d01594051950596c1a9a3f4bfa8efccef9bc64d5 Mon Sep 17 00:00:00 2001 From: uschtwill Date: Sat, 10 Oct 2026 08:31:42 +0100 Subject: [PATCH] fix(prime): point the memory elision banner at bd recall The banner bd prime prints when a cap hides memories told agents to "recall one with `bd remember `". With a single argument, bd remember stores a new memory whose content is the key, so an agent that follows the hint writes junk instead of reading. bd recall is the read verb. Co-Authored-By: Claude Opus 5.5 --- cmd/bd/prime.go | 2 +- cmd/bd/prime_memory_caps_test.go | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/bd/prime.go b/cmd/bd/prime.go index f314fcb4a..d564026fb 100644 --- a/cmd/bd/prime.go +++ b/cmd/bd/prime.go @@ -704,7 +704,7 @@ func renderPrimeMemories(memories map[string]string, compact bool, maxCount, max } sb.WriteString("Stored via `bd remember`. Update in place with `bd remember --key \"new content\"`. Search with `bd memories `. Remove with `bd forget `.\n\n") if elided > 0 { - sb.WriteString(fmt.Sprintf("> %d more memories are not shown here (%s). Browse the full set with `bd memories ` or recall one with `bd remember `.\n\n", elided, primeMemoryCapNote(noteCount, noteChars))) + sb.WriteString(fmt.Sprintf("> %d more memories are not shown here (%s). Browse the full set with `bd memories ` or read one in full with `bd recall `.\n\n", elided, primeMemoryCapNote(noteCount, noteChars))) } } for _, entry := range entries { diff --git a/cmd/bd/prime_memory_caps_test.go b/cmd/bd/prime_memory_caps_test.go index 20a1b0fcb..a348c4ec9 100644 --- a/cmd/bd/prime_memory_caps_test.go +++ b/cmd/bd/prime_memory_caps_test.go @@ -46,6 +46,9 @@ func TestRenderPrimeMemoriesCountCap(t *testing.T) { if strings.Contains(out, "### mem-02\n") { t.Fatalf("memory beyond the cap leaked into output: %q", out) } + if !strings.Contains(out, "read one in full with `bd recall `") || strings.Contains(out, "recall one with `bd remember") { + t.Fatalf("elision banner must point at bd recall, not bd remember (which writes a new memory): %q", out) + } if banner, entries := strings.Index(out, "not shown"), strings.Index(out, "### mem-00"); banner > entries { t.Fatalf("elision banner must precede entries so host truncation cannot hide it: %q", out) }