From 43f86d038e2d4538c19df74dc6d88202e3760cb1 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Wed, 13 May 2026 20:45:44 +0000 Subject: [PATCH] =?UTF-8?q?stage-350:=20fix=20#2178=20CI=20=E2=80=94=20upd?= =?UTF-8?q?ate=20Ollama=20test=20assertion=20to=20match=20new=20allowOllam?= =?UTF-8?q?aFormat=20guard?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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). --- tests/test_ollama_model_chip_label_regression.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/test_ollama_model_chip_label_regression.py b/tests/test_ollama_model_chip_label_regression.py index 51a1a5d1..ca024a58 100644 --- a/tests/test_ollama_model_chip_label_regression.py +++ b/tests/test_ollama_model_chip_label_regression.py @@ -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." )