fix(serve): let empty TOOL_PARSER/REASONING_PARSER disable the parser

Use ${VAR-default} instead of ${VAR:-default} so an explicit empty value
(e.g. REASONING_PARSER=) disables the parser rather than falling back to the
default — matching the README's documented "disable with TOOL_PARSER=''".
This commit is contained in:
Entrpi
2026-06-27 17:29:27 +10:00
parent 55c0c1702f
commit 3f05a87cdf
+2 -2
View File
@@ -70,8 +70,8 @@ python3 /host/patch_unify2.py || { [ "$NSPEC" = "0" ] && true; }
# and <think> reasoning the qwen3 parser splits into `reasoning_content`. Verified: # and <think> reasoning the qwen3 parser splits into `reasoning_content`. Verified:
# tool_choice="auto" -> tool_calls=[get_weather {"city":"Paris"}]. Disable either with # tool_choice="auto" -> tool_calls=[get_weather {"city":"Paris"}]. Disable either with
# TOOL_PARSER="" / REASONING_PARSER="", or override the name (e.g. qwen3_coder). # TOOL_PARSER="" / REASONING_PARSER="", or override the name (e.g. qwen3_coder).
TOOL_PARSER="${TOOL_PARSER:-qwen3_xml}" TOOL_PARSER="${TOOL_PARSER-qwen3_xml}"
REASONING_PARSER="${REASONING_PARSER:-qwen3}" REASONING_PARSER="${REASONING_PARSER-qwen3}"
TOOL_ARG=() TOOL_ARG=()
[ -n "$TOOL_PARSER" ] && TOOL_ARG+=(--enable-auto-tool-choice --tool-call-parser "$TOOL_PARSER") [ -n "$TOOL_PARSER" ] && TOOL_ARG+=(--enable-auto-tool-choice --tool-call-parser "$TOOL_PARSER")
[ -n "$REASONING_PARSER" ] && TOOL_ARG+=(--reasoning-parser "$REASONING_PARSER") [ -n "$REASONING_PARSER" ] && TOOL_ARG+=(--reasoning-parser "$REASONING_PARSER")