{"record":{"id":"5799dc3866aac20c","repo":"vxcontrol/pentagi","slug":"failed-to-test-provider-w","errorCode":null,"errorMessage":"failed to test provider: %w","messagePattern":"failed to test provider: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/pkg/providers/providers.go","lineNumber":969,"sourceCode":"\t\treturn results, fmt.Errorf(\"failed to patch provider config: %w\", err)\n\t}\n\n\t// Create provider for testing\n\tproviderName := provider.ProviderName(\"test-provider\")\n\ttestProvider, err := pc.buildProviderFromConfig(prvtype, providerName, patchedConfig)\n\tif err != nil {\n\t\treturn results, fmt.Errorf(\"failed to create provider for testing: %w\", err)\n\t}\n\n\t// Run full provider testing\n\tresults, err = tester.TestProvider(\n\t\tctx,\n\t\ttestProvider,\n\t\ttester.WithVerbose(false),\n\t\ttester.WithParallelWorkers(defaultTestParallelWorkersNumber),\n\t)\n\tif err != nil {\n\t\treturn results, fmt.Errorf(\"failed to test provider: %w\", err)\n\t}\n\n\treturn results, nil\n}\n\nfunc (pc *providerController) patchProviderConfig(\n\tprvtype provider.ProviderType,\n\tconfig *pconfig.ProviderConfig,\n) (*pconfig.ProviderConfig, error) {\n\tvar (\n\t\tdefaultCfg *pconfig.ProviderConfig\n\t\tok         bool\n\t)\n\n\tif defaultCfg, ok = pc.defaultConfigs[prvtype]; !ok {\n\t\tif reason, hasReason := pc.defaultConfigErrors[prvtype]; hasReason {\n\t\t\treturn nil, fmt.Errorf(\n\t\t\t\t\"provider type '%s' has no default config because it failed to load at startup: %w\",","sourceCodeStart":951,"sourceCodeEnd":987,"githubUrl":"https://github.com/vxcontrol/pentagi/blob/ea665308baaff015b226f308438a68d929d0f29b/backend/pkg/providers/providers.go#L951-L987","documentation":"TestProvider wraps errors from tester.TestProvider, which runs functional checks (parallel workers) against an already-constructed provider. Unlike error 460, the provider was created successfully but at least one of the runtime test cases (model listing, simple call, tool call, etc.) failed.","triggerScenarios":"Calling TestProvider with a valid provider config where tester.TestProvider returns non-nil: API authentication failure, unreachable endpoint, rate limiting, model not available, or tool-calling capability failures during the test suite.","commonSituations":"Expired or revoked API key; network/proxy blocking the LLM endpoint; provider account without access to the configured model; server URL pointing to the wrong path; transient 429/5xx during parallel test workers.","solutions":["Inspect the wrapped error from tester.TestProvider for the failing test case and its HTTP status/cause.","Verify the API key works with a direct curl call to the provider endpoint.","Check the provider server URL and configured model names are valid for that account.","If transient (429/5xx), wait and re-run TestProvider."],"exampleFix":"null","handlingStrategy":"retry","validationCode":"resp, err := http.Get(providerEndpoint + \"/health\")\nif err != nil || resp.StatusCode != 200 {\n    return fmt.Errorf(\"provider endpoint unreachable, skip TestProvider\")\n}","typeGuard":"null","tryCatchPattern":"results, err := pc.TestProvider(ctx, prvtype, cfg)\nif err != nil {\n    if isTransient(err) { // e.g. 429/5xx in wrapped message\n        time.Sleep(backoff)\n        results, err = pc.TestProvider(ctx, prvtype, cfg)\n    }\n}","preventionTips":["Smoke-test the API key with a direct curl to the provider before running the suite.","Watch for rate limits; the tester runs workers in parallel.","Confirm the configured models exist on the provider account."],"tags":["provider","llm","testing","network"],"backgroundTag":"llm-provider-test-failed","analyzedSha":"ea665308baaff015b226f308438a68d929d0f29b","analyzedAt":"2026-09-01T14:16:31.421Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}