Change:
<!-- Do Not Delete This! bugreporttemplate --<!-- Please read our Rules of Conduct: --<!-- Read our guide about submitting issues: --<!-- Search existing issues to avoid creating duplicates. --<!-- Test using the latest Insiders build to see if your issue has already been fixed: --<!-- Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. --<!-- Launch with to check. --Does this issue occur when all extensions are disabled?: N/A <!-- If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. --<!-- Issues caused by an extension need to be reported directly to the extension publisher. The 'Help Report Issue' dialog can assist with this. --Version: 1.70.0-insider (user setup) Commit: Date: 2022-07-20T05:16:09.131Z Electron: 18.3.5 Chromium: 100.0.4896.160 16.13.2 V8: 10.0.139.17-electron.0 OS: Windows_NT x64 10.0. Steps to Reproduce: an extension that has an activation event. For example, the Docker extension has this. up a task matching the above activation event. VSCode to a workspace containing the task. Expected: The extension will not be activated until the task is executed. Actual: The extension will be immediately activated. This is a regression from the current stable release (1.69.2), which does not exhibit this behavior.
/cc I looked at telemetry and this has resulted in a very large spike to activations of the Docker extension in Insiders: !
I'm still available for consulting, but and have taken over tasks!
Good to know, thanks!
Might be fixed by
I tried out today's build and it seems to no longer reproduce, so I'm inclined to agree that fixes it. I'll keep an eye on the telemetry data and see if the activations return to reasonable levels as folks get the latest build.
awesome, thanks for confirming. I expect some bad activations will remain for those that don't update Insiders asap, let me know if there's still an issue
Been watching the telemetry and it's dropped off by over 90% from the peak, so I'm confident it's fixed. It will take some time for the update to reach everyone but that's to be expected.
this seems to have regressed. I got an alert again for the machine count on Insiders, and the activation reason has spiked again: ! (The larger spike in the middle is when this originally broke.)
does it go down if you set to false? with that set to true, the activation is intentional because we need to restore the tasks
I'm not sure what you mean.
Trying to figure out if this is because of the recently task reconnection which can be disabled via the setting
Ah, setting. This is not desirable behavior though, this results in a huge increase to activations of the Docker extension that do not need to happen. The extension only needs to be activated when the task has been run. EDIT: Scratch that, it seems to activate either way as long as the window launches with a terminal window open, or if a terminal window is opened after launch. It does not have to be a task terminal, even any terminal I launch causes it.
That's not true from a task reconnections standpoint atm. huge increase to activations of the Docker extension I will look into this next iteration For now, you have a workaround - to keep it disabled
Edited above; the setting is not working. Additionally, we can't ask every user to apply this setting. VSCode's launch performance will be significantly impacted by this, and I have a hard time believing a new task reconnection feature is more important than launch performance.
meaning disabling it does not improve performance or the setting doesn't get applied?
Disabling it seems to have no effect on whether the extension is activated prematurely or not. If a terminal is open at window startup, the extension is activated at startup; if a terminal is opened later the extension gets activated then.
I tested today's Insiders build and the issue appears fixed. I'll keep an eye on the telemetry again.
Telemetry looks good, the values came way down after the fix on the 24th. The circled values are the weekend and can be disregarded (there is normally a significant drop over the weekend): !

Discussion:
this._waitForSupportedExecutions = new Promise(resolve => { once(this._onDidRegisterSupportedExecutions.event)(() => resolve()); }); <del> if (this._terminalService.getReconnectedTerminals('Task')) { </del> <ins> if (this._terminalService.getReconnectedTerminals('Task')?.length) { </ins> this._attemptTaskReconnection(); } else { <del> this._register(this._terminalService.onDidChangeConnectionState(() => this._attemptTaskReconnection())); </del> <ins> this._register(this._terminalService.onDidChangeConnectionState(() => { if (this._terminalService.getReconnectedTerminals('Task')?.length) { this._attemptTaskReconnection(); } })); </ins> } this._upgrade(); }

} private _attemptTaskReconnection(): void { <ins> if (this._lifecycleService.startupKind !== StartupKind.ReloadedWindow) { this._tasksReconnected = true; this._storageService.remove(AbstractTaskService.PersistentTasks_Key, StorageScope.WORKSPACE); } if (!this._configurationService.getValue(TaskSettingId.Reconnection) || this._tasksReconnected) { this._tasksReconnected = true; return; } </ins> this._getTaskSystem(); this._waitForSupportedExecutions.then(() => { <del> this._activateTaskProviders(undefined).then(() => { this.getWorkspaceTasks().then(async () => { if (this._configurationService.getValue(TaskSettingId.Reconnection) === true && !this._tasksReconnected) { await this._reconnectTasks(); } }); </del> <ins> this.getWorkspaceTasks().then(async () => { this._tasksReconnected = await this._reconnectTasks(); </ins> }); }); } private async _reconnectTasks(): Promise<boolean> { <del> if (this._lifecycleService.startupKind !== StartupKind.ReloadedWindow) { this._tasksReconnected = true; this._storageService.remove(AbstractTaskService.PersistentTasks_Key, StorageScope.WORKSPACE); return true; } </del> const tasks = await this.getSavedTasks('persistent'); if (!tasks.length) { return true;