Skip to content

copilot: fix signed-out BYOK chat hanging when the legacy Copilot CLI provider is off - #351273

Merged
Vritant Bhardwaj (vritant24) merged 1 commit into
mainfrom
agents/mock-endpoint-repro-issue-350360
Nov 30, 2026
Merged

Vritant Bhardwaj (vritant24) merged 1 commit into
mainfrom
agents/mock-endpoint-repro-issue-350360

Conversation

@vritant24

Copy link
Copy Markdown
Member

Fixes #350360

Problem

Signed out of GitHub with a BYOK model configured, a chat request in the Local harness never starts and ends with "Chat took too long to get ready" when github.copilot.chat.cli.legacyProvider.enabled is off.

The extension's activation waits on ConversationFeature.activationBlocker, which completes on a Copilot token, a detected BYOK model, or an identity change. Signed out, none of these happen:

  • There is no token.
  • Starting signed out is not an identity change, so onDidAuthenticationChange does not fire.
  • BYOK detection calls vscode.lm.selectChatModels({}), which resolves every declared vendor. The copilotcli vendor is declared but no longer registered when the legacy provider is off, so resolving it waits for this extension to finish activating, which is waiting on the blocker.

With the legacy provider on, registering copilotcli fired a model change event that re-ran the query and hid the problem.

Change

ConversationFeature now also releases the activation blocker once the first Copilot token request settles, whether it succeeds or fails. Signed out, that request fails quickly, activation completes, the pending model query returns the BYOK models, and chat enables as before. Enablement is still decided by reevaluate; only the blocker is affected.

How to test

  1. Use a profile that is not signed in to GitHub.
  2. Add a BYOK model (for example a Custom Endpoint group in chatLanguageModels.json).
  3. Set "github.copilot.chat.cli.legacyProvider.enabled": false and reload.
  4. In the Chat view pick the Local harness and send a request. It should be answered by the BYOK model; before this change it hangs and times out.

Validation

  • pnpm -C extensions/copilot exec tsc --noEmit --project tsconfig.json: passed
  • pnpm run oxlint on the two changed files: passed
  • pnpm run test-extension -l copilot --grep "Conversation feature test suite": 8 passing, 1 pending (already skipped), including the new signed-out case
  • Manual run in Code OSS, signed out, legacy provider off, against a local mock OpenAI-compatible endpoint: the Local chat request reached the endpoint and the reply rendered. The same setup hangs without the change.

…vendor is unregistered

Signed out, the first Copilot token request fails without an identity change, so nothing completed ConversationFeature's activation blocker. With the legacy Copilot CLI provider disabled, the BYOK model query waits for this extension's activation and the two deadlock. Release the blocker once the first token request settles.

Fixes #350360

Co-authored-by: Copilot <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 30, 2026 17:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues were identified for the change addressing signed-out BYOK chat startup hangs.

No open issues 🎉

What changed in this PR

Fixes signed-out BYOK chat startup hanging when the legacy Copilot CLI provider is disabled, addressing #350360.

Changes:

  • Releases the activation blocker when the initial Copilot token request settles, while leaving chat enablement controlled by reevaluate.
  • Adds a regression test covering token-request failure followed by delayed BYOK model discovery.
File Description
extensions/​copilot/​src/​extension/​conversation/​vscode-node/​test/​conversationFeature.test.ts Tests activation unblocking while signed out and subsequent BYOK enablement.
extensions/​copilot/​src/​extension/​conversation/​vscode-node/​conversationFeature.ts Shares activation-unblocking logic and invokes it after the initial token request settles.

Review effort: Balanced

@vritant24
Vritant Bhardwaj (vritant24) added this pull request to the merge queue Nov 30, 2026
Merged via the queue into main with commit 32686b8 Nov 30, 2026
54 checks passed
@vritant24
Vritant Bhardwaj (vritant24) deleted the agents/mock-endpoint-repro-issue-350360 branch November 30, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression: BYOK models fail to activate the local chat harness when signed out of GitHub in Copilot Chat 0.75.0

4 participants