From c556d649b7adc057626a54a7d2b52c763507b5f9 Mon Sep 17 00:00:00 2001 From: nesquena-hermes <[email protected]> Date: Tue, 2 Jun 2026 21:14:49 +0000 Subject: [PATCH 1/2] fix: strip @provider: prefix from auxiliary title_generation model id (#3430, @pamnard) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Manual title regeneration (POST /api/session/title/regenerate) and background aux title generation failed with 422 / llm_error_aux when auxiliary.title_generation.model in config.yaml used the WebUI-internal @provider:model picker format (e.g. @gemini:gemini-3.1-flash-lite) — the raw @-qualified id was forwarded to the provider API verbatim. Normalize it through the canonical _split_webui_provider_model_value() helper before the aux call. Co-authored-by: pamnard --- api/streaming.py | 11 +++++++++++ tests/test_title_aux_routing.py | 35 +++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/api/streaming.py b/api/streaming.py index 612daf81..b1ed9221 100644 --- a/api/streaming.py +++ b/api/streaming.py @@ -1801,6 +1801,17 @@ def generate_title_raw_via_aux( provider = '' model = model or configured.get('model', '') or '' base_url = base_url or configured.get('base_url', '') or '' + try: + from api.profiles import _split_webui_provider_model_value + + normalized_model, normalized_provider = _split_webui_provider_model_value( + model or None, + provider or None, + ) + model = normalized_model or '' + provider = normalized_provider or '' + except ValueError: + pass api_key = '' if not caller_supplied_route: api_key = str(configured.get('api_key', '') or '').strip() diff --git a/tests/test_title_aux_routing.py b/tests/test_title_aux_routing.py index 816314f5..dbd05b7c 100644 --- a/tests/test_title_aux_routing.py +++ b/tests/test_title_aux_routing.py @@ -109,6 +109,41 @@ class TestGenerateTitleRawViaAuxTimeout(unittest.TestCase): 30.0, ) + def test_webui_prefixed_model_id_is_stripped_before_aux_call(self): + """Regression: @provider:model picker ids must not reach provider APIs verbatim.""" + from api.streaming import generate_title_raw_via_aux + + mock_resp = types.SimpleNamespace( + choices=[ + types.SimpleNamespace( + message=types.SimpleNamespace(content='Gemini Title'), + finish_reason='stop', + ) + ] + ) + captured = {} + + def fake_call_llm(**kwargs): + captured.update(kwargs) + return mock_resp + + tg_config = { + 'provider': 'gemini', + 'model': '@gemini:gemini-3.1-flash-lite', + 'base_url': '', + } + with _patch_tg_config(tg_config): + with patch('agent.auxiliary_client.call_llm', side_effect=fake_call_llm, create=True): + result, status = generate_title_raw_via_aux( + user_text='Как настроить title generation?', + assistant_text='Нужно указать auxiliary.title_generation в config.yaml.', + ) + + self.assertEqual(result, 'Gemini Title') + self.assertEqual(status, 'llm_aux') + self.assertEqual(captured.get('provider'), 'gemini') + self.assertEqual(captured.get('model'), 'gemini-3.1-flash-lite') + def test_configured_provider_model_and_base_url_are_passed_to_aux_client(self): """Regression for #2235: task config must select the first title model. From 70068522fbf4c5dc9166705244a70e6e74dbe1b4 Mon Sep 17 00:00:00 2001 From: nesquena-hermes <[email protected]> Date: Tue, 2 Jun 2026 21:16:20 +0000 Subject: [PATCH 2/2] docs(changelog): v0.51.220 release header for #3430 aux-title @provider fix --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a6ecdb9..c91ae055 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,11 @@ ## [Unreleased] +## [v0.51.220] — 2026-06-02 — Release GN (stage-p3c — fix aux title generation with @provider: model ids) + +### Fixed +- Manual session-title regeneration and background auxiliary title generation no longer fail with `422` / `llm_error_aux` when `auxiliary.title_generation.model` in `config.yaml` is set using the WebUI model-picker's `@provider:model` format (e.g. `@gemini:gemini-3.1-flash-lite`). The `@provider:` prefix is now normalized away via the canonical helper before the id reaches the provider API (#3430, @pamnard). + ## [v0.51.219] — 2026-06-02 — Release GM (stage-p3b — extend URI-scheme model-ID fix to backend normalization + matching) ### Fixed