Claude Code. Any Model. The most powerful AI coding agent now speaks every language.
refactor(config): remove the unused DefaultProviderSchema
Jack Rudenkoc88156908c8d
diff --git a/packages/cli/src/config-schema.test.ts b/packages/cli/src/config-schema.test.tsindex 2930fd7e..315a256f 100644--- a/packages/cli/src/config-schema.test.ts+++ b/packages/cli/src/config-schema.test.ts@@ -1,10 +1,8 @@import { describe, expect, test } from "bun:test";import {- BuiltinDefaultProviderSchema,CustomEndpointComplexSchema,CustomEndpointSchema,CustomEndpointSimpleSchema,- DefaultProviderSchema,} from "./config-schema.js";function invalidCustomEndpointMessage(input: unknown): string {@@ -201,25 +199,3 @@ describe("CustomEndpointSchema (discriminated union)", () => {).toThrow();});});--describe("BuiltinDefaultProviderSchema", () => {- // Pins the documented set of built-in provider names — an enum edit- // (dropped/renamed/typo'd member) would ship a broken user-facing config contract.- test.each(["openrouter", "litellm", "openai", "anthropic", "google"])("accepts %s", (name) => {- expect(BuiltinDefaultProviderSchema.parse(name)).toBe(name);- });-- test("rejects unknown builtin name", () => {- expect(() => BuiltinDefaultProviderSchema.parse("not-a-builtin")).toThrow();- });-});--describe("DefaultProviderSchema", () => {- test("accepts a custom endpoint name like `my-vllm`", () => {- expect(DefaultProviderSchema.parse("my-vllm")).toBe("my-vllm");- });-- test("rejects empty string", () => {- expect(() => DefaultProviderSchema.parse("")).toThrow();- });-});diff --git a/packages/cli/src/config-schema.ts b/packages/cli/src/config-schema.tsindex d76b2047..6f84850c 100644--- a/packages/cli/src/config-schema.ts+++ b/packages/cli/src/config-schema.ts@@ -2,12 +2,13 @@* Config schemas for the LiteLLM-demotion refactor (Phase 1).** Defines:- * - BuiltinDefaultProviderSchema — enum of provider names users can name as- * their default provider for bare model names.* - CustomEndpointSimpleSchema — "URL + format + key" custom endpoints.* - CustomEndpointComplexSchema — full provider profile (Phase 3 will register).* - CustomEndpointSchema — discriminated union of the two.- * - DefaultProviderSchema — builtin enum OR custom-endpoint name string.+ *+ * `defaultProvider` has no schema. Nothing validated it, and the one that existed+ * rejected `""`, which is a valid value (no fallback provider), and listed+ * `anthropic`, which is not a claudish provider.** NOTE: This module is intentionally NOT imported by `profile-config.ts`.* Validation happens at the consumption site (Phase 3 will add a@@ -18,16 +19,6 @@import { z } from "zod";-// Built-in providers users can name as their default.-// "litellm" is preserved for legacy compat (Phase 2 will gate auto-promotion on this).-export const BuiltinDefaultProviderSchema = z.enum([- "openrouter",- "litellm",- "openai",- "anthropic",- "google",-]);-/*** How a custom endpoint authenticates.*@@ -159,11 +150,6 @@ export const PredefinedEndpointsConfigSchema = z.object({enable: z.array(z.string()).optional(),});-// defaultProvider can be a builtin OR the name of a custom endpoint-// (we validate the cross-reference at load time, not in the schema).-export const DefaultProviderSchema = z.union([BuiltinDefaultProviderSchema, z.string().min(1)]);--export type BuiltinDefaultProvider = z.infer<typeof BuiltinDefaultProviderSchema>;export type CustomEndpointSimple = z.infer<typeof CustomEndpointSimpleSchema>;export type CustomEndpointComplex = z.infer<typeof CustomEndpointComplexSchema>;export type CustomEndpoint = z.infer<typeof CustomEndpointSchema>;