Repository navigation
fix: ensure output-language.md is created before config initialization - #1637
Merged
Merged
Conversation
Move initializeLlmOutputLanguage() to execute before loadCliConfig() to fix a race condition where the language file wasn't included in LLM context on first run. Co-authored-by: Qwen-Coder <[email protected]>
tanzhenxin
requested review from
DennisYu07,
LaZzyMan,
Mingholy,
gwinthis and
pomelo-nwu
as code owners
January 28, 2026 01:42
Contributor
📋 Review SummaryThis PR addresses a timing issue where the 🔍 General Feedback
🎯 Specific Feedback🟡 High
🟢 Medium
✅ Highlights
|
Contributor
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
xaelistic
pushed a commit
to xaelistic/qwen-code
that referenced
this pull request
Jun 7, 2026
…iming fix: ensure output-language.md is created before config initialization
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TLDR
Fix a timing issue where
output-language.mdwas created after config initialization, causing the LLM output language instruction to not be included in the context on first run.Dive Deeper
The output language file (
~/.qwen/output-language.md) instructs the LLM to respond in the user's preferred language. This file is automatically created on first startup based on system locale detection.However, there was a race condition in the initialization sequence:
loadCliConfig()checked for the file's existence → file not found →outputLanguageFilePathset toundefinedinitializeApp()then created the file viainitializeLlmOutputLanguage()outputLanguageFilePath = undefined, so the language instruction was never added to the LLM contextThis fix moves
initializeLlmOutputLanguage()to execute beforeloadCliConfig(), ensuring the file exists when the config checks for it.Changes
packages/cli/src/gemini.tsx: AddedinitializeLlmOutputLanguage()call beforeloadCliConfig()packages/cli/src/core/initializer.ts: Removed the duplicate call (no longer needed here)Reviewer Test Plan
Clean environment test:
~/.qwen/output-language.mdif it existsQWEN_CODE_LANG=zh)Regression test:
/language output <lang>command to change languageCode review:
Testing Matrix
Tested on macOS with:
npm run build✓npx vitest run src/utils/languageUtils.test.ts(38 tests passed) ✓No linked issues
🤖 Generated with Qwen Code