stage-350: fix #2178 CI — update Ollama test assertion to match new allowOllamaFormat guard

PR #2178 added an 'allowOllamaFormat' guard (resolves to false for non-ollama
@-provider prefixes like '@custom:ai_gateway') to stop the ollama label
formatter from reformatting custom-provider model IDs with dashes. The
existing test asserted on the pre-PR code shape and didn't pick up the new
guard.

Updated the assertion to match the actual post-PR code at static/ui.js:2202,
with an extended docstring explaining the bug class the guard fixes (bare
custom-provider model IDs like 'Qwen3.6-35B-A3B' had hyphens stripped to
spaces + last letter lowercased by the formatter).
This commit is contained in:
Hermes Agent
2026-05-13 20:45:44 +00:00
parent 1f9520d3f9
commit 43f86d038e
@@ -40,9 +40,14 @@ def test_get_model_label_formats_bare_ollama_ids():
"to avoid reformatting generic bare model IDs."
)
assert "const ollamaLabel = _fmtOllamaLabel(_last);" in src
assert "if ((modelId.startsWith('ollama/') || modelId.startsWith('@ollama') || looksLikeOllamaTag || looksLikeBareOllamaId) && ollamaLabel !== _last) {" in src, (
assert "if (allowOllamaFormat && (modelId.startsWith('ollama/') || modelId.startsWith('@ollama') || looksLikeOllamaTag || looksLikeBareOllamaId) && ollamaLabel !== _last) {" in src, (
"Ollama-tagged ids like 'kimi-k2.6:3b' should still pass through _fmtOllamaLabel() "
"when the formatter produces a friendlier label."
"when the formatter produces a friendlier label, but ONLY when the resolved "
"atProvider is empty or starts with 'ollama' (allowOllamaFormat guard added in "
"PR #2178 to stop reformatting non-ollama custom-provider models like "
"'custom:ai_gateway/Qwen3.6-35B-A3B'). The guard fixes the bug where bare "
"custom-provider model IDs containing dashes had their hyphens stripped to "
"spaces and their last letter lowercased by the ollama formatter."
)