Skip to content

fix(model): provider/model specs split at first colon even when a slash comes first #802

@Basparin

Description

@Basparin

Pre-flight Checks

  • I have searched existing issues and this is not a duplicate
  • I understand this issue needs status:approved before a PR can be opened

Bug Description

Model spec strings read back from agent configs are split at the first : even when a / separator appears earlier in the string. For OpenRouter free-model specs like openrouter/qwen/qwen3.6-plus:free, this produces ProviderID=openrouter/qwen/qwen3.6-plus, ModelID=free — a broken assignment that loses the phase mapping on sync.

This is the read-path slice of #260: that issue's main symptom (the TUI/catalog writing the wrong opencode/...-free prefix via model_picker.goinject.go) is a separate write-path bug and stays tracked there. Splitting per maintainer review in PR #374 (#374 (review)), which asked to link the colon-first parse bug this PR actually fixes.

The same first-separator logic is duplicated in three places, so the bug exists in all three:

  • internal/cli/sync.go (parseModelSpec)
  • internal/components/sdd/profiles.go (extractModelFromAgent)
  • internal/components/sdd/read_assignments.go (inline parser)

Steps to Reproduce

  1. Configure an SDD phase with an OpenRouter free model: openrouter/qwen/qwen3.6-plus:free
  2. Run a sync that reads current model assignments back from the agent config
  3. Inspect the parsed ProviderID/ModelID

Expected Behavior

Split at the first separator (slash or colon, whichever comes first): ProviderID=openrouter, ModelID=qwen/qwen3.6-plus:free.

Actual Behavior

Split at the first :: ProviderID=openrouter/qwen/qwen3.6-plus, ModelID=free. The assignment no longer matches any catalog entry and the phase mapping is dropped.

Operating System

Windows

Agent / Client

Claude Code

Shell

bash

Additional Context

Fix already implemented and reviewed in PR #374 (shared SplitProviderModel helper + regression tests). This issue exists to satisfy the issue-first gate after the maintainer asked to narrow that PR's scope from Closes #260 to the parse bug only.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority:mediumMedium prioritystatus:approvedApproved for implementation — PRs can now be opened

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions