feat(coding-agent): flush registerProvider immediately after bindCore, add unregisterProvider

This commit is contained in:
Aliou Diallo
2026-02-18 10:59:51 +01:00
parent 4ba3e5be22
commit 975de88eb1
6 changed files with 90 additions and 3 deletions

View File

@@ -259,11 +259,16 @@ export class ExtensionRunner {
this.compactFn = contextActions.compact;
this.getSystemPromptFn = contextActions.getSystemPrompt;
// Process provider registrations queued during extension loading
// Flush provider registrations queued during extension loading
for (const { name, config } of this.runtime.pendingProviderRegistrations) {
this.modelRegistry.registerProvider(name, config);
}
this.runtime.pendingProviderRegistrations = [];
// From this point on, provider registration/unregistration takes effect immediately
// without requiring a /reload.
this.runtime.registerProvider = (name, config) => this.modelRegistry.registerProvider(name, config);
this.runtime.unregisterProvider = (name) => this.modelRegistry.unregisterProvider(name);
}
bindCommandContext(actions?: ExtensionCommandContextActions): void {