fix(lobe-chat): repoint the System Agent off its gpt-5-mini default onto fleet models

The gpt-5-mini calls were Lobe's System Agent -- a background model,
separate from the chat model, used for auto-naming conversations, history
summarization, translation, query rewrite, thread naming, and assistant
metadata. Its default is openai/gpt-5-mini, which our OpenAI provider (the
gateway) forwards verbatim; the scoped key blocks it, so every background
task 403'd and the log filled with 'Tried to access gpt-5-mini' while
auto-naming silently failed.

Set SYSTEM_AGENT to route all six documented keys (topic, translation,
agentMeta, queryRewrite, historyCompress, thread) at fleet models --
summarizer for the naming/summarize tasks (same seat as gen at temp 0),
gen where quality matters. Any key left unset falls back to the gpt-5-mini
default, so all six are explicit.

Notably this one IS env-configurable (SYSTEM_AGENT), unlike the per-model
output-token cap which is UI-only -- a mixed result on the
manageable-by-agent axis.
This commit is contained in:
vh
2026-08-16 21:02:43 -07:00
parent cac75cbffb
commit 163a7252ec
3 changed files with 32 additions and 0 deletions
+20
View File
@@ -153,3 +153,23 @@ ssh lkraven@10.0.50.45 'cd /opt/docker/compose/lobe-chat && docker compose up -d
`lkraven` owns `/opt/docker` and is in the `docker` group on this host, so no sudo
is needed. Note ESH is outside the infra-ops NOPASSWD grant.
## System Agent — why `gpt-5-mini` was being called
Lobe has a **System Agent**: a background model, separate from your chat model,
that auto-names conversations, summarizes history, rewrites RAG queries, and
generates assistant metadata. **Its default is `openai/gpt-5-mini`.** Because our
OpenAI provider is the gateway, that model name is forwarded verbatim to LiteLLM,
and the scoped key (local models only) 403s it — filling the gateway log with
"Tried to access gpt-5-mini" and silently breaking auto-naming.
Fixed by env (`SYSTEM_AGENT`), so this is scriptable, not a UI setting — a point
IN Lobe's favour on the manageable-by-agent axis, unlike the output-token cap:
```
SYSTEM_AGENT=topic=openai/summarizer,translation=openai/gen,agentMeta=openai/gen,queryRewrite=openai/summarizer,historyCompress=openai/summarizer,thread=openai/summarizer
```
All six documented keys are set explicitly — any omitted key falls back to the
`gpt-5-mini` default. `summarizer`/`classifier` are the same seat as `gen` at
temp 0, the right fit for naming/summarizing; `gen` where output quality matters.