chore: fix lint/format

This commit is contained in:
Peter Steinberger
2026-01-20 13:52:59 +00:00
parent a81989048d
commit d69f246ba7
11 changed files with 25 additions and 43 deletions

View File

@@ -179,9 +179,10 @@ export function syncExternalCliCredentials(
!existingCodex ||
existingCodex.provider !== "openai-codex" ||
!isExternalProfileFresh(existingCodex, now);
const codexCreds = shouldSyncCodex || duplicateExistingId
? readCodexCliCredentialsCached({ ttlMs: EXTERNAL_CLI_SYNC_TTL_MS })
: null;
const codexCreds =
shouldSyncCodex || duplicateExistingId
? readCodexCliCredentialsCached({ ttlMs: EXTERNAL_CLI_SYNC_TTL_MS })
: null;
if (codexCreds) {
const duplicateProfileId = findDuplicateCodexProfile(store, codexCreds);
if (duplicateProfileId) {

View File

@@ -38,9 +38,9 @@ function resolveProviderConfig(
}
return (
(providers[normalized] as ModelProviderConfig | undefined) ??
(Object.entries(providers).find(
([key]) => normalizeProviderId(key) === normalized,
)?.[1] as ModelProviderConfig | undefined)
(Object.entries(providers).find(([key]) => normalizeProviderId(key) === normalized)?.[1] as
| ModelProviderConfig
| undefined)
);
}
@@ -353,7 +353,5 @@ export async function getApiKeyForModel(params: {
export function requireApiKey(auth: ResolvedProviderAuth, provider: string): string {
const key = auth.apiKey?.trim();
if (key) return key;
throw new Error(
`No API key resolved for provider "${provider}" (auth mode: ${auth.mode}).`,
);
throw new Error(`No API key resolved for provider "${provider}" (auth mode: ${auth.mode}).`);
}

View File

@@ -55,8 +55,7 @@ export function resolveModel(
const inlineModels = buildInlineProviderModels(providers);
const normalizedProvider = normalizeProviderId(provider);
const inlineMatch = inlineModels.find(
(entry) =>
normalizeProviderId(entry.provider) === normalizedProvider && entry.id === modelId,
(entry) => normalizeProviderId(entry.provider) === normalizedProvider && entry.id === modelId,
);
if (inlineMatch) {
const normalized = normalizeModelCompat(inlineMatch as Model<Api>);

View File

@@ -18,19 +18,13 @@ describe("web_search perplexity baseUrl defaults", () => {
});
it("prefers explicit baseUrl over key-based defaults", () => {
expect(
resolvePerplexityBaseUrl(
{ baseUrl: "https://example.com" },
"config",
"pplx-123",
),
).toBe("https://example.com");
expect(resolvePerplexityBaseUrl({ baseUrl: "https://example.com" }, "config", "pplx-123")).toBe(
"https://example.com",
);
});
it("defaults to direct when using PERPLEXITY_API_KEY", () => {
expect(resolvePerplexityBaseUrl(undefined, "perplexity_env")).toBe(
"https://api.perplexity.ai",
);
expect(resolvePerplexityBaseUrl(undefined, "perplexity_env")).toBe("https://api.perplexity.ai");
});
it("defaults to OpenRouter when using OPENROUTER_API_KEY", () => {