fix(auxiliary): custom provider URL rewrite + main_runtime model for title gen

- auxiliary_client: apply _to_openai_base_url() to custom base_url
  (fixes /anthropic → /v1 rewrite missing for provider="custom")
- auxiliary_client: use main_runtime.get("model") instead of _read_main_model()
  so auxiliary tasks follow system default model changes
- title_generator: thread main_runtime through generate_title → auto_title_session → maybe_auto_title
- cli.py / gateway/run.py: pass main_runtime to maybe_auto_title
- tests: update mock assertions for new main_runtime parameter
This commit is contained in:
crayfish-ai 2026-04-28 12:14:36 +08:00 committed by Teknium
parent 20b49b71cd
commit f3371c39a4
5 changed files with 26 additions and 7 deletions

View file

@ -182,7 +182,7 @@ class TestMaybeAutoTitle:
import time
time.sleep(0.3)
mock_auto.assert_called_once_with(
db, "sess-1", "hello", "hi there", failure_callback=None
db, "sess-1", "hello", "hi there", failure_callback=None, main_runtime=None
)
def test_forwards_failure_callback_to_worker(self):
@ -202,7 +202,7 @@ class TestMaybeAutoTitle:
import time
time.sleep(0.3)
mock_auto.assert_called_once_with(
db, "sess-1", "hello", "hi there", failure_callback=_cb
db, "sess-1", "hello", "hi there", failure_callback=_cb, main_runtime=None
)
def test_skips_if_no_response(self):