fix(vscode-ide-companion): 优化 CLI 检测和连接逻辑

This commit is contained in:
yiliang114
2025-11-25 19:27:41 +08:00
parent 627f5fb43a
commit 5ce40085d5
8 changed files with 196 additions and 20 deletions

View File

@@ -416,7 +416,12 @@ export class WebViewProvider {
const authInfo = await this.authStateManager.getAuthInfo();
console.log('[WebViewProvider] Auth cache status:', authInfo);
await this.agentManager.connect(workingDir, this.authStateManager);
// Pass the detected CLI path to ensure we use the correct installation
await this.agentManager.connect(
workingDir,
this.authStateManager,
cliDetection.cliPath,
);
console.log('[WebViewProvider] Agent connected successfully');
this.agentInitialized = true;