FoolDev Claude Opus 4.7 commited on
Commit
f4e7fa4
·
1 Parent(s): 8a225df

smoke_test: assert tools capability is exposed (regression guard)

Browse files

The Modelfile TEMPLATE work (commit 80f4494) wired up tool calling by
making Ollama's capability detector see .Tools / .ToolCalls. Nothing
in CI guards against a future Modelfile change silently stripping or
breaking that TEMPLATE — the round-trip and token-leakage checks both
still pass on a TEMPLATE-less model, just without the `tools`
capability.

Hit /api/show, parse the capabilities list, fail if `tools` isn't
there. Catches the regression at make-smoke time instead of letting it
surface as a `does not support tools` 400 when someone tries to use
it.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

Files changed (2) hide show
  1. CHANGELOG.md +6 -0
  2. scripts/smoke_test.sh +20 -2
CHANGELOG.md CHANGED
@@ -39,6 +39,12 @@ and documentation**, not the underlying base model.
39
  output that motivated the stop-token fix above. The smoke test now
40
  fails hard if `<|im_start|>`, `<|im_end|>`, or `<|endoftext|>` appear
41
  verbatim in the response.
 
 
 
 
 
 
42
 
43
  ### Removed
44
  - `Modelfile.z13` and the `z13` build profile. The Z13-specific tuning
 
39
  output that motivated the stop-token fix above. The smoke test now
40
  fails hard if `<|im_start|>`, `<|im_end|>`, or `<|endoftext|>` appear
41
  verbatim in the response.
42
+ - `scripts/smoke_test.sh`: tools-capability guard. Hits `/api/show` and
43
+ asserts `tools` is in the capabilities list before running the
44
+ round-trip. Locks in the Modelfile `TEMPLATE` work — if a future
45
+ change strips or breaks the TEMPLATE so Ollama no longer detects
46
+ `.Tools` / `.ToolCalls`, `make smoke` fails before the user discovers
47
+ it via a `does not support tools` 400.
48
 
49
  ### Removed
50
  - `Modelfile.z13` and the `z13` build profile. The Z13-specific tuning
scripts/smoke_test.sh CHANGED
@@ -4,7 +4,9 @@
4
  # Verifies:
5
  # 1. The Ollama server is reachable.
6
  # 2. The target model is loaded / loadable.
7
- # 3. A single chat round-trip succeeds and produces non-empty output.
 
 
8
  #
9
  # Usage:
10
  # ./scripts/smoke_test.sh # uses MODEL=janus-27b
@@ -46,7 +48,23 @@ if ! curl -fsS "${HOST}/api/tags" | jq -e --arg m "${MODEL}" '.models[] | select
46
  fi
47
  green "[+] model present"
48
 
49
- # 3. Round-trip
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  blue "[*] sending test prompt..."
51
  RESP="$(curl -fsS "${HOST}/api/chat" \
52
  -H 'Content-Type: application/json' \
 
4
  # Verifies:
5
  # 1. The Ollama server is reachable.
6
  # 2. The target model is loaded / loadable.
7
+ # 3. The model exposes the `tools` capability (Modelfile TEMPLATE wired).
8
+ # 4. A single chat round-trip succeeds and produces non-empty output.
9
+ # 5. No chat-template control tokens leak into the response.
10
  #
11
  # Usage:
12
  # ./scripts/smoke_test.sh # uses MODEL=janus-27b
 
48
  fi
49
  green "[+] model present"
50
 
51
+ # 3. Capability guard: the Modelfile TEMPLATE must expose .Tools / .ToolCalls
52
+ # so Ollama lists `tools` under capabilities. Without it, /api/chat with a
53
+ # tools array returns 400 "does not support tools" even though plain chat
54
+ # works. Catches Modelfile regressions that strip or break the TEMPLATE.
55
+ CAPS="$(curl -fsS "${HOST}/api/show" -H 'Content-Type: application/json' \
56
+ -d "$(jq -n --arg m "${MODEL}" '{name: $m}')" | jq -r '.capabilities[]?')"
57
+ if ! grep -qx -- 'tools' <<<"${CAPS}"; then
58
+ red "[!] model missing capability: tools"
59
+ red " Modelfile likely missing TEMPLATE that references .Tools / .ToolCalls."
60
+ echo "----- present capabilities -----"
61
+ echo "${CAPS:-<none>}"
62
+ echo "--------------------------------"
63
+ exit 1
64
+ fi
65
+ green "[+] capabilities include: tools"
66
+
67
+ # 4. Round-trip
68
  blue "[*] sending test prompt..."
69
  RESP="$(curl -fsS "${HOST}/api/chat" \
70
  -H 'Content-Type: application/json' \