This commit is contained in:
Wilhelm Uschtrin 2026-10-20 00:29:41 -07:00 • committed by GitHub
commit 6c8381e52f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View file

@ -729,7 +729,7 @@ func renderPrimeMemories(memories map[string]string, compact bool, maxCount, max
}
sb.WriteString("Stored via `bd remember`. Update in place with `bd remember --key <key> \"new content\"`. Search with `bd memories <keyword>`. Remove with `bd forget <key>`.\n\n")
if elided > 0 {
sb.WriteString(fmt.Sprintf("> %d more memories are not shown here (%s). Browse the full set with `bd memories <keyword>` or recall one with `bd remember <key>`.\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 <keyword>` or read one in full with `bd recall <key>`.\n\n", elided, primeMemoryCapNote(noteCount, noteChars)))
}
}
for _, entry := range entries {

View file

@ -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 <key>`") || 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)
}