Skip to content

fix(core): share native model defaults with v1 config migration - #45760

Merged
rekram1-node merged 2 commits into
v2from
v1-capability-defaults
Aug 28, 2026
Merged

rekram1-node merged 2 commits into
v2from
v1-capability-defaults

Conversation

@opencode-agent

@opencode-agent opencode-agent Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

V1 model configuration with only modalities.input, modalities.output, or tool_call populated the other capabilities with false and empty arrays. This could disable tools or remove supported outputs despite those fields being omitted.

  • Share one capability-default factory between native model creation and V1 config migration.
  • Use native defaults for omitted capability fields: tools enabled, text/image input, and text output.
  • Preserve explicit values, including tool_call: false and empty modality arrays. Leave wholly omitted capabilities unset so existing catalog inheritance is unchanged.

Regression coverage

Compare complete catalog models through normalization and the real config-provider path, not only schema validity:

  • Seven capability-default and explicit-override cases.
  • Inherited provider SDK, endpoint, headers, and body without repeating them per model.
  • Model-specific SDK/endpoint, ID, name, limits, costs, and ordinary variant overrides, including applying the selected variant.
  • Explicit zero pricing and defaulted cache costs.
  • Preservation of existing catalog metadata when V1 fields are omitted.

This fixes capability defaults; it does not change disabled-variant handling or claim request-level provider compatibility is fully audited.

Validation

  • Before the fix: five of seven capability parity cases failed.
  • After the fix: 81 scoped Core tests and four Schema config tests pass.
  • Core typecheck passes with bun typecheck --singleThreaded (the parallel compiler hit the shared host thread limit).
  • Schema typecheck, Prettier, and git diff --check pass.

Requested by: @rekram1-node (Aiden via Slack)

@rekram1-node
rekram1-node enabled auto-merge (squash) August 28, 2026 00:25
@rekram1-node
rekram1-node disabled auto-merge August 28, 2026 00:25
@rekram1-node
rekram1-node merged commit d5be4cf into v2 Aug 28, 2026
9 of 10 checks passed
@rekram1-node
rekram1-node deleted the v1-capability-defaults branch August 28, 2026 00:25
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant