Last validated: Langflow 1.11.x
Validates that selecting "Connect other models" in the Agent component's model picker isolates the node from its previously selected provider/model — the node drops the concrete model selection and enters connection mode, so a stale provider configuration cannot be used in a backend run when an external LanguageModel is meant to be wired in instead.
In Langflow 1.11 the Agent no longer exposes inline per-provider credential fields on the node (provider credentials are global, managed under Settings → Model Providers via the unified model picker). The only node-level "provider field isolation" left is the connection-mode clear performed by useModelConnectionLogic: it resets the model field value to [] and wipes every password / SecretStrInput field on the node. The visible effect is that the picker trigger stops showing the previously selected model name and instead shows the "Connect other models" connection-mode label.
This is a pure UI/state assertion — no LLM call is made.
@stable @regression @components @agents @model-provider
- Resolve a single
{ provider, model }target:MODEL_TEST_IDwins (its provider is inferred frommodels.json, falling back toMODEL_TEST_PROVIDER); otherwise the first model ofMODEL_TEST_PROVIDER(or of the first env-configured provider) is read fromhelpers/provider-setup/data/models.json. The test skips with an accurate reason when no provider resolves — either no provider has its env keys configured, or a givenMODEL_TEST_IDcould not be mapped to a provider. SimpleAgentTemplatePage.load({ provider, model })— loads the Simple Agent template, configures the provider via the unified model picker (Manage Model Providers → API key → enable models) and selects the resolved model.MODEL_NOT_AVAILABLEis caught and turned into a skip.- Assert the picker trigger
model_modelis visible. - Capture the selected model label from
value-dropdown-model_modeland assert it is non-empty and not the"Select a model"placeholder (a concrete model is selected — the precondition). - Open the picker (
model_model) and click theconnect-other-modelsfooter button. If that option is not present (no compatible externalLanguageModeltype registered), skip. - Assert
value-dropdown-model_modelnow reads"Connect other models"and no longer contains the previously selected model name.
- Before the action, the Agent's model picker shows a concrete model name (not the placeholder).
- After choosing "Connect other models", the picker trigger displays the
"Connect other models"connection-mode label. - The previously selected model name is no longer present in the trigger, confirming the prior selection was dropped (and, per
useModelConnectionLogic, the model value and secret fields were cleared).
src/frontend/src/components/core/parameterRenderComponent/components/modelInputComponent/— renders themodel_modeltrigger, thevalue-dropdown-model_modelvalue span, and theconnect-other-modelsfooter button. Renaming thesedata-testidattributes breaks the test.src/frontend/src/components/core/parameterRenderComponent/components/modelInputComponent/hooks/useModelConnectionLogic.ts— the connection-mode clear logic under test (resetsmodelto[], wipespassword/SecretStrInputfields). Changing this behavior changes the expected outcome.src/frontend/src/components/core/parameterRenderComponent/components/modelInputComponent/components/ModelTrigger.tsx— derives the displayed label; the"Connect other models"label in connection mode is the assertion's anchor.tests/helpers/provider-setup/anddata/models.json— provider setup and the model source of truth (populated bycollect-models).
- Actually wiring an external
LanguageModelcomponent and running the flow with it. - Backend-level verification that the cleared secret fields are absent from the persisted/executed config (asserted only indirectly via the UI label change).
- Provider credential configuration correctness (covered by the provider-setup helpers and provider-management specs).
- Langflow running and accessible at
PLAYWRIGHT_BASE_URL. - At least one provider has its env keys set (e.g.
OPENAI_API_KEY). A real API key is needed to configure the provider so the picker lists models, but no LLM call is made. models.jsonpopulated bycollect-models(otherwise the resolved model may beundefinedandsetup-openai's default is used).
- In connection mode,
selectedModelis intentionally overridden to{ name: "Connect other models" }inmodelInputComponent/index.tsx, which is why the trigger shows that label rather than the empty"Select a model"placeholder. - Run with
--workers=1: agent specs create named flows that collide in parallel. The spec also sets file-level serial mode.SimpleAgentTemplatePage.load()does not delete existing flows — the cross-worker delete-all was removed in #553. - Flow cleanup is id-scoped, from the creation POST (#1108's shared tracker, wired in #1346). The spec previously had no cleanup at all and left an orphan
Simple Agentbehind per run. It never executes the flow, so it produced no trace and no unattributed tokens on the 2026-08-06 daily — the leak was the whole cost here; the tracker also closes the token-attribution path (#1197), which lives on the delete call. - The spec is provider-agnostic and runs a single target on purpose — the connection-mode clear does not vary by provider, so looping every model would add cost without coverage.