Skip to content

Built-in prompts inconsistently omit the "answer in the user's language" rule: /review, /init and subagents reply in English to a Chinese conversation #53274

Closed as not planned

Description

@xvcezrqpbxtpzblrt

Description

OpenCode already contains an instruction telling the model to answer in the user's language. At v2.0.22 that sentence lives in exactly two prompts, and neither of them is one a user-facing command or a subagent actually runs under:

Prompt file Lines Has a "same language as the user" rule
packages/core/src/plugin/system-prompt/kimi.txt 95 yes — line 19
packages/core/src/plugin/agent.ts (title/summary agents) 156 yes — line 40
packages/core/src/plugin/system-prompt/trinity.txt 97 no
packages/core/src/plugin/system-prompt/meta.txt 55 no
packages/core/src/plugin/system-prompt/gpt-astra.txt 45 no
packages/core/src/plugin/system-prompt/gpt.txt 39 no
packages/core/src/plugin/system-prompt/anthropic.txt 2 no
packages/core/src/plugin/command/review.txt 100 no
packages/core/src/plugin/command/initialize.txt 65 no
packages/core/src/session/runner/prompt/system.txt 15 no
PROMPT_EXPLORE (inside packages/core/src/plugin/agent.ts) — no

The two that carry it are the two a user never sees: the Kimi model-family prompt, and the hidden title/summary maintenance 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.

1. /review and /init prepend an English-only prompt to the user's message. packages/core/src/plugin/command.ts:

function append(template: string, input: string) {
  const value = input.trim()
  if (template.includes("$ARGUMENTS")) return template.replaceAll("$ARGUMENTS", () => value)
  return [template, value].filter(Boolean).join("\n\n")
}
text: append(PROMPT_REVIEW.replace("${path}", location.project.directory), input.prompt.text),

So all 100 lines of review.txt become the start of the user message, ahead of whatever the user typed. Someone typing /review in a Chinese session sends 100 lines of English-only instructions followed by a Chinese request, and nothing in that prompt mentions output language.

2. The general subagent has no prompt of its own at all. packages/core/src/plugin/agent.ts:

editor.update(Agent.ID.make("general"), (item) => {
  item.name = Agent.Name.make("General")
  item.description = "General-purpose agent for researching complex questions and executing multi-step tasks. ..."
  item.mode = "subagent"
  item.permissions.push(...)
})

There is no item.system, so there is nowhere for a language instruction to live. explore does get one (item.system = PROMPT_EXPLORE), and that prompt is English-only too.

3. Five of the six model-family base prompts do not carry the rule, so on anthropic, gpt, gpt-astra, meta and trinity the model is never told to follow the user's language. The only family that is told is kimi.

Relation to #49889 — that issue asks for a user-facing configuration option to pin the model's language. This one asks for nothing new: the rule already exists in-tree, it is simply not applied to the prompts that actually run. I do not see a need for a config knob for behaviour the built-in prompts should already have.

Suggested fix — hoist the sentence into a single shared fragment and compose it into every prompt in the table above, PROMPT_EXPLORE included. No new user-facing surface and no behaviour change for anyone who writes in English.

Steps to reproduce

Static, which is what I actually ran — tag v2.0.22, commit 527f0b931d1f9b3ebd34e106c51b31ce5db5b075:

for f in packages/core/src/plugin/command/review.txt \
         packages/core/src/plugin/command/initialize.txt \
         packages/core/src/plugin/system-prompt/*.txt \
         packages/core/src/session/runner/prompt/system.txt; do
  printf '%-58s %s\n' "$f" "$(grep -ci 'same language' "$f")"
done
grep -n 'same language' packages/core/src/plugin/agent.ts

Observed: kimi.txt 1 hit, agent.ts line 40, everything else 0.

Behavioural, reported by a Chinese-speaking user on this version and not independently reproduced by me — both steps need the chat UI, which I cannot drive:

  1. In a session where the conversation has been in Chinese, run /review. The review comes back in English.
  2. In the same session, hand a subagent a task. Its answer comes back in English.

For the record, I did see one English subagent answer this session, but my task text was itself written in English with an English report skeleton, so that instance is explained by the input and I am not offering it as evidence of the defect.

Screenshot and/or share link

None — the reproduction is file-level, so the line-level evidence above is the reproduction.

Plugins

None — built-in prompts only.

OpenCode version

2.0.22. The tag resolves directly to commit 527f0b931d1f9b3ebd34e106c51b31ce5db5b075 (checked via the GitHub API).

Operating System

Windows (win32).

Terminal

Windows PowerShell 5.1 (powershell.exe), which is the shell OpenCode spawns on this machine; ACP 936, [Console]::OutputEncoding is gb2312. Every file in the table was fetched from the API and scanned byte-exactly, so console decoding plays no part in the evidence above.

Activity

  1. github-actions commented on Oct 5, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

  2. xvcezrqpbxtpzblrt commented on Oct 5, 2026

    @xvcezrqpbxtpzblrt
    Author

    Checked all three. None of them covers what this reports, but #2594 does settle part of the motivation, so let me be straight about that first.

    #2594 — closed by the reporter after rekram1-node's AGENTS.md suggestion worked. Agreed: a global AGENTS.md is a working answer today, and this issue is not a claim that users have no way to get Chinese output. canomh confirmed it, and I am not asking for anything on that front.

    #33084 — its premise is that sub-agent prompts have no language handling and there is no mechanism to pass the user's language down. At v2.0.22 that premise is no longer accurate: the sentence exists in-tree in two places — packages/core/src/plugin/system-prompt/kimi.txt:19 and packages/core/src/plugin/agent.ts:40 (the title/summary agents). So the rule was written, and it is applied to 2 of the 12 prompt files that ship. That is an omission, not a missing feature, and it is a different fix from #33084's.

    #49889 — asks for a user-facing config knob. This asks for no new surface at all: hoist the existing sentence into one shared fragment and compose it into the prompts that lack it.

    Two things this adds that none of the three report:

    1. AGENTS.md and /review actively compete. append() in packages/core/src/plugin/command.ts builds the message as [template, value].join("\n\n"), so all 100 lines of review.txt land inside the user message, ahead of what the user typed — not in the system prompt where AGENTS.md rules sit. A global rule telling the model to answer in Chinese is fighting 100 lines of English-only instructions in the highest-salience position in the request.

    2. The inconsistency is measurable and version-pinned. 12 prompt files scanned at commit 527f0b93: kimi.txt and agent.ts:40 have the rule; review.txt, initialize.txt, anthropic.txt, gpt.txt, gpt-astra.txt, meta.txt, trinity.txt, runner/prompt/system.txt and PROMPT_EXPLORE do not. The table in the issue body is the full list.

    Happy to close this if you consider it folded into #49889 — the two are separable but adjacent, and I would rather not hold two open threads on one topic.

  3. xvcezrqpbxtpzblrt commented on Oct 5, 2026

    @xvcezrqpbxtpzblrt
    Author

    Closing this thread and moving the evidence to #49889, which is the open issue on this topic.

    Two corrections while I am here:

    1. The file count in this issue is wrong. The body says "2 of the 12 prompt files" and my comment above says "12 prompt files scanned". Both counted rows of a table I drew by hand from a partial directory scan. The correct figure, obtained by walking the full git tree and scanning every prompt file, is 14 files / 15 prompts, 2 carrying the rule, 13 lacking it — so the gap is slightly larger than reported, not smaller. Full enumeration table and method are in the comment I just posted on [FEATURE]: Language preference for model reasoning & output — English-only built-in prompts degrade Chinese writing quality #49889.

    2. I am not claiming users have no workaround. How to make opencode always reply in another language (for example: Chinese), including the /init command. #2594 recorded that a global AGENTS.md works, and its reporter confirmed it. What is filed here is narrower: the rule already exists in-tree and is applied to 2 of the 15 prompts that ship, and /review places 100 lines of English-only text inside the user message where an AGENTS.md rule has to compete with it.

    Leaving a second open thread on one topic is what got #33084 closed, so folding in is the right call. Tracking continues on #49889.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions