fix: apply lint fixes
This commit is contained in:
@@ -5,9 +5,9 @@ import {
|
|||||||
} from "./auth-profiles.js";
|
} from "./auth-profiles.js";
|
||||||
import { resolveEnvApiKey } from "./model-auth.js";
|
import { resolveEnvApiKey } from "./model-auth.js";
|
||||||
import {
|
import {
|
||||||
|
buildSyntheticModelDefinition,
|
||||||
SYNTHETIC_BASE_URL,
|
SYNTHETIC_BASE_URL,
|
||||||
SYNTHETIC_MODEL_CATALOG,
|
SYNTHETIC_MODEL_CATALOG,
|
||||||
buildSyntheticModelDefinition,
|
|
||||||
} from "./synthetic-models.js";
|
} from "./synthetic-models.js";
|
||||||
|
|
||||||
type ModelsConfig = NonNullable<ClawdbotConfig["models"]>;
|
type ModelsConfig = NonNullable<ClawdbotConfig["models"]>;
|
||||||
|
|||||||
@@ -483,7 +483,9 @@ describe("models config", () => {
|
|||||||
"https://api.synthetic.new/anthropic",
|
"https://api.synthetic.new/anthropic",
|
||||||
);
|
);
|
||||||
expect(parsed.providers.synthetic?.apiKey).toBe("SYNTHETIC_API_KEY");
|
expect(parsed.providers.synthetic?.apiKey).toBe("SYNTHETIC_API_KEY");
|
||||||
const ids = parsed.providers.synthetic?.models?.map((model) => model.id);
|
const ids = parsed.providers.synthetic?.models?.map(
|
||||||
|
(model) => model.id,
|
||||||
|
);
|
||||||
expect(ids).toContain("hf:MiniMaxAI/MiniMax-M2.1");
|
expect(ids).toContain("hf:MiniMaxAI/MiniMax-M2.1");
|
||||||
} finally {
|
} finally {
|
||||||
if (prevKey === undefined) delete process.env.SYNTHETIC_API_KEY;
|
if (prevKey === undefined) delete process.env.SYNTHETIC_API_KEY;
|
||||||
|
|||||||
@@ -350,8 +350,7 @@ describeLive("live models (profile keys)", () => {
|
|||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
ok.text.length === 0 &&
|
ok.text.length === 0 &&
|
||||||
(model.provider === "openrouter" ||
|
(model.provider === "openrouter" || model.provider === "opencode")
|
||||||
model.provider === "opencode")
|
|
||||||
) {
|
) {
|
||||||
skipped.push({
|
skipped.push({
|
||||||
model: id,
|
model: id,
|
||||||
@@ -375,7 +374,10 @@ describeLive("live models (profile keys)", () => {
|
|||||||
);
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (model.provider === "anthropic" && isAnthropicBillingError(message)) {
|
if (
|
||||||
|
model.provider === "anthropic" &&
|
||||||
|
isAnthropicBillingError(message)
|
||||||
|
) {
|
||||||
if (attempt + 1 < attemptMax) {
|
if (attempt + 1 < attemptMax) {
|
||||||
logProgress(
|
logProgress(
|
||||||
`${progressLabel}: billing issue, retrying with next key`,
|
`${progressLabel}: billing issue, retrying with next key`,
|
||||||
|
|||||||
@@ -43,10 +43,10 @@ import {
|
|||||||
applyMinimaxHostedConfig,
|
applyMinimaxHostedConfig,
|
||||||
applyMinimaxHostedProviderConfig,
|
applyMinimaxHostedProviderConfig,
|
||||||
applyMinimaxProviderConfig,
|
applyMinimaxProviderConfig,
|
||||||
applySyntheticConfig,
|
|
||||||
applySyntheticProviderConfig,
|
|
||||||
applyOpencodeZenConfig,
|
applyOpencodeZenConfig,
|
||||||
applyOpencodeZenProviderConfig,
|
applyOpencodeZenProviderConfig,
|
||||||
|
applySyntheticConfig,
|
||||||
|
applySyntheticProviderConfig,
|
||||||
applyZaiConfig,
|
applyZaiConfig,
|
||||||
MINIMAX_HOSTED_MODEL_REF,
|
MINIMAX_HOSTED_MODEL_REF,
|
||||||
SYNTHETIC_DEFAULT_MODEL_REF,
|
SYNTHETIC_DEFAULT_MODEL_REF,
|
||||||
|
|||||||
@@ -9,12 +9,12 @@ import {
|
|||||||
applyAuthProfileConfig,
|
applyAuthProfileConfig,
|
||||||
applyMinimaxApiConfig,
|
applyMinimaxApiConfig,
|
||||||
applyMinimaxApiProviderConfig,
|
applyMinimaxApiProviderConfig,
|
||||||
applySyntheticConfig,
|
|
||||||
applySyntheticProviderConfig,
|
|
||||||
applyOpencodeZenConfig,
|
applyOpencodeZenConfig,
|
||||||
applyOpencodeZenProviderConfig,
|
applyOpencodeZenProviderConfig,
|
||||||
applyOpenrouterConfig,
|
applyOpenrouterConfig,
|
||||||
applyOpenrouterProviderConfig,
|
applyOpenrouterProviderConfig,
|
||||||
|
applySyntheticConfig,
|
||||||
|
applySyntheticProviderConfig,
|
||||||
OPENROUTER_DEFAULT_MODEL_REF,
|
OPENROUTER_DEFAULT_MODEL_REF,
|
||||||
SYNTHETIC_DEFAULT_MODEL_ID,
|
SYNTHETIC_DEFAULT_MODEL_ID,
|
||||||
SYNTHETIC_DEFAULT_MODEL_REF,
|
SYNTHETIC_DEFAULT_MODEL_REF,
|
||||||
|
|||||||
@@ -3,11 +3,11 @@ import { resolveDefaultAgentDir } from "../agents/agent-scope.js";
|
|||||||
import { upsertAuthProfile } from "../agents/auth-profiles.js";
|
import { upsertAuthProfile } from "../agents/auth-profiles.js";
|
||||||
import { OPENCODE_ZEN_DEFAULT_MODEL_REF } from "../agents/opencode-zen-models.js";
|
import { OPENCODE_ZEN_DEFAULT_MODEL_REF } from "../agents/opencode-zen-models.js";
|
||||||
import {
|
import {
|
||||||
|
buildSyntheticModelDefinition,
|
||||||
SYNTHETIC_BASE_URL,
|
SYNTHETIC_BASE_URL,
|
||||||
SYNTHETIC_DEFAULT_MODEL_ID,
|
SYNTHETIC_DEFAULT_MODEL_ID,
|
||||||
SYNTHETIC_DEFAULT_MODEL_REF,
|
SYNTHETIC_DEFAULT_MODEL_REF,
|
||||||
SYNTHETIC_MODEL_CATALOG,
|
SYNTHETIC_MODEL_CATALOG,
|
||||||
buildSyntheticModelDefinition,
|
|
||||||
} from "../agents/synthetic-models.js";
|
} from "../agents/synthetic-models.js";
|
||||||
import type { ClawdbotConfig } from "../config/config.js";
|
import type { ClawdbotConfig } from "../config/config.js";
|
||||||
import type { ModelDefinitionConfig } from "../config/types.js";
|
import type { ModelDefinitionConfig } from "../config/types.js";
|
||||||
@@ -102,7 +102,6 @@ function buildMoonshotModelDefinition(): ModelDefinitionConfig {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export async function writeOAuthCredentials(
|
export async function writeOAuthCredentials(
|
||||||
provider: OAuthProvider,
|
provider: OAuthProvider,
|
||||||
creds: OAuthCredentials,
|
creds: OAuthCredentials,
|
||||||
@@ -368,8 +367,7 @@ export function applySyntheticProviderConfig(
|
|||||||
const models = { ...cfg.agents?.defaults?.models };
|
const models = { ...cfg.agents?.defaults?.models };
|
||||||
models[SYNTHETIC_DEFAULT_MODEL_REF] = {
|
models[SYNTHETIC_DEFAULT_MODEL_REF] = {
|
||||||
...models[SYNTHETIC_DEFAULT_MODEL_REF],
|
...models[SYNTHETIC_DEFAULT_MODEL_REF],
|
||||||
alias:
|
alias: models[SYNTHETIC_DEFAULT_MODEL_REF]?.alias ?? "MiniMax M2.1",
|
||||||
models[SYNTHETIC_DEFAULT_MODEL_REF]?.alias ?? "MiniMax M2.1",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const providers = { ...cfg.models?.providers };
|
const providers = { ...cfg.models?.providers };
|
||||||
|
|||||||
@@ -10,12 +10,12 @@ import {
|
|||||||
discoverModels,
|
discoverModels,
|
||||||
} from "@mariozechner/pi-coding-agent";
|
} from "@mariozechner/pi-coding-agent";
|
||||||
import { describe, it } from "vitest";
|
import { describe, it } from "vitest";
|
||||||
|
import { resolveClawdbotAgentDir } from "../agents/agent-paths.js";
|
||||||
import {
|
import {
|
||||||
type AuthProfileStore,
|
type AuthProfileStore,
|
||||||
ensureAuthProfileStore,
|
ensureAuthProfileStore,
|
||||||
saveAuthProfileStore,
|
saveAuthProfileStore,
|
||||||
} from "../agents/auth-profiles.js";
|
} from "../agents/auth-profiles.js";
|
||||||
import { resolveClawdbotAgentDir } from "../agents/agent-paths.js";
|
|
||||||
import {
|
import {
|
||||||
collectAnthropicApiKeys,
|
collectAnthropicApiKeys,
|
||||||
isAnthropicBillingError,
|
isAnthropicBillingError,
|
||||||
@@ -712,7 +712,10 @@ async function runGatewayModelSuite(params: GatewayModelSuiteParams) {
|
|||||||
logProgress(`${progressLabel}: rate limit, retrying with next key`);
|
logProgress(`${progressLabel}: rate limit, retrying with next key`);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (model.provider === "anthropic" && isAnthropicBillingError(message)) {
|
if (
|
||||||
|
model.provider === "anthropic" &&
|
||||||
|
isAnthropicBillingError(message)
|
||||||
|
) {
|
||||||
if (attempt + 1 < attemptMax) {
|
if (attempt + 1 < attemptMax) {
|
||||||
logProgress(
|
logProgress(
|
||||||
`${progressLabel}: billing issue, retrying with next key`,
|
`${progressLabel}: billing issue, retrying with next key`,
|
||||||
|
|||||||
Reference in New Issue
Block a user