Repository navigation
Description
Feature hasn't been suggested before.
- I have verified this feature hasn't been implemented and has no open request. Older related requests (How to globally set the language for model thinking and answering #9610, [FEATURE]:Proposal for Configuration-Based Three-Tier Language Internationalization in OpenCode #15800, Feature request: preferred language setting #24302, System prompts force ASCII-only output, breaking support for non-English languages #12609) were closed without implementation (mostly by the 60-day inactivity bot), so this is a follow-up with a concrete use case.
What I'm requesting
A first-class way to pin the model's reasoning and output language. This is not about UI i18n — the UI already has Language settings; the model side has nothing.
Today the built-in system prompt, tool descriptions, and agent scaffolding are English-only. Even when I work entirely in Chinese, the model's internal reasoning comes out English or heavily mixed (EN / 中文 interleaved). This is not cosmetic: when the model reasons in English and then writes Chinese, the prose carries translationese — stiff syntax, weakened rhythm, lost voice.
I write Chinese fiction with opencode (chapter by chapter, with custom agents and skills). English reasoning noticeably degrades the quality of the Chinese prose, and this is currently the biggest bottleneck for this use case.
Why current workarounds are not enough
- The commonly suggested workaround (global
AGENTS.md, e.g. "always think and answer in Chinese") only partially helps. The English built-in scaffolding still dominates, and reasoning remains mixed. Another user reported the same outcome in How to globally set the language for model thinking and answering #9610: "it works, sort of… there is a price to pay for mixing languages." - Custom agent prompts carrying the same instruction: same partial effect.
- There is no config that reliably anchors the reasoning language.
Proposed solution
-
Add a model-side language preference in the config, e.g.:
// opencode.json "language": "zh-CN" // and/or per-agent `language`
When set, opencode injects a strong anchoring instruction into the system prompt for every agent/model, e.g.:
Think and answer in Chinese. Keep your internal reasoning in Chinese; do not switch to English.
Placement matters — as its own top-level section, so it reliably out-prioritizes the rest of the prompt.
-
Extend the existing Desktop Language setting so it also anchors the model side by default — one place to manage UI + model language.
-
Longer term: localized variants of the core system prompts (the app-side i18n infrastructure already exists).
Related
- How to globally set the language for model thinking and answering #9610 — How to globally set the language for model thinking and answering (closed by inactivity bot; community answer was the AGENTS.md workaround)
- [FEATURE]:Proposal for Configuration-Based Three-Tier Language Internationalization in OpenCode #15800 — three-tier language i18n proposal, incl. an
llm.outputLanguagetier (closed by inactivity bot) - Feature request: preferred language setting #24302 — preferred language setting (closed on a template technicality)
- System prompts force ASCII-only output, breaking support for non-English languages #12609 — system prompts force ASCII-only output, breaking non-English languages (closed by inactivity bot; complaints continued until closure)
- [FEATURE]:Native provider support and specialized system prompts for domestic LLMs (DeepSeek, Qwen, GLM) #46366 — native provider support / specialized system prompts for domestic LLMs
- [bug] Sub-agents always output in English regardless of user's language #33084 — sub-agents always output in English regardless of user's language
- The model gives slower, more absurd answers than before and the language problem #46834, opencode jumping into a difference language -- How do I fix it? #25130, Agent falls into runaway self-referential loops in reasoning, wasting tokens and mixing languages #46249 — language contamination / mixing reports
Environment / symptoms
- Model:
opencode-go/deepseek-v4.1-flash(the behavior generalizes to other models) - Symptom: reasoning blocks are EN / 中文 mixed; the resulting Chinese text reads like a back-translation of the English thoughts.
- Affects both TUI and Desktop.
Activity
xvcezrqpbxtpzblrt commentedon Oct 4, 2026
Adding audit data to this request rather than restating it. All findings below were read from tag
v2.0.22, not from thedevbranch.1. The directive exists in 1 of the 6 built-in model prompts. Auditing
packages/core/src/plugin/system-prompt/atv2.0.22:kimi.txttrinity.txtmeta.txtgpt-astra.txtgpt.txtanthropic.txtSo "English-only built-in prompts" is slightly off for V2: the directive was written for one model family and never propagated to the others.
kimi.txt:19— "When responding to the user, you MUST use the SAME language as the user, unless explicitly instructed to do otherwise." — is the wording to reuse.This also predicts a symptom that is hard to explain without this data point: output language is model-dependent, so the same user can get Chinese from one model and English from another with no config change in between. That reads as flakiness until you look at which prompt file was loaded.
2. #12609's root cause is already gone in V2, so what remains is purely the missing directive. The ASCII-only instruction lived in
packages/opencode/src/session/prompt/*.txt. At tagv2.0.22that wholepackages/opencode/tree has 0 entries; V2 prompts live underpackages/core/src/plugin/system-prompt/, and none of the six mention ASCII. The remaining work is therefore not "stop forcing ASCII" — that is done — it is "add the language directive everywhere".3. The pattern already exists in the codebase.
packages/core/src/plugin/agent.ts:40—you MUST use the same language as the user message you are summarizing— is already used for session titles and compaction. Same wording, already accepted, applied to the auxiliary prompts but not to the main one.4. The subagent half is currently unowned.
packages/core/src/tool/plugin/subagent.tscarries no language directive and does not receive the parent session's language. #33084 was closednot_plannedin June, so nothing currently tracks that path.5. The config surface is empty (verified against the V2 config reference). No documented field relates to model output language.
agents.<name>.systemandAGENTS.mdare the only levers — which is exactly why the recurring community answer is "write it in your globalAGENTS.md", the workaround this request wants to retire. Point 2 of the proposal (folding the existing Desktop Language setting into the model side) would give it a single home; a top-level"language": "zh-CN"inopencode.jsonwould also make it testable per session.Applying an existing line to six files is a much smaller change than adding a new config concept, and would stop the model-dependence in (1) immediately.
Dante-dan commentedon Oct 4, 2026
I propose an opt-in response-language preference in config, with a per-agent override, rather than tying model output to the Desktop UI locale.
The prompt audit above points to a broader integration issue: the provider prompt plugins can replace the base system prompt. Adding a directive only to the base prompt would therefore miss several model paths.
The suggested same-language line is useful for following the user’s current message, but a persisted preference would also support a Chinese writing session whose task instructions or source material happen to be English. A bounded first version could work as follows:
I would keep UI-locale synchronization and translated copies of all system prompts out of this first change. After approval, validation would cover config precedence, unchanged prompts when unset, parent/child inheritance and child overrides, and assembled prompts across provider overrides, append mode and custom prompts. Model adherence, including the reported mixed-language reasoning blocks, would still need separate behavioral checks; this setting could express the preference but could not guarantee a provider’s hidden reasoning language.
Could the core team approve the config and per-agent preference scope? Since #33084 was closed, should this design also carry the resolved preference into child sessions as above, or keep inheritance outside this change?
xvcezrqpbxtpzblrt commentedon Oct 5, 2026
Consolidating here rather than leaving a second open thread on the same topic. I opened #53274 for the prompt-file audit, then found this issue already covers the ask; the count in that thread's first comment was wrong and is corrected at the bottom of this comment.
Exhaustive prompt enumeration at
v2.0.22(commit527f0b93)Enumerated by walking the full git tree (
git/trees/v2.0.22?recursive=1), not by eyeballing the directory, then scanning every prompt/instruction file forsame language:Carries the rule — 2 of 15
packages/core/src/plugin/system-prompt/kimi.txtpackages/core/src/plugin/agent.tsLacks the rule — 13 of 15
plugin/command/review.txt/reviewcommand promptplugin/command/initialize.txt/initcommand promptplugin/system-prompt/trinity.txtplugin/skill/report.mdplugin/skill/opencode.mdplugin/system-prompt/meta.txtplugin/system-prompt/gpt-astra.txtplugin/system-prompt/gpt.txttool/patch.txtpatchtool instruction templatesession/runner/prompt/system.txtplugin/system-prompt/anthropic.txtPROMPT_EXPLORE(insideplugin/agent.ts)exploresubagent promptThe two that carry it are the two a user never sees: one model family, and the hidden
title/summarymaintenance agents. That is why a session title can come out in the user's language while the body of the same session comes out in English.Two mechanisms worth separating
/reviewfightsAGENTS.mdinstead of merely missing it.append()inpackages/core/src/plugin/command.ts:The 100 lines of
review.txtbecome the start of the user message, not part of the system prompt whereAGENTS.mdrules live. So the documented workaround from #2594 — a globalAGENTS.mdsaying "always respond in Chinese" — is competing with 100 lines of English-only instructions sitting in the highest-salience position of the request.AGENTS.mdworks in an ordinary conversation (#2594's reporter confirmed it) and does not reliably win that position.The
generalsubagent has no prompt of its own at all. Inpackages/core/src/plugin/agent.tsit gets name, description, mode and permissions — noitem.system. There is no place for a language instruction to live.exploredoes getPROMPT_EXPLORE, and that one is English-only too.What I am still asking for here, separated out
Two different fixes, and the cheap one does not need this issue:
kimi.txt:19into one shared fragment and compose it into the 13 prompts listed above,PROMPT_EXPLOREand the built-in subagents included. This is a consistency fix inside files that already ship, and it changes nothing for anyone who writes in English.I am not claiming the two are urgent. #2594 already showed the global-
AGENTS.mdroute works, and I would rather state that plainly than pretend the user is stuck.Correction
#53274's first comment says "12 prompt files scanned" and its body says "2 of the 12". Both are wrong — that was the row count of a table I had drawn by hand from a partial directory scan, not an enumeration. The correct denominator is 14 files / 15 prompts, 2 carrying the rule. The conclusion does not change and the gap is slightly larger than I first reported. Full enumeration method is above so it can be re-run.
opencodejr commentedon Oct 28, 2026
Thanks for the detailed write-up and the concrete use case. You're asking for a model-side language preference (in config, per agent, and/or linked to the Desktop Language setting) that reliably keeps the model's reasoning and output in Chinese, because the English-only built-in prompts lead to mixed reasoning and stiff, translated-sounding prose. The maintainers will consider it.
Related issues (all closed as not planned):
In the meantime, a small plugin can do the main part of what you describe. It adds a language instruction as the first section of the system prompt on every request, ahead of the built-in English prompt. The
contexthook it uses runs on every agent request, so it should also apply to subagents. I wrote it against the v2 plugin API and it type-checks, but I haven't tested it in a running OpenCode:Save it in one of those
plugins/folders and restart OpenCode. You can writeINSTRUCTIONitself in Chinese (for example请始终用简体中文思考和回答,推理过程也保持中文,不要切换到英文。), which may anchor the model even more strongly.Limits: this can't translate the built-in prompts or tool descriptions, and it can't read the Desktop Language setting. It also can't guarantee what a model does inside its reasoning, so results will still vary by model.