fix: resolve Pi LLM auth through modelRegistry
- Call ctx.modelRegistry.getApiKeyAndHeaders(model) to resolve auth - Pass resolved apiKey and headers to complete() options - Provides clear error message if auth fails ( directs user to /login ) - Update test mock to include ok: true on auth response - No external fetch() — Pi handles all transport and auth
This commit is contained in:
@@ -60,6 +60,7 @@ describe("pi-extension", () => {
|
||||
},
|
||||
modelRegistry: {
|
||||
getApiKeyAndHeaders: vi.fn(async () => ({
|
||||
ok: true,
|
||||
apiKey: "test-key",
|
||||
headers: {},
|
||||
})),
|
||||
|
||||
Reference in New Issue
Block a user