Skip to content

feat: support non-factory LanguageModelV2 class exports in dynamic provider loader - #16794

Closed
coconutbird wants to merge 3 commits into
anomalyco:devfrom
coconutbird:feat/languagemodelv2-class-loader
Closed

coconutbird wants to merge 3 commits into
anomalyco:devfrom
coconutbird:feat/languagemodelv2-class-loader

Conversation

@coconutbird

@coconutbird coconutbird commented Mar 9, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #16793

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds a fallback in the dynamic provider loader for npm packages that export a LanguageModelV2 class instead of a create* factory (e.g. @augmentcode/auggie-sdk). The loader tries create* first, then falls back to duck-typing classes by checking for doGenerate/doStream on the prototype. Constructor assumption is new Class(modelId, options) — same convention risk as the existing create* path.

How did you verify your code works?

Configured @augmentcode/auggie-sdk as a custom provider in opencode.json and verified all 8 Augment models load and respond correctly via opencode run -m augment/<model> "say hello".

Screenshots / recordings

N/A — no UI changes.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Mar 9, 2026
@github-actions

github-actions Bot commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@coconutbird coconutbird mentioned this pull request Mar 9, 2026
1 task done
@coconutbird
coconutbird marked this pull request as ready for review March 9, 2026 19:39
@github-actions

Copy link
Copy Markdown
Contributor

Closing this pull request because it has had no updates for more than 60 days. If you plan to continue working on it, feel free to reopen or open a new PR.

@github-actions github-actions Bot closed this May 11, 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.

[FEATURE]: Support non-factory LanguageModelV2 class exports in dynamic provider loader

1 participant