GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(core): respell inherited variants when config changes a provider's package by rekram1-node · Pull Request #55979 · anomalyco/opencode

Conversation

@rekram1-node

@rekram1-node rekram1-node commented Oct 16, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Fixes #55226

Summary

When config overrides a provider's package, catalog models that inherit the provider's package now get reasoning variants for the new package. #55962 handled a package set on a single model; this covers the provider-level case.

Reported case: the zai provider pointed at @opencode/ai/providers/anthropic. glm-5.3 kept its Chat-style catalog variants (thinking: { type: "enabled", clear_thinking: false } plus reasoningEffort), so zai/glm-5.3#low failed locally with Missing key at ["thinking"]["budgetTokens"] before any request was sent.

Change

  • The config plugin records each provider's package from before the override.
  • Before any document's model config is applied, every model whose package comes from an overridden provider gets its variants rebuilt for the new package (only models that have variants).
  • Variants configured in any config file then overlay that new set, the same way they overlay catalog variants. So a variant set in the global config survives a package override from the project config.
  • The per-model check from fix(core): respell variants when config changes a catalog model's package #55962 now compares effective packages (model.package ?? provider.package). That also covers a model listed in the same file as a provider-level override.
  • Models with their own package, and models without variants, are unchanged.

Testing

  • New config plugin tests:
    • A provider-level override respells an inherited model's variants; a model with its own package keeps its variants. Fails on dev.
    • Variants configured in one file (the budgetTokens workaround from Catalog variants are not package-aware: overriding a provider's package breaks built-in variants #55226) survive a package override from a later file. Fails on dev and on this PR's first version.
  • Reporter's setup through the dev CLI, using the real catalog zai/glm-5.3, the provider package set to @opencode/ai/providers/anthropic, and a local server that records requests:
    • dev: fails locally with Missing key; no request is sent.
    • This branch: sends thinking: { type: "adaptive" } plus output_config.effort: "low".
    • The z.ai account's plan has expired, so I couldn't confirm against the real z.ai endpoint.
  • bun run check passes. Full core suite: the same 8 shell/environment failures as on clean dev, no new ones.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
opencode-agent[bot]
opencode-agent Bot reviewed Oct 16, 2026
View reviewed changes

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes the reported case: on the base, zai/glm-5.3#low with the provider package set to Anthropic fails locally with Missing key at ["thinking"]["budgetTokens"]. With this PR it sends an Anthropic request to the mock endpoint. I ran the #55226 repro script from source in both checkouts, plus the config provider tests (new test fails on base, passes here) and typecheck in packages/core.

Public API is unchanged: no new config keys, only how existing config is applied.

One concern, inline: variants a user sets in a different config file from the package override get overwritten.

Related: #53756

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/core/src/config/plugin/provider.ts Outdated
if (item.package === undefined || providerPackage === definition.previousPackage) continue
for (const model of models.list(providerID)) {
if (model.package !== undefined || model.variants.length === 0) continue
if (item.models?.[model.id]?.variants !== undefined) continue

@opencode-agent opencode-agent Bot Oct 16, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only skips models whose variants are set in the same document as the package override. If one document sets models.glm-5.3.variants (e.g. the global config, using the budgetTokens workaround from #55226) and a later one (e.g. the project config) sets the provider's package, the first document's variants get merged in its own iteration. This loop then replaces them with the generated ladder. I confirmed it with a two-document test: the configured budgetTokens variant came back as { thinking: { type: "adaptive" }, effort: "low" }. Could the respell run once per provider before any configured model variants are merged? Or skip models that have variants configured in any document.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
rekram1-node added 2 commits October 16, 2026 12:34
@rekram1-node
fix(core): respell inherited variants when config changes a provider'…
5527e91
…s package
@rekram1-node
fix(core): respell provider-package variants before configured varian…
7349124
…ts overlay them
@rekram1-node
rekram1-node force-pushed the provider-package-variants branch from 9006852 to 7349124 Compare October 16, 2026 17:42
@opencode-agent opencode-agent Bot mentioned this pull request Oct 23, 2026
fix(core): subagent model package incorrectly overridden by provider package #58499
Closed
@opencodejr opencodejr Bot mentioned this pull request Oct 28, 2026
fix(core): don't clobber model variants supplied by earlier transforms #59835
Open
3 tasks done
This was referenced Oct 29, 2026
fix(core): preserve plugin-supplied model variants #60097
Merged
refactor(core): resolve configured model variants once across config layers #60425
Closed
@github-actions

github-actions Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot closed this Nov 16, 2026
@github-actions github-actions Bot added the automated-pr-cleanup label Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@opencode-agent opencode-agent[bot] opencode-agent[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

automated-pr-cleanup

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Catalog variants are not package-aware: overriding a provider's package breaks built-in variants

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@rekram1-node
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.