fix: apply extension provider registrations before model resolution
- Extensions register providers via pendingProviderRegistrations - These were only applied in bindCore() during AgentSession creation - But model resolution in main.ts happens before session creation - Fix: apply pending registrations immediately after loading extensions - Also fix gitlab-duo to pass Authorization header instead of apiKey
This commit is contained in:
@@ -465,6 +465,13 @@ export async function main(args: string[]) {
|
||||
console.error(chalk.red(`Failed to load extension "${path}": ${error}`));
|
||||
}
|
||||
|
||||
// Apply pending provider registrations from extensions immediately
|
||||
// so they're available for model resolution before AgentSession is created
|
||||
for (const { name, config } of extensionsResult.runtime.pendingProviderRegistrations) {
|
||||
modelRegistry.registerProvider(name, config);
|
||||
}
|
||||
extensionsResult.runtime.pendingProviderRegistrations = [];
|
||||
|
||||
const extensionFlags = new Map<string, { type: "boolean" | "string" }>();
|
||||
for (const ext of extensionsResult.extensions) {
|
||||
for (const [name, flag] of ext.flags) {
|
||||
|
||||
Reference in New Issue
Block a user