@@ -7,7 +7,7 @@ import { DeepSeekChatProvider } from './provider';
77
88let activeProvider : DeepSeekChatProvider | undefined ;
99
10- export function activate ( context : vscode . ExtensionContext ) {
10+ export async function activate ( context : vscode . ExtensionContext ) {
1111 logger . info (
1212 `Activating extension version=${ context . extension . packageJSON . version } ` +
1313 ` debug=${ getDebugLoggingEnabled ( ) } ` ,
@@ -38,23 +38,25 @@ export function activate(context: vscode.ExtensionContext) {
3838 vscode . lm . registerLanguageModelChatProvider ( 'deepseek' , provider ) ,
3939 ) ;
4040
41- // Fix(#12): configurationSchema (Thinking Effort dropdown) is a non-public
42- // field that Copilot Chat does not persist in its chatLanguageModels.json
43- // cache. On startup, Copilot Chat initialises the model picker from cache
44- // and silently drops configurationSchema, so the per-model config menu
45- // never appears on first launch.
41+ // Fix(#12): Copilot Chat caches model info in chatLanguageModels.json
42+ // but silently drops configurationSchema (Thinking Effort dropdown).
43+ // Re-firing onDidChangeLanguageModelChatInformation forces Copilot Chat
44+ // to re-query our provider through the full (non-cached) path.
4645 //
47- // Re-firing onDidChangeLanguageModelChatInformation here forces Copilot
48- // Chat to re-query our provider through the full (non-cached) path, which
49- // correctly picks up configurationSchema.
46+ // To avoid a race where our refresh event fires before Copilot Chat is
47+ // listening, we programmatically activate Copilot Chat first. We do NOT
48+ // use extensionDependencies because built-in extensions aren't enumerable
49+ // in Remote-SSH hosts (#37), which causes the hard dependency to fail.
5050 //
51- // This works because registerLanguageModelChatProvider() is synchronous,
52- // so the provider is fully registered before we fire the refresh and the
53- // host has already subscribed to receive the change. Copilot Chat can then
54- // re-query complete model information through the non-cached path. The
55- // extensionDependencies on github.copilot-chat in package.json
56- // additionally guarantees Copilot Chat is fully activated before this
57- // extension's activate() runs, eliminating any activation ordering race.
51+ // If Copilot Chat is unavailable (e.g. Remote-SSH without built-in
52+ // registration), we log a warning and proceed — Copilot Chat as a
53+ // built-in typically initialises before onStartupFinished anyway.
54+ try {
55+ await vscode . extensions . getExtension ( 'github.copilot-chat' ) ?. activate ( ) ;
56+ } catch {
57+ logger . warn ( 'Copilot Chat activation unavailable; model picker refresh may be delayed' ) ;
58+ }
59+
5860 provider . refreshModelPicker ( ) ;
5961
6062 void showWelcomeIfNeeded ( context , provider ) . catch ( ( error ) => {
0 commit comments