Revert: feat: add models.dev schema ref for model autocomplete in ope… (#12242)

pull/10515/head^2
Aiden Cline 2026-02-05 00:31:08 -06:00 committed by GitHub
parent d3a247bfff
commit 8c8d888140
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 20 additions and 20 deletions

View File

@ -35,8 +35,6 @@ import { iife } from "@/util/iife"
export namespace Config { export namespace Config {
const log = Log.create({ service: "config" }) const log = Log.create({ service: "config" })
const ModelRef = { $ref: "https://models.dev/model-schema.json#/$defs/Model" }
// Managed settings directory for enterprise deployments (highest priority, admin-controlled) // Managed settings directory for enterprise deployments (highest priority, admin-controlled)
// These settings override all user and project settings // These settings override all user and project settings
function getManagedConfigDir(): string { function getManagedConfigDir(): string {
@ -662,7 +660,7 @@ export namespace Config {
template: z.string(), template: z.string(),
description: z.string().optional(), description: z.string().optional(),
agent: z.string().optional(), agent: z.string().optional(),
model: z.string().optional().meta(ModelRef), model: z.string().optional(),
subtask: z.boolean().optional(), subtask: z.boolean().optional(),
}) })
export type Command = z.infer<typeof Command> export type Command = z.infer<typeof Command>
@ -674,7 +672,7 @@ export namespace Config {
export const Agent = z export const Agent = z
.object({ .object({
model: z.string().optional().meta(ModelRef), model: z.string().optional(),
variant: z variant: z
.string() .string()
.optional() .optional()
@ -1045,16 +1043,11 @@ export namespace Config {
.array(z.string()) .array(z.string())
.optional() .optional()
.describe("When set, ONLY these providers will be enabled. All other providers will be ignored"), .describe("When set, ONLY these providers will be enabled. All other providers will be ignored"),
model: z model: z.string().describe("Model to use in the format of provider/model, eg anthropic/claude-2").optional(),
.string()
.describe("Model to use in the format of provider/model, eg anthropic/claude-2")
.optional()
.meta(ModelRef),
small_model: z small_model: z
.string() .string()
.describe("Small model to use for tasks like title generation in the format of provider/model") .describe("Small model to use for tasks like title generation in the format of provider/model")
.optional() .optional(),
.meta(ModelRef),
default_agent: z default_agent: z
.string() .string()
.optional() .optional()

View File

@ -1379,7 +1379,7 @@ export type PermissionConfig =
| PermissionActionConfig | PermissionActionConfig
export type AgentConfig = { export type AgentConfig = {
model?: Model model?: string
/** /**
* Default model variant for this agent (applies only when using the agent's configured model). * Default model variant for this agent (applies only when using the agent's configured model).
*/ */
@ -1421,7 +1421,6 @@ export type AgentConfig = {
permission?: PermissionConfig permission?: PermissionConfig
[key: string]: [key: string]:
| unknown | unknown
| Model
| string | string
| number | number
| { | {
@ -1651,7 +1650,7 @@ export type Config = {
template: string template: string
description?: string description?: string
agent?: string agent?: string
model?: Model model?: string
subtask?: boolean subtask?: boolean
} }
} }
@ -1689,8 +1688,14 @@ export type Config = {
* When set, ONLY these providers will be enabled. All other providers will be ignored * When set, ONLY these providers will be enabled. All other providers will be ignored
*/ */
enabled_providers?: Array<string> enabled_providers?: Array<string>
model?: Model /**
small_model?: Model * Model to use in the format of provider/model, eg anthropic/claude-2
*/
model?: string
/**
* Small model to use for tasks like title generation in the format of provider/model
*/
small_model?: string
/** /**
* Default agent to use when none is specified. Must be a primary agent. Falls back to 'build' if not set or if the specified agent is invalid. * Default agent to use when none is specified. Must be a primary agent. Falls back to 'build' if not set or if the specified agent is invalid.
*/ */

View File

@ -9028,7 +9028,7 @@
"type": "object", "type": "object",
"properties": { "properties": {
"model": { "model": {
"$ref": "#/components/schemas/Model" "type": "string"
}, },
"variant": { "variant": {
"description": "Default model variant for this agent (applies only when using the agent's configured model).", "description": "Default model variant for this agent (applies only when using the agent's configured model).",
@ -9528,7 +9528,7 @@
"type": "string" "type": "string"
}, },
"model": { "model": {
"$ref": "#/components/schemas/Model" "type": "string"
}, },
"subtask": { "subtask": {
"type": "boolean" "type": "boolean"
@ -9606,10 +9606,12 @@
} }
}, },
"model": { "model": {
"$ref": "#/components/schemas/Model" "description": "Model to use in the format of provider/model, eg anthropic/claude-2",
"type": "string"
}, },
"small_model": { "small_model": {
"$ref": "#/components/schemas/Model" "description": "Small model to use for tasks like title generation in the format of provider/model",
"type": "string"
}, },
"default_agent": { "default_agent": {
"description": "Default agent to use when none is specified. Must be a primary agent. Falls back to 'build' if not set or if the specified agent is invalid.", "description": "Default agent to use when none is specified. Must be a primary agent. Falls back to 'build' if not set or if the specified agent is invalid.",