Tool calling serializes boolean arguments as strings with Qwen3.5 ("True" instead of true)

Aperta
#750 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
65/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
json, python
Ambito
ai, backend

Direzione di ricerca

The issue is in the tool-call argument conversion/serialization step. Look at the code that parses the model's raw tool output (like <parameter=accepted>\nTrue\n</parameter>) and converts it to JSON. The bug likely resides where string values are not coerced to the declared JSON Schema type (boolean). Start by searching for functions handling tool argument serialization in the codebase, then write a test using the provided curl command to verify the fix produces {"accepted":true}.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Description

FastFlowLM v1.0.6 serializes a tool argument defined as JSON Schema
boolean as a JSON string when using qwen3.5:9b.

The tool schema explicitly defines:

"accepted": {
"type": "boolean"
}

However, FastFlowLM returns:

{"accepted":"True"}

instead of:

{"accepted":true}

This causes OpenAI-compatible clients that validate tool arguments
against the supplied JSON Schema to reject the tool call.

Environment

FastFlowLM: v1.0.6

Model: qwen3.5:9b

Linux portable build: fastflowlm_1.0.6_linux.tar.gz

API: /v1/chat/completions

Minimal reproducer

curl -s http://127.0.0.1:8000/v1/chat/completions
-H 'Content-Type: application/json'
-d '{"model":"qwen3.5:9b","stream":false,"messages":[{"role":"user","content":"Call confirm_result with accepted set to true."}],"tools":[{"type":"function","function":{"name":"confirm_result","description":"Confirm the result","parameters":{"type":"object","properties":{"accepted":{"type":"boolean"}},"required":["accepted"]}}}],"tool_choice":{"type":"function","function":{"name":"confirm_result"}}}'

Actual result

FastFlowLM returns the tool arguments as:

"arguments":"{"accepted":"True"}"

Decoded:

{
"accepted": "True"
}

The value is a JSON string.

Expected result

The tool arguments should preserve the type specified by the JSON
Schema:

"arguments":"{"accepted":true}"

Decoded:

{
"accepted": true
}

The value should be a JSON boolean.

Additional information

The model's raw tool output contains:

<parameter=accepted>
True

FastFlowLM then converts this to:

{"accepted":"True"}

So it appears that the tool-call argument conversion/serialization step
does not coerce the generated value according to the parameter type
declared in the supplied tool JSON Schema.

This is reproducible with a minimal request and does not require a large
context or a multi-turn conversation.

Lingua principale
C++
Stelle
2.1k
Fork
184
Merge medio
12h 22m
PR unite (30g)
239

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ROCm/FastFlowLM

Tutte le issue di ROCm/FastFlowLM

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.