{"record":{"id":"aa67224093bba43c","repo":"charmbracelet/crush","slug":"small-model-provider-not-configured","errorCode":null,"errorMessage":"small model provider not configured","messagePattern":"small model provider not configured","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/agent/agentic_fetch_tool.go","lineNumber":162,"sourceCode":"\n\t\t\tpromptTemplate, err := prompt.NewPrompt(\"agentic_fetch\", string(agenticFetchPromptTmpl), promptOpts...)\n\t\t\tif err != nil {\n\t\t\t\treturn fantasy.ToolResponse{}, fmt.Errorf(\"error creating prompt: %s\", err)\n\t\t\t}\n\n\t\t\t_, small, err := c.buildAgentModels(ctx, true)\n\t\t\tif err != nil {\n\t\t\t\treturn fantasy.ToolResponse{}, fmt.Errorf(\"error building models: %s\", err)\n\t\t\t}\n\n\t\t\tsystemPrompt, err := promptTemplate.Build(ctx, small.Model.Provider(), small.Model.Model(), c.cfg)\n\t\t\tif err != nil {\n\t\t\t\treturn fantasy.ToolResponse{}, fmt.Errorf(\"error building system prompt: %s\", err)\n\t\t\t}\n\n\t\t\tsmallProviderCfg, ok := c.cfg.Config().Providers.Get(small.ModelCfg.Provider)\n\t\t\tif !ok {\n\t\t\t\treturn fantasy.ToolResponse{}, errors.New(\"small model provider not configured\")\n\t\t\t}\n\n\t\t\twebFetchTool := tools.NewWebFetchTool(tmpDir, client)\n\t\t\twebSearchTool := tools.NewWebSearchTool(client)\n\t\t\tfetchTools := []fantasy.AgentTool{\n\t\t\t\twebFetchTool,\n\t\t\t\twebSearchTool,\n\t\t\t\ttools.NewGlobTool(tmpDir, c.cfg.Config().Tools.Glob),\n\t\t\t\ttools.NewGrepTool(tmpDir, c.cfg.Config().Tools.Grep),\n\t\t\t\ttools.NewSourcegraphTool(client),\n\t\t\t\ttools.NewViewTool(c.lspManager, c.permissions, c.filetracker, nil, tmpDir),\n\t\t\t}\n\n\t\t\t// Sub-agent tools run without hook interception. The top-level\n\t\t\t// `agentic_fetch` call itself is already wrapped from the coder's\n\t\t\t// side; firing hooks again for every inner tool call would run\n\t\t\t// the user's hooks N times per delegated turn.\n","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/charmbracelet/crush/blob/7944b8e52225d8805e31eacbf7ef24856b0dfb7a/internal/agent/agentic_fetch_tool.go#L144-L180","documentation":"The agentic_fetch tool builds a sub-agent on the configured small model; after resolving small.ModelCfg.Provider it looks the provider up in c.cfg.Config().Providers.Get(...). If the provider referenced by the small model is absent from the configured providers map, the tool cannot build an LLM client and returns this error as a tool response.","triggerScenarios":"Executing agentic fetch when the small model's Provider field names a provider not present in the resolved config — e.g. model set to \"openai/gpt-4o-mini\" while only an anthropic provider block is defined, or a provider renamed/removed after the model reference was written.","commonSituations":"Typos in provider ids in crushrc; copying a model reference from another project's config; config merge dropping a provider section; catwalk/provider data not yet loaded for that provider.","solutions":["Define the provider referenced by the small model in your crushrc (or crush.json) providers section.","Fix the small model setting so its provider id matches an existing provider block.","Verify provider config loads correctly (check for merge errors or disabled providers) before running."],"exampleFix":"// before (crushrc)\nmodel \"anthropic/claude-3-5-haiku\" // as small model\n// but no anthropic provider defined\n// after\nprovider \"anthropic\" {\n  api_key \"...\"\n}\nmodel \"anthropic/claude-3-5-haiku\"","handlingStrategy":"validation","validationCode":"small := cfg.SelectedSmallModel\nif _, ok := cfg.Providers.Get(small.ModelCfg.Provider); !ok {\n    return fmt.Errorf(\"small model provider %q missing from config; define it before using agentic fetch\", small.ModelCfg.Provider)\n}","typeGuard":null,"tryCatchPattern":"resp, err := tool.Execute(ctx, params)\nif err != nil && strings.Contains(err.Error(), \"small model provider not configured\") {\n    // fix config: add the provider block or pick another small model, then retry\n}","preventionTips":["Keep the small-model setting's provider id in sync with an existing provider block.","Run a config sanity check (every referenced model's provider exists) at startup.","Avoid hand-editing provider ids; copy them from the model's full \"provider/model\" string."],"tags":["config","provider","model","agentic-fetch"],"backgroundTag":"provider-not-configured","analyzedSha":"7944b8e52225d8805e31eacbf7ef24856b0dfb7a","analyzedAt":"2026-08-29T12:48:59.079Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}