Fix BYOK models disappearing during startup#319123
Open
EmirX3D wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR improves resilience and UX around chat session persistence and BYOK visibility by rebuilding missing session indices from disk, treating configured BYOK providers as an early positive signal, and migrating stored local chat sessions from profile-scoped to application-scoped storage.
Changes:
- Rebuild
ChatSessionStoreindex from persisted session files when the persisted index is missing/empty. - Make
HasByokModelsContributionresolvetrueimmediately when non-Copilot provider groups are configured (even before extensions register). - Migrate local chat session metadata from
StorageScope.PROFILEtoStorageScope.APPLICATION, plus add tests and documentation.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/common/model/chatSessionStore.ts | Adds one-time index rebuild scanning persisted session files with limited parallelism. |
| src/vs/workbench/contrib/chat/test/common/model/chatSessionStore.test.ts | Adds test coverage for rebuilding the index from valid session files while skipping corrupt ones. |
| src/vs/workbench/contrib/chat/browser/hasByokModelsContribution.ts | Treats configured non-Copilot provider groups as an immediate positive BYOK signal on startup. |
| src/vs/workbench/contrib/chat/test/browser/hasByokModelsContribution.test.ts | Adds regression test for “configured groups should show BYOK UI even if persisted state is false”. |
| src/vs/sessions/contrib/providers/localChatSessions/browser/localChatSessionsProvider.ts | Migrates persisted local chat sessions from profile to application storage and merges forward on load. |
| src/vs/sessions/contrib/providers/localChatSessions/test/browser/localChatSessionsProvider.test.ts | Adds test for legacy-to-application storage migration behavior. |
| src/vs/sessions/contrib/providers/localChatSessions/LOCAL_CHAT_SESSIONS_PROVIDER.md | Documents new storage scope and legacy merge-forward behavior. |
dmitrivMS
requested changes
May 31, 2026
Contributor
dmitrivMS
left a comment
There was a problem hiding this comment.
This is doing too much for the stated problem. The race needs to be addressed, but this is doing a lot more than fixing hasByokModels state...
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.
Fixes a startup timing race where configured Custom Endpoint/BYOK models could be hidden from the chat model picker because chat.hasByokModels.lastKnown restored as false before extension registration or model resolution completed, by treating configured non-Copilot language model provider groups as an immediate positive BYOK signal and covering the cold-start case with a regression test.
Closes #319121