Merge pull request #1226 from QwenLM/feat/support-channel-field

feat: Add channel field support for client identification
This commit is contained in:
tanzhenxin
2025-12-12 16:16:36 +08:00
committed by GitHub
8 changed files with 43 additions and 4 deletions

View File

@@ -94,7 +94,12 @@ export class AcpConnection {
if (cliPath.startsWith('npx ')) {
const parts = cliPath.split(' ');
spawnCommand = isWindows ? 'npx.cmd' : 'npx';
spawnArgs = [...parts.slice(1), '--experimental-acp', ...extraArgs];
spawnArgs = [
...parts.slice(1),
'--experimental-acp',
'--channel=VSCode',
...extraArgs,
];
} else {
// For qwen CLI, ensure we use the correct Node.js version
// Handle various Node.js version managers (nvm, n, manual installations)
@@ -103,11 +108,16 @@ export class AcpConnection {
const nodePathResult = determineNodePathForCli(cliPath);
if (nodePathResult.path) {
spawnCommand = nodePathResult.path;
spawnArgs = [cliPath, '--experimental-acp', ...extraArgs];
spawnArgs = [
cliPath,
'--experimental-acp',
'--channel=VSCode',
...extraArgs,
];
} else {
// Fallback to direct execution
spawnCommand = cliPath;
spawnArgs = ['--experimental-acp', ...extraArgs];
spawnArgs = ['--experimental-acp', '--channel=VSCode', ...extraArgs];
// Log any error for debugging
if (nodePathResult.error) {
@@ -118,7 +128,7 @@ export class AcpConnection {
}
} else {
spawnCommand = cliPath;
spawnArgs = ['--experimental-acp', ...extraArgs];
spawnArgs = ['--experimental-acp', '--channel=VSCode', ...extraArgs];
}
}