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", () => {

View File

@@ -18,7 +18,6 @@ import {
DEFAULT_GIT_CHANNEL,
DEFAULT_PACKAGE_CHANNEL,
normalizeUpdateChannel,
type UpdateChannel,
} from "../infra/update-channels.js";
import { defaultRuntime } from "../runtime.js";
import { formatDocsLink } from "../terminal/links.js";

View File

@@ -309,9 +309,7 @@ describe("config identity defaults", () => {
expect(cfg.messages?.groupChat?.mentionPatterns).toBeUndefined();
expect(cfg.agents?.list).toBeUndefined();
expect(cfg.agents?.defaults?.maxConcurrent).toBe(DEFAULT_AGENT_MAX_CONCURRENT);
expect(cfg.agents?.defaults?.subagents?.maxConcurrent).toBe(
DEFAULT_SUBAGENT_MAX_CONCURRENT,
);
expect(cfg.agents?.defaults?.subagents?.maxConcurrent).toBe(DEFAULT_SUBAGENT_MAX_CONCURRENT);
expect(cfg.session).toBeUndefined();
});
});

View File

@@ -258,9 +258,7 @@ export function createConfigIO(overrides: ConfigIoDeps = {}) {
applyCompactionDefaults(
applyContextPruningDefaults(
applyAgentDefaults(
applySessionDefaults(
applyLoggingDefaults(applyMessageDefaults(validated.config)),
),
applySessionDefaults(applyLoggingDefaults(applyMessageDefaults(validated.config))),
),
),
),

View File

@@ -1,5 +1,9 @@
import type { ClawdbotConfig } from "./config.js";
import { getChatChannelMeta, listChatChannels, normalizeChatChannelId } from "../channels/registry.js";
import {
getChatChannelMeta,
listChatChannels,
normalizeChatChannelId,
} from "../channels/registry.js";
import {
getChannelPluginCatalogEntry,
listChannelPluginCatalogEntries,

View File

@@ -50,12 +50,7 @@ export const ModelProviderSchema = z
baseUrl: z.string().min(1),
apiKey: z.string().optional(),
auth: z
.union([
z.literal("api-key"),
z.literal("aws-sdk"),
z.literal("oauth"),
z.literal("token"),
])
.union([z.literal("api-key"), z.literal("aws-sdk"), z.literal("oauth"), z.literal("token")])
.optional(),
api: ModelApiSchema.optional(),
headers: z.record(z.string(), z.string()).optional(),

View File

@@ -29,10 +29,7 @@ import {
uniqueSortedStrings,
} from "./nodes.helpers.js";
import { loadConfig } from "../../config/config.js";
import {
isNodeCommandAllowed,
resolveNodeCommandAllowlist,
} from "../node-command-policy.js";
import { isNodeCommandAllowed, resolveNodeCommandAllowlist } from "../node-command-policy.js";
import type { GatewayRequestHandlers } from "./types.js";
function isNodeEntry(entry: { role?: string; roles?: string[] }) {

View File

@@ -27,8 +27,7 @@ declare module "pdfjs-dist/legacy/build/pdf.mjs" {
getPage(pageNumber: number): Promise<PDFPageProxy>;
};
export function getDocument(params: {
data: Uint8Array;
disableWorker?: boolean;
}): { promise: Promise<PDFDocumentProxy> };
export function getDocument(params: { data: Uint8Array; disableWorker?: boolean }): {
promise: Promise<PDFDocumentProxy>;
};
}