fix(opencode): support multiple separators for provider/model parsing to avoid getting errors #11024
+78
−8
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.
Summary
|) and colon (:) as provider/model separators inparseModel, as | is not been used on any model id from any providerDetails
Fixes #8896
The
parseModelfunction now supports three separator formats (in priorityorder):
|- unambiguous, no model IDs use it (e.g.openrouter|anthropic/ claude-3-opus):- if it appears before any slash (e.g.openrouter:anthropic/ claude-3-opus)/- default fallback (e.g.openrouter/anthropic/claude-3-opus)Also fixed YAML frontmatter parsing in
.opencode/agent/*.mdfiles wheremodel values containing colons were getting a trailing newline (using
|-instead of
|for block scalars).Testing
synthetic/hf:zai-org/GLM-4.7andamazon-bedrock/amazon.titan-text-express-v1:0:8k