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:
2026-06-10 16:18:52 +02:00
parent 6f13c66dae
commit 553789a59f
2 changed files with 11 additions and 0 deletions
+1
View File
@@ -60,6 +60,7 @@ describe("pi-extension", () => {
},
modelRegistry: {
getApiKeyAndHeaders: vi.fn(async () => ({
ok: true,
apiKey: "test-key",
headers: {},
})),