Repository navigation
Description
Description
When a user communicates with opencode in a non-English language (e.g., Chinese), the main agent correctly infers the language and responds in the same language. However, when the user invokes a sub-agent (e.g., @general or any task agent) via the task tool, the sub-agent's processing messages, intermediate outputs, and results are all displayed in English. Users who do not understand English are unable to follow what the sub-agent is doing.
This happens because:
- The system prompt passed to sub-agents is hardcoded in English
- The
task.tstool has hardcoded English strings for background task status messages - There is no language detection mechanism
- There is no mechanism to pass the user's language preference from the parent session to sub-agent sessions
- There is no i18n/localization infrastructure
Code location
-
packages/opencode/src/tool/task.ts— Background/foreground task messages hardcoded in English:BACKGROUND_DESCRIPTION(line ~28): "Background mode: background=true launches the subagent asynchronously..."BACKGROUND_STARTED(line ~34): "The task is working in the background..."BACKGROUND_UPDATED(line ~41): "Additional context sent to the running background task..."renderOutput()(line ~78): Generates<task>XML with English summariesinject()(line ~136): "Background task completed: ..." / "Background task failed: ..."backgroundResult()(line ~200): "Background task started"
-
packages/opencode/src/session/system.ts— Environment prompts hardcoded in English:- "You are powered by the model named..."
- "Working directory: ..."
- "Workspace root folder: ..."
-
packages/opencode/src/session/prompt/default.txt— Default system prompt entirely in English -
packages/opencode/src/session/prompt/anthropic.txt— Anthropic system prompt entirely in English -
packages/opencode/src/session/prompt.ts— Prompt generation logic without any language awareness
Steps to reproduce
- Start a conversation with opencode in Chinese (or any non-English language)
- Confirm the main agent responds in Chinese
- Type
@general do something in this projector invoke any sub-agent - Observe that the sub-agent's processing messages, status updates, and results are displayed in English
- A non-English-speaking user cannot understand what the sub-agent is doing
Expected behavior
Sub-agents should respect the user's language preference and respond in the same language as the parent conversation. Options:
- Detect the user's language from the conversation history and pass it to sub-agents
- Add a configurable language/locale setting
- Include a language directive in the system prompt passed to sub-agents (e.g., "The user is communicating in Chinese. Please respond in Chinese.")
- Implement i18n for tool output strings
Environment
- opencode version: latest (observed on v2.x)
- OS: cross-platform (reproducible on Windows, macOS, Linux)
- Sub-agent types affected: all (
@general,@plan,@tool, etc.)
About the duplicate flag: #12609 reports that system prompts contain an ASCII-only constraint which prevents non-English output. That is a different root cause (model prompt design). This issue is about sub-agent language inheritance — even if the main agent speaks Chinese, sub-agents created via the task tool do not receive any language context and default to English. The fix involves passing the user's detected language from parent to child session, which is separate from fixing ASCII-only constraints in system prompts.
Activity
github-actions commentedon Jun 20, 2026
This issue might be a duplicate of existing issues. Please check:
If your issue specifically focuses on sub-agent language inheritance (passing language context from parent to child sessions), it may be distinct enough to remain open. Please review #12609 and comment on whether your issue is fully covered there or represents a separate concern.
rekram1-node commentedon Jun 22, 2026
STOP SPAMMING ISSUES.