{"record":{"id":"ca4e01051b7a0602","repo":"windmill-labs/windmill","slug":"invalid-ai-agent-provider-configuration-errors","errorCode":null,"errorMessage":"Invalid AI agent provider configuration:\n${errors.join('\\n')}${knownOptionsHint(known)}","messagePattern":"Invalid AI agent provider configuration:\n(.+?)(.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"frontend/src/lib/components/copilot/chat/flow/aiAgentProviders.ts","lineNumber":313,"sourceCode":"\t\tif (value.agent) return\n\t\tconst transform = value.input_transforms?.provider\n\t\t// A missing provider is reported by collectProviderlessAgentIds, and a javascript\n\t\t// transform resolves at run time with no value to check here.\n\t\tif (!transform || transform.type !== 'static') return\n\t\tconst issue = checkProviderValue(transform.value, known)\n\t\tif (!issue) return\n\t\tif (issue.blocking) {\n\t\t\terrors.push(`Step \"${mod.id}\": ${issue.message}`)\n\t\t} else if (issue.settled) {\n\t\t\twarnings?.push(`Step \"${mod.id}\": ${issue.message}`)\n\t\t} else {\n\t\t\twarnings?.push(\n\t\t\t\t`Step \"${mod.id}\": ${issue.message}, which could not be ruled out. Confirm it with the user if the step fails to run.`\n\t\t\t)\n\t\t}\n\t})\n\tif (errors.length > 0) {\n\t\tthrow new Error(\n\t\t\t`Invalid AI agent provider configuration:\\n${errors.join('\\n')}${knownOptionsHint(known)}`\n\t\t)\n\t}\n}\n","sourceCodeStart":295,"sourceCodeEnd":318,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/frontend/src/lib/components/copilot/chat/flow/aiAgentProviders.ts#L295-L318","documentation":"validateAiAgentProviders aggregates configuration errors found across AI-agent flow modules and throws a single Error listing them, appended with knownOptionsHint(known) to suggest valid provider options. It runs as part of validateFlowModules, so a flow containing a misconfigured AI-agent step cannot proceed.","triggerScenarios":"Any AI-agent module in the flow has a provider config error: missing API key/env var reference, unknown provider name, invalid model id, or other per-step 'errors' entries collected during module validation, with errors.length > 0.","commonSituations":"Typo'd provider slug (e.g. 'anthrpic'); model name not available for the chosen provider; missing required credentials for the provider; provider renamed/removed in a newer Windmill version.","solutions":["Read the listed per-step errors and fix the provider config on the named step (id given in each line).","Use the known-options hint appended to the message to pick a valid provider/model value.","Verify required credentials/env vars for the provider are set before running the flow.","If a provider was renamed after an upgrade, migrate the step config to the new provider id."],"exampleFix":"// before\nprovider: { type: 'aiagent', provider: 'anthrpic', model: 'claude-3' }\n// after\nprovider: { type: 'aiagent', provider: 'anthropic', model: 'claude-sonnet-4' }","handlingStrategy":"validation","validationCode":"const KNOWN = ['openai', 'anthropic', 'google', 'azure']\nif (!KNOWN.includes(cfg.provider)) throw new Error(`Unknown provider: ${cfg.provider}`)\nif (!cfg.apiKey && !cfg.apiKeyEnv) throw new Error('Missing provider credentials')","typeGuard":"function isValidProviderConfig(cfg: unknown): cfg is AiAgentProviderConfig {\n  return typeof cfg === 'object' && cfg !== null &&\n    typeof (cfg as any).provider === 'string' &&\n    typeof (cfg as any).model === 'string'\n}","tryCatchPattern":"try {\n  validateAiAgentProviders(modules)\n} catch (e) {\n  showConfigErrors(parseProviderErrors(e.message))\n  return\n}","preventionTips":["Pick provider/model values from the known-options hint, not free text.","Verify provider credentials (API keys/env vars) before deploying the flow.","Re-validate flows after Windmill upgrades that may rename or drop providers."],"tags":["validation","configuration","ai-agent","flow"],"backgroundTag":"invalid-provider-config","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}