fix: bind getProviderAuthMode to registry instance to avoid undefined 'this'
Extracting a class method as a bare reference loses its 'this' context, causing 'Cannot read properties of undefined' when minimax (or any provider) triggers the flat-rate auth-mode lookup. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
7be540480e
commit
f0da5b6d21
1 changed files with 1 additions and 1 deletions
|
|
@ -707,7 +707,7 @@ export function buildFlatRateContext(
|
|||
prefs?: { flat_rate_providers?: readonly string[] },
|
||||
): FlatRateContext {
|
||||
let authMode: FlatRateContext["authMode"];
|
||||
const getAuthMode = ctx?.modelRegistry?.getProviderAuthMode;
|
||||
const getAuthMode = ctx?.modelRegistry?.getProviderAuthMode?.bind(ctx.modelRegistry);
|
||||
if (typeof getAuthMode === "function") {
|
||||
try {
|
||||
const mode = getAuthMode(provider);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue