Skip to content

fix(language): anchor responses to the user's language by default - #55

Merged
savass33 merged 1 commit into
mainfrom
fix/language-anchor-mirror
Sep 14, 2026
Merged

savass33 merged 1 commit into
mainfrom
fix/language-anchor-mirror

Conversation

@savass33

Copy link
Copy Markdown

Summary

  • Models (GLM-5.3, deepseek-v4.x-flash) occasionally drifted to the wrong language (e.g. Spanish replies in pt-BR sessions) because no language directive was injected unless the user set settings.language.
  • Now every system prompt path — including the CLAUDE_CODE_SIMPLE early-return — injects a locale-agnostic section: "Always respond in the same language as the user's most recent message…".
  • The explicit settings.language override is preserved (fixed-language behavior for those who want it); the picker hint now reads "Leave empty to respond in the user's language".
  • Wording is identical to the Conversation-side anchor (generative-dialog-manager-go) for single-source maintenance.
  • Version bump to 0.15.25.

Context

Root cause was verified across providers/router/CLI: nothing pinned or injected language anywhere. Model-side drift (DeepSeek V4 lost output-language self-monitoring; GLM-5.3 mixed languages) fills the gap when no anchor exists. Locale-agnostic by design — Verboo Code is international; no hardcoded locale.

Test plan

  • New suite src/constants/languageAnchor.test.ts — 8 tests: default mirror injection, no-undefined leak, locale-agnostic (no pinned language), explicit override (verbatim + suppresses mirror), simple-mode anchor (unset + override), technical-terms exemption
  • bun test src/constants/ — 15 pass / 0 fail (incl. pre-existing promptIdentity suite)
  • Full bun test compared with/without patch (stash): 0 new failures, 0 regressions (76 pre-existing failures unchanged)
  • Manual A3: pt→en→pt mirror transitions behave; override requires CLI restart (known per-process cache)

🤖 Generated with Verboo Code

Models occasionally drifted to the wrong language (e.g. Spanish replies in
pt-BR sessions) because no language directive existed unless the user set
settings.language. Now every system prompt path — including CLAUDE_CODE_SIMPLE
mode — injects a locale-agnostic 'respond in the language of the user's most
recent message' section, while the explicit settings.language override is
preserved for users who want a fixed language.

Bumps version to 0.15.25.

Co-Authored-By: Verboo Code <noreply@code.verboo.ai>
@savass33
savass33 merged commit 01c42af into main Sep 14, 2026
22 checks passed
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