mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 22:03:45 +00:00
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:
parent
dd01d83e64
commit
7a5cfdaed0
3 changed files with 316 additions and 2 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue