Files
DocsGPT/application/core
Alex f5129a5656 fix(workflows): dispatch agent nodes by provider, not display label
/api/models reports `display_provider` when a catalog YAML sets one
(`foundry`, `azure_foundry`, `cloudflare`), and the builder persists that
string as a node's `llm_name`. The engine passed it straight to
LLMCreator, which only knows the names in PROVIDERS_BY_NAME and raises
`No LLM class found for type <label>`.

That fails the node before any LLM call, so the turn ends in ~60ms with
an empty answer and no tokens generated. It hits the *default* path: the
platform-default model's label is stamped into every newly dragged agent
node and validateWorkflow requires an agent node, so a new user's
untouched workflow could not produce a token regardless of what they
typed. Ordinary chat was unaffected because it resolves the provider from
the model registry and never reads the stored name.

Adds `resolve_dispatch_provider`, which prefers a stored name that is a
real dispatch provider, then the registry lookup, then the parent agent.
Nodes already saved with a label are repaired at run time, so no
migration is needed. The api_key now resolves from the normalized name
too — `get_api_key_for_provider` falls back to settings.API_KEY for names
it does not recognize, which would have sent the deployment key to
whatever endpoint the label happened to select.
2026-08-05 11:24:59 +01:00
..
2023-04-29 15:40:55 +01:00
2026-04-12 00:07:24 +01:00
2026-02-22 11:10:42 +00:00
2026-04-28 00:14:43 +01:00
2026-04-28 00:14:43 +01:00
2026-06-08 15:07:31 +01:00
2025-12-24 17:05:35 +02:00