Skip to content

refactor(schema): separate provider and model settings - #49850

Merged
rekram1-node merged 1 commit into
v2from
schema-audit
Sep 19, 2026
Merged

rekram1-node merged 1 commit into
v2from
schema-audit

Conversation

@rekram1-node

Copy link
Copy Markdown
Collaborator

Summary

Split provider and model settings into distinct public contracts while preserving open-ended provider-package options.

type ProviderSettings = {
  timeout?: number | false
  chunkTimeout?: number
  compaction?: { type: "summary" } | { type: "native" }
  transport?: "http" | "websocket"
} & Record<string, any>

type ModelSettings = {
  compaction?: { type: "summary" } | { type: "native" }
} & Record<string, any>
  • timeout, chunkTimeout, and transport are provider-only OpenCode policies.
  • compaction remains shared: providers supply a default and models or variants may override it.
  • Arbitrary provider-package settings remain available on providers, models, and variants.
  • Core filters provider-only keys from model and variant overlays, then combines the provider and model settings only when constructing the runtime model.
  • OpenAI, xAI, and Azure WebSocket defaults now live on provider settings.
  • Client types, Protocol OpenAPI, website OpenAPI copies, configuration schema, tests, and documentation are regenerated.

Resolution

provider settings
├── timeout          provider only
├── chunkTimeout     provider only
├── transport        provider only
├── compaction       inherited by model
└── loose options    inherited by model
                       ↓
model settings
├── compaction       overrides provider
└── loose options    override provider
                       ↓
variant settings
├── compaction       overrides model
└── loose options    override model

The open index signature can accept any provider-defined key, including a spelling that matches an OpenCode policy. Core therefore explicitly removes timeout, chunkTimeout, and transport from model and variant overlays so only provider values control those behaviors.

Verification

  • bun run check
  • bun test in packages/schema — 64 passing
  • focused Core provider, model, resolver, AI SDK, configuration, and built-in provider suites passing
  • generated checks in packages/client, packages/protocol, and services/www
  • bun run build in services/www

E2E tests were not run locally.

@rekram1-node
rekram1-node merged commit cbd9113 into v2 Sep 19, 2026
9 of 10 checks passed
@rekram1-node
rekram1-node deleted the schema-audit branch September 19, 2026 02:20
jinhuang712 pushed a commit to jinhuang712/opencode that referenced this pull request Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant