diff --git a/packages/core/test/config/provider.test.ts b/packages/core/test/config/provider.test.ts index d69881656ee..b06dccc75b7 100644 --- a/packages/core/test/config/provider.test.ts +++ b/packages/core/test/config/provider.test.ts @@ -77,7 +77,7 @@ describe("ConfigProviderPlugin.Plugin", () => { }), ) - it.effect("defaults custom models to agent capabilities", () => + it.effect("defaults custom model metadata", () => Effect.gen(function* () { const catalog = yield* Catalog.Service const providerID = Provider.ID.make("custom") @@ -100,6 +100,7 @@ describe("ConfigProviderPlugin.Plugin", () => { const model = required(yield* catalog.model.get(providerID, modelID)) expect(model.capabilities).toEqual({ tools: true, input: ["text", "image"], output: ["text"] }) + expect(model.limit).toEqual({ context: 200_000, output: 32_000 }) }), ) diff --git a/packages/schema/src/model.ts b/packages/schema/src/model.ts index a1e396f19e8..cef4b39c6df 100644 --- a/packages/schema/src/model.ts +++ b/packages/schema/src/model.ts @@ -125,7 +125,7 @@ export const Info = Schema.Struct({ cost: [], status: "active", enabled: true, - limit: { context: 0, output: 0 }, + limit: { context: 200_000, output: 32_000 }, }) satisfies Info, })), ) diff --git a/packages/schema/test/model.test.ts b/packages/schema/test/model.test.ts index 889f2e63896..642e9322985 100644 --- a/packages/schema/test/model.test.ts +++ b/packages/schema/test/model.test.ts @@ -1,6 +1,7 @@ import { describe, expect, test } from "bun:test" import { Schema } from "effect" import { Model } from "../src/model.js" +import { Provider } from "../src/provider.js" describe("Model.Ref", () => { test("parses model references with optional variants", () => { @@ -49,3 +50,11 @@ describe("Model.Compatibility", () => { }) }) }) + +describe("Model.Info", () => { + test("uses practical token limits for unknown models", () => { + const model = Model.Info.default(Provider.ID.make("custom"), Model.ID.make("gpt-5.6")) + + expect(model.limit).toEqual({ context: 200_000, output: 32_000 }) + }) +}) diff --git a/packages/www/content/docs/(Configure)/models.mdx b/packages/www/content/docs/(Configure)/models.mdx index 1ecb2f90a39..6b6d757a391 100644 --- a/packages/www/content/docs/(Configure)/models.mdx +++ b/packages/www/content/docs/(Configure)/models.mdx @@ -85,9 +85,14 @@ You can also map a friendly catalog ID to a different API model ID with `modelID ``` Here `openai/coding-default` is the selectable catalog reference, while `gpt-5.2` is sent to the provider. A model that is -not already in the catalog defaults to tool support, text and image input, and text output. Set accurate `capabilities` -and `limit` values when those defaults do not match the model or OpenCode needs to enforce its context limits. Set -`disabled: true` on a model entry to hide it from the available catalog. +not already in the catalog receives fallback metadata: + +- Tool support, text and image input, and text output. +- A 200,000-token context limit and 32,000-token output limit. The input limit remains unspecified. + +These values are assumptions, not model discovery. Configure accurate `capabilities` and `limit` values whenever they are +known; explicit values override the fallbacks. Set `disabled: true` on a model entry to hide it from the available +catalog. OpenAI-compatible models that stream reasoning through a custom assistant-message field can set `compatibility.reasoningField`: