diff --git a/src/lsptoolshost/copilot/contextProviders.ts b/src/lsptoolshost/copilot/contextProviders.ts index 7a913ee3f5..1f21151084 100644 --- a/src/lsptoolshost/copilot/contextProviders.ts +++ b/src/lsptoolshost/copilot/contextProviders.ts @@ -157,7 +157,14 @@ async function getCopilotChatApi(): Promise { let exports: CopilotChatApi | undefined; try { - exports = await extension.activate(); + exports = await Promise.race([ + extension.activate(), + new Promise((resolve) => { + setTimeout(() => { + resolve(undefined); + }, 3000); + }), + ]); } catch { return undefined; }