Replies: 3 comments 2 replies
|
I've worked on this - are you seeing a difference? |
|
Key observation LLM reasoning language is a model statistic, not a harness-controlled output. Each reasoning_content token is sampled from P(token | all preceding context), so the language of the output tracks the language composition of the context — not the language of the instructions in it. Two variables dominate:
This is a model characteristic: even a Chinese-native model (DeepSeek V4 is Chinese-first) adapts to the language mixture it is conditioned on. The harness cannot change the model's prior; instructions are only a few dozen tokens of evidence against tens of thousands of English tokens. So under an English-majority context, English reasoning is the expected outcome, and no amount of prompt wording reliably prevents it. |




Uh oh!
There was an error while loading. Please reload this page.
Problem
The system prompt that drives reasoning is ~90% English (
constitution.md, mode prompts, tool descriptions, approval policies, output rules). When a Chinese-speaking user writes in Chinese, the model'sreasoning_contentdefaults to English, then translates back to the final reply — producing unnatural, machine-translated Chinese that is hard to read.Current mitigations are instruction-level patches that cannot outweigh the English context mass:
LOCALE_PREAMBLE_ZH_HANS(crates/tui/src/prompts.rs:795) — a few Chinese paragraphs at the top of the system promptLOCALE_CLOSER_ZH_HANS(crates/tui/src/prompts.rs:831) — reinforcement at the bottomThese were added in response to #732 and #1118, but the core prompt layers themselves were never localized. The scattered instructions are fighting thousands of tokens of English context; the model naturally follows the dominant language.
Proposed solution
When
## Environment.langiszh-Hans, select a Chinese variant of each prompt layer instead of the English default:The prompt builder in
prompts.rsalready has the locale tag available (PromptSessionContext.locale_tag). Eachinclude_str!layer picks its file variant based on the resolved locale. Missing locale variants fall back to the English default — partial localizations are safe.Once all layers are localized,
LOCALE_PREAMBLE_ZH_HANSandLOCALE_CLOSER_ZH_HANSbecome redundant and can be removed in a follow-up.Other locales (ja, pt-BR, vi, etc.) can adopt the same file-convention pattern — no new code paths, just new
.mdfiles.Review requirement
All Chinese prompt files must be reviewed by a native Chinese speaker before merge. Machine-translated prompts defeat the purpose of this feature — the translations must read as natural, professional Chinese that a developer would write to another developer.
Acceptance criteria
reasoning_contentand final reply are both in Chinese without requiring translation mode.Related
All reactions