diff --git a/internal/router/threads_test.go b/internal/router/threads_test.go index 2b7aa67..f61d310 100644 --- a/internal/router/threads_test.go +++ b/internal/router/threads_test.go @@ -113,7 +113,7 @@ func TestASystemMessageIsNeverDropped(t *testing.T) { // a forgotten turn — and much harder to spot, because the model keeps // answering. history := []store.Message{ - {Role: "system", Content: "You only answer in Turkish."}, + {Role: "system", Content: "Answer only in the user's own language."}, {Role: "user", Content: strings.Repeat("x", 500)}, {Role: "assistant", Content: strings.Repeat("y", 500)}, } @@ -126,7 +126,7 @@ func TestASystemMessageIsNeverDropped(t *testing.T) { if dropped != 2 { t.Errorf("dropped %d turns, expected both non-system ones", dropped) } - if got := strings.Join(splicedRoles(t, out), "|"); !strings.Contains(got, "only answer in Turkish") { + if got := strings.Join(splicedRoles(t, out), "|"); !strings.Contains(got, "user's own language") { t.Errorf("the system message was dropped: %s", got) } } diff --git a/internal/store/migrations/postgres/0007_memory.sql b/internal/store/migrations/postgres/0007_memory.sql index 49f0541..318bcd0 100644 --- a/internal/store/migrations/postgres/0007_memory.sql +++ b/internal/store/migrations/postgres/0007_memory.sql @@ -29,9 +29,12 @@ CREATE TABLE memory_notes ( -- Touched on every write, so retention measures how long a note has gone -- unrefreshed rather than how old it is. updated_at BIGINT NOT NULL, - -- 'simple' rather than a language configuration: these are an agent's own - -- notes, in whatever language it chose, and stemming English rules over - -- Turkish text would quietly stop finding things. + -- 'simple' rather than a language configuration. These are an agent's own + -- notes, in whatever language it chose, and a deployment does not announce + -- which that is — so any stemmer picked here is the wrong one somewhere. + -- Applying English rules to text that is not English does not fail loudly: + -- it quietly stops finding things, which is the worst way for a search to + -- be wrong. search tsvector GENERATED ALWAYS AS ( to_tsvector('simple', coalesce(key, '') || ' ' || coalesce(text, '') || ' ' || coalesce(tags, '')) ) STORED,