smoke: fix flaky Chat Sessions copilot-chat activation race#322187
Open
alexdima wants to merge 1 commit into
Open
smoke: fix flaky Chat Sessions copilot-chat activation race#322187alexdima wants to merge 1 commit into
alexdima wants to merge 1 commit into
Conversation
The Chat Sessions smoke test runs right after the Chat Disabled suite, which disables AI features. When the suite re-enables them, there is a brief window where copilot-chat is still disabled and its commands are not yet registered. The smoke helper invoked 'github.copilot.debug.extensionState' to force-activate copilot-chat, but that executeCommand rejected with 'command not found' during this window, aborting the handler before it could open the chat editor and causing a 60s timeout on '.editor-instance .interactive-session'. Wait for the diagnostic command to be registered (via the existing waitForCommand helper) before invoking it, so the handler no longer races copilot-chat enablement/activation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens the VS Code smoke test extension-host helper commands used by the “Chat Sessions” smoke suite by avoiding an activation/enablement race with GitHub Copilot-related commands after the preceding “Chat Disabled” suite.
Changes:
- Gate
smoketest.openCopilotCliChatongithub.copilot.debug.extensionStatebeing registered before invoking it. - Apply the same gating to
smoketest.openClaudeChatto avoid the same race pattern.
Show a summary per file
| File | Description |
|---|---|
| test/smoke/extensions/vscode-smoketest-ext-host/extension.js | Adds waitForCommand('github.copilot.debug.extensionState', …) before invoking the diagnostic command to prevent intermittent “command not found” failures. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 2
roblourens
approved these changes
Jun 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
Chat Sessions › Test Copilot CLI sessionsmoke test failed intermittently with:(seen e.g. in run 27850813533 — the failing test, while
Test Claude sessionandTest Local sessionin the same suite passed.)Root cause
The
Chat Sessionssuite runs immediately after theChat Disabledsuite, which disables AI features (chat.disableAIFeatures). WhenChat Sessionsre-enables them in itsbefore()hook, there is a brief window where the copilot-chat extension is still disabled and its contributed commands are not yet registered as activation triggers.The smoke helper
smoketest.openCopilotCliChatinvokedgithub.copilot.debug.extensionStateto force-activate copilot-chat. In that window the rendererCommandService.executeCommandpath is not robust for an as-yet-disabled extension — it races*activation against command registration and rejects withcommand 'github.copilot.debug.extensionState' not found. That rejection aborted the handler before it reachedwaitForCommand(...)/ opened the chat editor, sowaitForChatEditortimed out after 60s.Artifact logs confirm the timing: the
executeCommandfailed at22:45:00.609, ~50ms before copilot-chat enablement was applied at22:45:00.66(onEnablementChanged→deltaExtensions toAdd: [copilot-chat]), with the extension only activating at22:45:01.219.Fix
Reuse the existing
waitForCommandhelper to wait untilgithub.copilot.debug.extensionStateis registered before invoking it. This gates on copilot-chat being enabled and activated, so the handler no longer races enablement.Applied to both
smoketest.openCopilotCliChatandsmoketest.openClaudeChat.