Fix JSON serialization of scalar tool arguments in qwen3_5_fixed.jinja
Problem
The current Qwen3.5 template serializes non-container tool arguments with |string. As a result, native scalar values are rendered as Python literals:
None -> None
True -> True
False -> False
Valid JSON should use null, true, and false. This can produce malformed tool-call history whenever messages are fully rendered by the chat template. Pure TITO append-only rollout normally reuses the model's original token IDs, so its normal append path is not directly affected; history re-rendering, fallback/reset paths, non-TITO use, and SFT can be affected.
This is also described in vLLM issue #38885, and Qwen3.6 uses the corrected serialization.
Suggested fix
- args_value | tojson|safe if args_value is mapping or (args_value is sequence and args_value is not string) else args_value | string
+ args_value | string if args_value is string else args_value | tojson|safe
The same change should be applied to other copied Qwen3.5 templates that use this serializer, with a small test covering None, True, False, strings, lists, and mappings.
Fix JSON serialization of scalar tool arguments in
qwen3_5_fixed.jinjaProblem
The current Qwen3.5 template serializes non-container tool arguments with
|string. As a result, native scalar values are rendered as Python literals:Valid JSON should use
null,true, andfalse. This can produce malformed tool-call history whenever messages are fully rendered by the chat template. Pure TITO append-only rollout normally reuses the model's original token IDs, so its normal append path is not directly affected; history re-rendering, fallback/reset paths, non-TITO use, and SFT can be affected.This is also described in vLLM issue #38885, and Qwen3.6 uses the corrected serialization.
Suggested fix
The same change should be applied to other copied Qwen3.5 templates that use this serializer, with a small test covering
None,True,False, strings, lists, and mappings.