Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,7 @@
"@types/bun": "catalog:",
"@types/node": "catalog:"
},
"patchedDependencies": {}
"patchedDependencies": {
"@standard-community/standard-openapi@0.2.9": "patches/@standard-community%2Fstandard-openapi@0.2.9.patch"
}
}
13 changes: 6 additions & 7 deletions packages/opencode/src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ import { proxied } from "@/util/proxied"
import { iife } from "@/util/iife"

export namespace Config {
const ModelId = z.string().meta({ $ref: "https://models.dev/model-schema.json#/$defs/Model" })

const log = Log.create({ service: "config" })

// Managed settings directory for enterprise deployments (highest priority, admin-controlled)
Expand Down Expand Up @@ -653,7 +655,7 @@ export namespace Config {
template: z.string(),
description: z.string().optional(),
agent: z.string().optional(),
model: z.string().optional(),
model: ModelId.optional(),
subtask: z.boolean().optional(),
})
export type Command = z.infer<typeof Command>
Expand All @@ -669,7 +671,7 @@ export namespace Config {

export const Agent = z
.object({
model: z.string().optional(),
model: ModelId.optional(),
variant: z
.string()
.optional()
Expand Down Expand Up @@ -1040,11 +1042,8 @@ export namespace Config {
.array(z.string())
.optional()
.describe("When set, ONLY these providers will be enabled. All other providers will be ignored"),
model: z.string().describe("Model to use in the format of provider/model, eg anthropic/claude-2").optional(),
small_model: z
.string()
.describe("Small model to use for tasks like title generation in the format of provider/model")
.optional(),
model: ModelId.describe("Model to use in the format of provider/model, eg anthropic/claude-2").optional(),
small_model: ModelId.describe("Small model to use for tasks like title generation in the format of provider/model").optional(),
default_agent: z
.string()
.optional()
Expand Down
16 changes: 16 additions & 0 deletions patches/@standard-community%2Fstandard-openapi@0.2.9.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/dist/vendors/convert.js b/dist/vendors/convert.js
index 0d615eebfd7cd646937ec1b29f8332db73586ec1..7b146f903c07a9377d676753691cba67781879be 100644
--- a/dist/vendors/convert.js
+++ b/dist/vendors/convert.js
@@ -74,7 +74,10 @@ function convertToOpenAPISchema(jsonSchema, context) {
$ref: `#/components/schemas/${id}`
};
} else if (_jsonSchema.$ref) {
- const { $ref, $defs } = _jsonSchema;
+ const { $ref, $defs, ...rest } = _jsonSchema;
+ if ($ref.includes("://")) {
+ return Object.keys(rest).length > 0 ? rest : { type: "string" };
+ }
const ref = $ref.split("/").pop();
context.components.schemas = {
...context.components.schemas,
Loading