Skip to content

IOP issue with LM Studio + Qwen3.8 27b Splash model #53524

Open

Description

@beterhans

Description

on opencode it always shows error
Engine protocol promptTemplating capability gap for 'splash-server': Splash does not support assistant response prefill/continuation.

on LM Studio log
2026-10-06 18:26:44 [INFO]
[qwen3.8-27b-splash] Running chat completion on conversation with 62 messages.
2026-10-06 18:26:44 [INFO]
[qwen3.8-27b-splash] Streaming response...
2026-10-06 18:26:44 [ERROR]
[qwen3.8-27b-splash] Engine protocol promptTemplating capability gap for 'splash-server': Splash does not support assistant response prefill/continuation.. Error Data: n/a, Additional Data: n/a
2026-10-06 18:26:53 [INFO]
[qwen3.8-27b-splash] Running chat completion on conversation with 62 messages.
2026-10-06 18:26:53 [INFO]
[qwen3.8-27b-splash] Streaming response...
2026-10-06 18:26:53 [ERROR]
[qwen3.8-27b-splash] Engine protocol promptTemplating capability gap for 'splash-server': Splash does not support assistant response prefill/continuation.. Error Data: n/a, Additional Data: n/a

AI tried to suggest a workaround by disable opencode's assistant prefill
"name": "Qwen3.8-27B-Splash",
"chat_template_kwargs": {
"enable_thinking": false
}

but it's not working

AI Summary
OpenCode + LM Studio Qwen3.8-27B-Splash: assistant prefill/continuation not supported
Environment
OpenCode: v2.0.24
OS: macOS
Model: Qwen3.8-27B-Splash
Backend: LM Studio
API: OpenAI-compatible /v1/chat/completions
Problem

OpenCode works normally with the Splash model for many requests, but eventually sends a request that LM Studio rejects because it contains an assistant response prefill/continuation.

LM Studio reports:

Engine protocol promptTemplating capability gap for 'splash-server':
Splash does not support assistant response prefill/continuation.

The failure appears after the conversation reaches a certain number of messages. For example:

59 messages → successful
62 messages → failed
62 messages → failed again

The failure is reproducible in the same session once OpenCode reaches this state.

OpenCode configuration

I tried disabling assistant prefill in the model configuration:

"capabilities": {
"assistantPrefill": false
}

However, this does not prevent the problematic request.

I also changed the provider to:

"npm": "@ai-sdk/openai-compatible"

instead of @ai-sdk/openai, but the problem remains.

Additional investigation

I searched the OpenCode 2.0.24 application bundle for assistantPrefill and prefill, but found no matching implementation/configuration strings.

The normal requests work correctly; the failure only occurs when OpenCode generates the assistant continuation/prefill request.

Expected behavior

For models that do not support assistant response prefill, OpenCode should either:

Avoid sending assistant-prefill/continuation requests, or
Provide a model/provider compatibility option to disable this behavior.
Question

Is there currently a supported configuration option or workaround to prevent OpenCode from generating assistant-prefill/continuation requests for models such as Qwen3.8-27B-Splash?

If not, could OpenCode detect this model capability and avoid the continuation request?

Thank you.

Plugins

No response

OpenCode version

2.0.24

Steps to reproduce

Run LM Studio on macOS and load Qwen3.8-27B-Splash.

Enable the OpenAI-compatible API endpoint, for example:

http://localhost:12345/v1
Configure OpenCode v2.0.24 to use the LM Studio provider with Qwen3.8-27B-Splash.
Start a new OpenCode agent session using the Splash model.
Continue the session normally for multiple agent turns.
After the conversation reaches around 60+ messages, continue the agent.
OpenCode sends a request containing an assistant continuation/prefill.

LM Studio rejects the request with:

Engine protocol promptTemplating capability gap for 'splash-server':
Splash does not support assistant response prefill/continuation.

The same session can reproduce the failure repeatedly once it reaches this state.

Screenshot and/or share link

No response

Operating System

macOS 27.0.1

Terminal

GUI

Activity

  1. github-actions commented on Oct 6, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    • #46415: similar assistant-prefill continuation sent to a provider that rejects it after a completed response.
    • #19981: tracks avoiding assistant-prefill payloads for models and providers that do not support them.
  2. opencodejr commented on Oct 27, 2026

    @opencodejr
    Contributor

    Thanks for the detailed report and the LM Studio logs. I could reproduce this on 2.0.24 when the agent has a step limit (steps, or the older maxSteps, in the agent config). It still happens on the latest dev (f7d0ce133).

    When an agent reaches its step limit, OpenCode adds a final "maximum steps reached" instruction as an assistant message at the end of the request. LM Studio's Splash engine treats a final assistant message as prefill and rejects it.

    The script below uses a mock server that acts like LM Studio in this respect. With steps: 3, the last request goes from 4 to 7 messages and ends with that assistant message, and OpenCode shows the same error you saw. That matches your 59 → 62 jump. Without a step limit, every request ended with a user or tool message and the session finished normally.

    A few notes:

    • Could you check whether your agent config (or the agent you use) sets steps or maxSteps? If it does, removing it or raising it should avoid the error for now. If it doesn't, please tell us, because that would mean another code path is involved.
    • v2 has no capabilities.assistantPrefill option, and the npm provider field doesn't change how v2 builds these requests, so those settings can't help here. chat_template_kwargs.enable_thinking is unrelated.

    I've passed this to the maintainers.

    Reproduction script (repro.sh)
    #!/usr/bin/env bash
    # Reproduces #53524: when an agent hits its `steps` limit, OpenCode v2 appends the
    # MAX_STEPS_PROMPT as a trailing *assistant* message (assistant prefill). LM Studio's
    # Splash engine rejects such requests. A mock OpenAI-compatible server stands in for
    # LM Studio: it rejects requests whose last message is from the assistant and logs every request.
    # Needs: bun, and `opencode` on PATH (bun add -g @opencode/[email protected]).
    set -euo pipefail
    W=$(mktemp -d); cd "$W"
    cat > mock.ts <<'EOF'
    const sse = (c: unknown[]) => new Response(c.map((x) => `data: ${JSON.stringify(x)}\n\n`).join("") + "data: [DONE]\n\n", { headers: { "content-type": "text/event-stream" } })
    Bun.serve({ port: 12345, async fetch(req) {
      if (new URL(req.url).pathname.endsWith("/models")) return Response.json({ data: [{ id: "qwen3.8-27b-splash" }] })
      const b: any = await req.json(); const m = b.messages; const last = m.at(-1)
      console.log(`messages=${m.length} roles=${m.map((x: any) => x.role[0]).join("")} last=${last.role} tool_choice=${JSON.stringify(b.tool_choice)}`)
      if (last.role === "assistant") { console.log("  REJECTED trailing assistant:", JSON.stringify(last.content).slice(0, 60))
        return Response.json({ error: "Engine protocol promptTemplating capability gap for 'splash-server': Splash does not support assistant response prefill/continuation." }, { status: 400 }) }
      const base = { id: "x", object: "chat.completion.chunk", created: 0, model: b.model }
      if (b.tools?.some((t: any) => t.function.name === "glob") && b.tool_choice !== "none")
        return sse([{ ...base, choices: [{ index: 0, delta: { role: "assistant", tool_calls: [{ index: 0, id: `c${Math.random()}`, type: "function", function: { name: "glob", arguments: '{"pattern":"*"}' } }] }, finish_reason: null }] },
                    { ...base, choices: [{ index: 0, delta: {}, finish_reason: "tool_calls" }] }])
      return sse([{ ...base, choices: [{ index: 0, delta: { role: "assistant", content: "Done." }, finish_reason: "stop" }] }])
    } })
    EOF
    mkdir proj home; echo hi > proj/hello.txt
    cat > proj/opencode.json <<'EOF'
    {
      "provider": { "lmstudio": { "npm": "@ai-sdk/openai-compatible", "options": { "baseURL": "http://127.0.0.1:12345/v1", "apiKey": "x" },
        "models": { "qwen3.8-27b-splash": { "name": "Qwen3.8-27B-Splash" } } } },
      "agent": { "capped": { "mode": "primary", "steps": 3 } }
    }
    EOF
    bun mock.ts > mock.log 2>&1 & MOCK=$!; trap 'kill $MOCK' EXIT; sleep 1
    cd proj
    HOME=$W/home XDG_CONFIG_HOME=$W/home/.config XDG_DATA_HOME=$W/home/.data \
      timeout 120 opencode run --standalone --auto --agent capped -m lmstudio/qwen3.8-27b-splash "list files" || true
    echo "--- requests seen by the mock LM Studio ---"; cat ../mock.log

    Run it: bash repro.sh

  3. noahnao commented on Nov 1, 2026

    @noahnao

    Please fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions