Skip to content

fix(agents): preserve 3-segment model IDs (lmstudio/qwen/model-name)#772

Merged
zaxbysauce merged 4 commits intomainfrom
copilot/fix-local-agent-spawning-issue
May 6, 2026
Merged

fix(agents): preserve 3-segment model IDs (lmstudio/qwen/model-name)#772
zaxbysauce merged 4 commits intomainfrom
copilot/fix-local-agent-spawning-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 6, 2026

Any model ID with 3+ slash-separated segments was unconditionally treated as provider/model/variant — the last segment was stripped and injected as the variant field. LM Studio model IDs like lmstudio/qwen/qwen3.6-35b-a3b were silently rewritten to model: "lmstudio/qwen" + variant: "qwen3.6-35b-a3b", causing ProviderModelNotFoundError at spawn time.

Changes

  • src/agents/index.ts — adds KNOWN_VARIANT_VALUES = new Set(['low', 'medium', 'high', 'max', 'xhigh', 'thinking']). The auto-split in applyOverrides() now only fires when the trailing segment is a known reasoning-effort token:

    // Before — strips ANY third segment
    if (modelSegments.length >= 3) {  }
    
    // After — only strips known variant tokens
    const hasEmbeddedVariant =
      modelSegments.length >= 3 && KNOWN_VARIANT_VALUES.has(lastSegment);
    if (hasEmbeddedVariant) {  }
  • src/config/schema.ts — updates the variant field comment to document the whitelist behaviour and the LM Studio counter-example.

  • docs/configuration.md — updates the variant field description to list all six known tokens.

  • docs/releases/v7.5.3.md — release notes for the fix.

  • tests/unit/agents/factory.test.ts — adds three regression tests:

    • lmstudio/qwen/qwen3.6-35b-a3b is passed through unchanged
    • multiple LM Studio agents in one config all preserve their full paths
    • low, medium, high, max, xhigh, thinking still trigger the deprecation split (backward compat preserved), including a 4-segment model (gateway/ns/gpt-5.3-codex/medium)

Scope note

Commit b739e80c was cherry-picked from the already-merged PR #773, which broadened the variant allowlist with max and xhigh and added the 4-segment split test case.

Only auto-split the last slash-segment as a reasoning-effort variant when it
matches a known variant token (low/medium/high/thinking). Model IDs with a
genuine third path component such as lmstudio/qwen/qwen3.6-35b-a3b are no
longer truncated, fixing the ProviderModelNotFoundError reported in the issue.

Adds KNOWN_VARIANT_VALUES set in src/agents/index.ts, updates the variant
field comment in src/config/schema.ts, and adds three regression tests in
tests/unit/agents/factory.test.ts.

Agent-Logs-Url: https://github.com/zaxbysauce/opencode-swarm/sessions/9d86d583-f437-4748-9eb4-86f8d645b02b

Co-authored-by: zaxbysauce <10211642+zaxbysauce@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix local agent spawning issue in Swarm fix(agents): preserve 3-segment model IDs (lmstudio/qwen/model-name) May 6, 2026
Copilot AI requested a review from zaxbysauce May 6, 2026 12:13
Copilot AI and others added 2 commits May 6, 2026 08:56
…hile preserving multi-segment model IDs (#773)

* chore: plan variant whitelist broadening

Agent-Logs-Url: https://github.com/zaxbysauce/opencode-swarm/sessions/873d035c-d227-478a-89e0-a455910e5b06

Co-authored-by: zaxbysauce <10211642+zaxbysauce@users.noreply.github.com>

* fix(agents): include max and xhigh in embedded variant allowlist

Agent-Logs-Url: https://github.com/zaxbysauce/opencode-swarm/sessions/873d035c-d227-478a-89e0-a455910e5b06

Co-authored-by: zaxbysauce <10211642+zaxbysauce@users.noreply.github.com>

* test(agents): cover max/xhigh variants and 4-segment split semantics

Agent-Logs-Url: https://github.com/zaxbysauce/opencode-swarm/sessions/873d035c-d227-478a-89e0-a455910e5b06

Co-authored-by: zaxbysauce <10211642+zaxbysauce@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: zaxbysauce <10211642+zaxbysauce@users.noreply.github.com>
@zaxbysauce zaxbysauce marked this pull request as ready for review May 6, 2026 13:32
@zaxbysauce zaxbysauce merged commit 8664008 into main May 6, 2026
12 checks passed
@zaxbysauce zaxbysauce deleted the copilot/fix-local-agent-spawning-issue branch May 6, 2026 13:32
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.

[Bug] Local Agent Spawning Issue in Swarm (lmstudio)

2 participants