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:
Mario Zechner 2026-01-25 00:13:20 +01:00
parent dd01d83e64
commit 7a5cfdaed0
3 changed files with 316 additions and 2 deletions

View file

@ -257,13 +257,19 @@ function streamGitLabDuo(
id: mapping.backendModel,
api: mapping.api,
baseUrl: mapping.baseUrl,
headers: directAccess.headers,
};
// Merge GitLab headers with Authorization bearer token
const headers = {
...directAccess.headers,
Authorization: `Bearer ${directAccess.token}`,
};
// Delegate to pi-ai's built-in streaming
const innerStream = streamSimple(proxyModel, context, {
...options,
apiKey: directAccess.token,
apiKey: "gitlab-duo", // Dummy value to pass validation
headers,
});
// Forward all events