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

@@ -10700,6 +10700,13 @@ class GatewayRunner:
final_response,
all_msgs,
failure_callback=_title_failure_cb,
main_runtime={
"model": getattr(agent, "model", None),
"provider": getattr(agent, "provider", None),
"base_url": getattr(agent, "base_url", None),
"api_key": getattr(agent, "api_key", None),
"api_mode": getattr(agent, "api_mode", None),
} if agent else None,
)
except Exception:
pass