Skip to content

qwen3coder tool parser keeps quotes around parameter names (<parameter="command"> → key "\"command\"") #4487

Description

@lusoris

Component: src/llm/io_processing/qwen3coder/qwen3coder_tool_parser.cpp (OVMS 2026.4.0, --tool_parser qwen3coder).

Observed: when the model emits the parameter tag with a quoted name, e.g.

<parameter="command">ls -la /tmp</parameter>

the parser takes the raw substring between <parameter= and > as the argument key (State::InsideParameterName), so the resulting tool call arguments are {"\"command\"": "ls -la /tmp"} — a key that includes the literal quotes. Clients validating arguments against the tool's JSON schema then reject the call (Missing key at ["command"]). In a fleet of coding agents on Qwen3.8-27B / Qwen3-9B variants this accounted for about a third of all schema-invalid tool calls (54 of 171 in 600 recent runs); the model produces the quoted form intermittently.

Expected: the parameter name should be trimmed of surrounding whitespace and matching single/double quotes before use, i.e. <parameter="command"> and <parameter='command'> should both yield the key command. A related lenient case seen in the same logs: <parameter=command: create -p ...> (the model puts : inside the name tag) — probably out of scope, but worth a note.

Repro shape: any request with tools where the model output contains <tool_call><function=bash><parameter="command">…</parameter></function></tool_call>.

I can send a PR (trim + tests) if that is the preferred fix; a client-side normalisation is in place on our side meanwhile.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions