mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-21 17:27:54 +00:00
chore(vscode-ide-companion): rm authState manager in vscode-ide-companion to simplify the login architecture
This commit is contained in:
@@ -32,8 +32,6 @@ export class AcpConnection {
|
||||
private pendingRequests = new Map<number, PendingRequest<unknown>>();
|
||||
private nextRequestId = { value: 0 };
|
||||
|
||||
// Deduplicate concurrent authenticate calls (across retry paths)
|
||||
private static authInFlight: Promise<AcpResponse> | null = null;
|
||||
// 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();
|
||||
@@ -274,23 +272,12 @@ export class AcpConnection {
|
||||
* @returns Authentication response
|
||||
*/
|
||||
async authenticate(methodId?: string): Promise<AcpResponse> {
|
||||
if (AcpConnection.authInFlight) {
|
||||
return AcpConnection.authInFlight;
|
||||
}
|
||||
|
||||
const p = this.sessionManager
|
||||
.authenticate(
|
||||
methodId,
|
||||
this.child,
|
||||
this.pendingRequests,
|
||||
this.nextRequestId,
|
||||
)
|
||||
.finally(() => {
|
||||
AcpConnection.authInFlight = null;
|
||||
});
|
||||
|
||||
AcpConnection.authInFlight = p;
|
||||
return p;
|
||||
return this.sessionManager.authenticate(
|
||||
methodId,
|
||||
this.child,
|
||||
this.pendingRequests,
|
||||
this.nextRequestId,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user