Merge pull request #1993 from zhangxy-zju/fix/subagent-output-language

fix(subagent): append output-language.md to subagent system prompt and prioritize project-level settings
This commit is contained in:
tanzhenxin 2026-03-02 17:08:52 +08:00 committed by GitHub
commit 74f5b76754
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 173 additions and 5 deletions

View file

@ -693,14 +693,21 @@ export async function loadCliConfig(
}
// Automatically load output-language.md if it exists
let outputLanguageFilePath: string | undefined = path.join(
const projectStorage = new Storage(cwd);
const projectOutputLanguagePath = path.join(
projectStorage.getQwenDir(),
'output-language.md',
);
const globalOutputLanguagePath = path.join(
Storage.getGlobalQwenDir(),
'output-language.md',
);
if (fs.existsSync(outputLanguageFilePath)) {
// output-language.md found - will be added to context files
} else {
outputLanguageFilePath = undefined;
let outputLanguageFilePath: string | undefined;
if (fs.existsSync(projectOutputLanguagePath)) {
outputLanguageFilePath = projectOutputLanguagePath;
} else if (fs.existsSync(globalOutputLanguagePath)) {
outputLanguageFilePath = globalOutputLanguagePath;
}
const fileService = new FileDiscoveryService(cwd);