Fix bare Claude model alias resolution in OpenCode converter#182
Merged
kieranklaassen merged 1 commit intoEveryInc:mainfrom Feb 13, 2026
Merged
Conversation
normalizeModel() turned bare aliases like 'haiku' into 'anthropic/haiku', which is not a valid OpenCode model ID. This caused ProviderModelNotFoundError when agents using model: haiku (e.g. learnings-researcher, lint) were invoked during workflows like /plan. Add CLAUDE_FAMILY_ALIASES map to resolve haiku, sonnet, and opus to their full model IDs (e.g. anthropic/claude-haiku-4-5). A console.warn alerts during conversion so the map can be updated when new versions release.
d3fc234 to
4132af1
Compare
Collaborator
|
THANKS! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Thank you all for this amazing plugin and especially for the port to opencode! I use this tool daily at work and it has quickly become my favorite way to do agentic coding. Appreciate Kieran, Every Inc, and all the maintainers of this awesome project.
Summary
ProviderModelNotFoundErrorwhen OpenCode invokes agents that use bare model aliases (e.g.,model: haiku)CLAUDE_FAMILY_ALIASESmap to resolvehaiku,sonnet,opusto full model IDsProblem
When using the compound-engineering plugin in OpenCode, running
/workflows:planfails with:This happens because:
learnings-researcheragent (andlintagent) usemodel: haikuin their Claude Code frontmatter -- a bare alias that Claude Code resolves internallynormalizeModel()function in the OpenCode converter turnshaikuintoanthropic/haikuvia its catch-all fallback (return \anthropic/${model}``)anthropic/claude-haiku-4-5). The bareanthropic/haikudoesn't exist in its model registryThe error occurs every time
/workflows:planruns because it always invokeslearnings-researcherin Step 1 (Local Research).Fix
Add a
CLAUDE_FAMILY_ALIASESmap tonormalizeModel()that resolves bare Claude family names (haiku,sonnet,opus) to their full model IDs before the catch-all fallback. Aconsole.warnalerts during conversion so the map can be updated when new model versions are released.Changes
src/converters/claude-to-opencode.tsCLAUDE_FAMILY_ALIASESmap and alias resolution tonormalizeModel()tests/fixtures/sample-plugin/agents/bare-alias-agent.mdmodel: haikutests/converter.test.tshaikuresolves toanthropic/claude-haiku-4-5tests/claude-parser.test.tsTest Plan
All 87 tests pass: