mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
chore(vscode-ide-companion): add comment
This commit is contained in:
@@ -31,7 +31,6 @@ export class AcpConnection {
|
||||
private child: ChildProcess | null = null;
|
||||
private pendingRequests = new Map<number, PendingRequest<unknown>>();
|
||||
private nextRequestId = { value: 0 };
|
||||
|
||||
// Remember the working dir provided at connect() so later ACP calls
|
||||
// that require cwd (e.g. session/list) can include it.
|
||||
private workingDir: string = process.cwd();
|
||||
|
||||
@@ -138,7 +138,6 @@ export class QwenConnectionHandler {
|
||||
'[QwenAgentManager] Qwen requires authentication. Authenticating and retrying session/new...',
|
||||
);
|
||||
try {
|
||||
// Let CLI handle authentication - it's the single source of truth
|
||||
await connection.authenticate(authMethod);
|
||||
// FIXME: @yiliang114 If there is no delay for a while, immediately executing
|
||||
// newSession may cause the cli authorization jump to be triggered again
|
||||
|
||||
@@ -131,7 +131,7 @@ export class WebViewProvider {
|
||||
// Note: Tool call updates are handled in handleSessionUpdate within QwenAgentManager
|
||||
// and sent via onStreamChunk callback
|
||||
this.agentManager.onToolCall((update) => {
|
||||
// Always surface tool calls; they are part of the live assistant process.
|
||||
// Always surface tool calls; they are part of the live assistant flow.
|
||||
// Cast update to access sessionUpdate property
|
||||
const updateData = update as unknown as Record<string, unknown>;
|
||||
|
||||
@@ -516,15 +516,13 @@ export class WebViewProvider {
|
||||
/**
|
||||
* Attempt to restore authentication state and initialize connection
|
||||
* This is called when the webview is first shown
|
||||
*
|
||||
* In the new architecture, let CLI handle authentication state management
|
||||
*/
|
||||
private async attemptAuthStateRestoration(): Promise<void> {
|
||||
try {
|
||||
console.log(
|
||||
'[WebViewProvider] Attempting connection (letting CLI handle authentication)...',
|
||||
'[WebViewProvider] Attempting connection (CLI handle authentication)...',
|
||||
);
|
||||
// In the new architecture, always attempt connection and let CLI handle authentication
|
||||
//always attempt connection and let CLI handle authentication
|
||||
await this.initializeAgentConnection();
|
||||
} catch (error) {
|
||||
console.error(
|
||||
@@ -540,7 +538,6 @@ export class WebViewProvider {
|
||||
* Can be called from show() or via /login command
|
||||
*/
|
||||
async initializeAgentConnection(): Promise<void> {
|
||||
// In the new architecture, let CLI handle authentication without local state caching
|
||||
return this.doInitializeAgentConnection();
|
||||
}
|
||||
|
||||
@@ -586,7 +583,6 @@ export class WebViewProvider {
|
||||
console.log('[WebViewProvider] Connecting to agent...');
|
||||
|
||||
// Pass the detected CLI path to ensure we use the correct installation
|
||||
// In the new architecture, let CLI handle authentication without local state caching
|
||||
await this.agentManager.connect(workingDir, cliDetection.cliPath);
|
||||
console.log('[WebViewProvider] Agent connected successfully');
|
||||
this.agentInitialized = true;
|
||||
@@ -755,12 +751,6 @@ export class WebViewProvider {
|
||||
try {
|
||||
await this.agentManager.createNewSession(workingDir);
|
||||
console.log('[WebViewProvider] ACP session created successfully');
|
||||
|
||||
// In the new architecture, CLI handles authentication state
|
||||
// No need to save auth state locally anymore
|
||||
console.log(
|
||||
'[WebViewProvider] Session created successfully (CLI manages auth state)',
|
||||
);
|
||||
} catch (sessionError) {
|
||||
console.error(
|
||||
'[WebViewProvider] Failed to create ACP session:',
|
||||
|
||||
Reference in New Issue
Block a user