From 59cee65da3c19e91f4aad4781c4051d2eae8be7b Mon Sep 17 00:00:00 2001 From: Niko1221 Date: Sat, 17 Oct 2026 07:00:49 +0200 Subject: [PATCH] serve tests: the refused-prompt test runs in strict mode (fit_max_tokens off) so a huge max_tokens is refused, not shortened --- serve/test_prompt_encoder.py | 1 + 1 file changed, 1 insertion(+) diff --git a/serve/test_prompt_encoder.py b/serve/test_prompt_encoder.py index 36cc06f2..897ddd67 100644 --- a/serve/test_prompt_encoder.py +++ b/serve/test_prompt_encoder.py @@ -116,6 +116,7 @@ class Served(unittest.TestCase): def test_a_refused_prompt_is_not_kept(self): svc = self.service(max_context=4096) + svc.fit_max_tokens = False # the strict mode refuses an over-long max_tokens (the default now shortens it) msgs = [{"role": "user", "content": "kept " * 20}] svc.prepare(msgs, None, {}, 16) refused = msgs + [{"role": "assistant", "content": "a"}, {"role": "user", "content": "more " * 20}]