From a0760b199c64291daa3242d6bac8b15c1c0d0811 Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Mon, 6 Apr 2026 13:59:03 -0400 Subject: [PATCH] Guard sign_in against concurrent invocations Early-return if a sign-in task is already in progress. Without this, a second call would drop the existing task (cancelling it while port 1455 may still be bound) and the new task could fail to bind. --- crates/language_models/src/provider/openai_subscribed.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/language_models/src/provider/openai_subscribed.rs b/crates/language_models/src/provider/openai_subscribed.rs index c9b363216e77ad4c0643ea78fc15300325958432..a0b9d16fa9e3f0f03285a074f69ec2f92b8e159b 100644 --- a/crates/language_models/src/provider/openai_subscribed.rs +++ b/crates/language_models/src/provider/openai_subscribed.rs @@ -119,6 +119,10 @@ impl OpenAiSubscribedProvider { } fn sign_in(&self, cx: &mut App) { + if self.state.read(cx).is_signing_in() { + return; + } + let state = self.state.downgrade(); let http_client = self.http_client.clone();