[PR #11024] fix(opencode): support multiple separators for provider/model parsing to avoid getting errors #13631

Closed
opened 2026-02-16 18:18:28 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/11024

State: closed
Merged: No


Summary

  • Add pipe (|) and colon (:) as provider/model separators in parseModel , as | is not been used on any model id from any provider
  • Fix YAML frontmatter to strip trailing newlines for values with colons

Details
Fixes https://github.com/anomalyco/opencode/issues/8896

The parseModel function now supports three separator formats (in priority
order):

  1. Pipe | - unambiguous, no model IDs use it (e.g. openrouter|anthropic/ claude-3-opus)
  2. Colon : - if it appears before any slash (e.g. openrouter:anthropic/ claude-3-opus)
  3. Slash / - default fallback (e.g. openrouter/anthropic/claude-3-opus)

Also fixed YAML frontmatter parsing in .opencode/agent/*.md files where
model values containing colons were getting a trailing newline (using |-
instead of | for block scalars).

Testing

  • Added tests for all separator formats
  • Tested with complex model IDs like synthetic/hf:zai-org/GLM-4.7 and
    amazon-bedrock/amazon.titan-text-express-v1:0:8k
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/11024 **State:** closed **Merged:** No --- Summary - Add pipe (`|`) and colon (`:`) as provider/model separators in `parseModel` , as | is not been used on any model id from any provider - Fix YAML frontmatter to strip trailing newlines for values with colons Details Fixes https://github.com/anomalyco/opencode/issues/8896 The `parseModel` function now supports three separator formats (in priority order): 1. Pipe `|` - unambiguous, no model IDs use it (e.g. `openrouter|anthropic/ claude-3-opus`) 2. Colon `:` - if it appears before any slash (e.g. `openrouter:anthropic/ claude-3-opus`) 3. Slash `/` - default fallback (e.g. `openrouter/anthropic/claude-3-opus`) Also fixed YAML frontmatter parsing in `.opencode/agent/*.md` files where model values containing colons were getting a trailing newline (using `|-` instead of `|` for block scalars). Testing - Added tests for all separator formats - Tested with complex model IDs like `synthetic/hf:zai-org/GLM-4.7` and `amazon-bedrock/amazon.titan-text-express-v1:0:8k`
yindo added the pull-request label 2026-02-16 18:18:28 -05:00
yindo closed this issue 2026-02-16 18:18:28 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13631