anomalyco / anomalyco/opencode

[FEATURE]: Language preference for model reasoning & output — English-only built-in prompts degrade Chinese writing quality

Open
#49,889 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Feature hasn't been suggested before.
  • I have verified this feature hasn't been implemented and has no open request. Older related requests (#9610, #15800, #24302, #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 #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
  1. 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.

  2. Extend the existing Desktop Language setting so it also anchors the model side by default — one place to manage UI + model language.

  3. Longer term: localized variants of the core system prompts (the app-side i18n infrastructure already exists).

Related
  • #9610 — How to globally set the language for model thinking and answering (closed by inactivity bot; community answer was the AGENTS.md workaround)
  • #15800 — three-tier language i18n proposal, incl. an llm.outputLanguage tier (closed by inactivity bot)
  • #24302 — preferred language setting (closed on a template technicality)
  • #12609 — system prompts force ASCII-only output, breaking non-English languages (closed by inactivity bot; complaints continued until closure)
  • #46366 — native provider support / specialized system prompts for domestic LLMs
  • #33084 — sub-agents always output in English regardless of user's language
  • #46834, #25130, #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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the opencode.json configuration, the Desktop Language setting, and the built-in system prompt and agent scaffolding mentioned in the issue. Determine how a model-side language preference should apply to every agent/model and whether per-agent overrides are needed; done means the behavior is specified consistently for TUI and Desktop, with the configuration and prompt anchoring covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
ai, developer-experience, internationalization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.