Skip to content

Keep replies in the configured language - #764

Closed
igorcosta wants to merge 1 commit into
mainfrom
fix/response-language-precedence
Closed

igorcosta wants to merge 1 commit into
mainfrom
fix/response-language-precedence

Conversation

@igorcosta

Copy link
Copy Markdown
Contributor

Problem

Models replied in Brazilian Portuguese for a user whose ui.locale is en. Turn reflection had saved the user memory "Igor communicates in Portuguese; respond in Portuguese by default…", and buildLocaleInstruction('en') returned an empty string, so the memory was the only language guidance in the prompt.

Change

  • buildLocaleInstruction states the configured language for every locale, English included, and says it overrides any remembered language preference.
  • Memory extraction is told never to save reply-language preferences, and drops memories tagged language/locale or phrased as "respond/reply/communicate … in ".

Verification

  • New tests failed before the change; i18n and memory suites: 217 pass.
  • tsc --noEmit clean. Full suite: 13957 pass; 5 failures in compiled-binary and FeedbackSurveyLine tests fail identically without this change.

Existing bad memories stay on disk; with this change they no longer override the configured language.

Turn reflection saved "respond in Portuguese" as a user memory, and English
added no language instruction, so that memory silently overrode ui.locale = en.
State the configured language for every locale, make it override remembered
language preferences, and never save reply-language memories.
@igorcosta

Copy link
Copy Markdown
Contributor Author

Landed on main as 161d90c (same commit, replayed onto the 0.9.12 line to keep history linear). The earlier red checks were Actions being locked for billing on 17 November, not test failures; the full proof was run locally on the combined branch before pushing.

@igorcosta igorcosta closed this Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant