charmbracelet/crush · error

small model provider not configured

Error message

small model provider not configured

What it means

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.

Source

Thrown at internal/agent/agentic_fetch_tool.go:162

			promptTemplate, err := prompt.NewPrompt("agentic_fetch", string(agenticFetchPromptTmpl), promptOpts...)
			if err != nil {
				return fantasy.ToolResponse{}, fmt.Errorf("error creating prompt: %s", err)
			}

			_, small, err := c.buildAgentModels(ctx, true)
			if err != nil {
				return fantasy.ToolResponse{}, fmt.Errorf("error building models: %s", err)
			}

			systemPrompt, err := promptTemplate.Build(ctx, small.Model.Provider(), small.Model.Model(), c.cfg)
			if err != nil {
				return fantasy.ToolResponse{}, fmt.Errorf("error building system prompt: %s", err)
			}

			smallProviderCfg, ok := c.cfg.Config().Providers.Get(small.ModelCfg.Provider)
			if !ok {
				return fantasy.ToolResponse{}, errors.New("small model provider not configured")
			}

			webFetchTool := tools.NewWebFetchTool(tmpDir, client)
			webSearchTool := tools.NewWebSearchTool(client)
			fetchTools := []fantasy.AgentTool{
				webFetchTool,
				webSearchTool,
				tools.NewGlobTool(tmpDir, c.cfg.Config().Tools.Glob),
				tools.NewGrepTool(tmpDir, c.cfg.Config().Tools.Grep),
				tools.NewSourcegraphTool(client),
				tools.NewViewTool(c.lspManager, c.permissions, c.filetracker, nil, tmpDir),
			}

			// Sub-agent tools run without hook interception. The top-level
			// `agentic_fetch` call itself is already wrapped from the coder's
			// side; firing hooks again for every inner tool call would run
			// the user's hooks N times per delegated turn.

View on GitHub (pinned to 7944b8e522)

Solutions

  1. Define the provider referenced by the small model in your crushrc (or crush.json) providers section.
  2. Fix the small model setting so its provider id matches an existing provider block.
  3. Verify provider config loads correctly (check for merge errors or disabled providers) before running.

Example fix

// before (crushrc)
model "anthropic/claude-3-5-haiku" // as small model
// but no anthropic provider defined
// after
provider "anthropic" {
  api_key "..."
}
model "anthropic/claude-3-5-haiku"
Defensive patterns

Strategy: validation

Validate before calling

small := cfg.SelectedSmallModel
if _, ok := cfg.Providers.Get(small.ModelCfg.Provider); !ok {
    return fmt.Errorf("small model provider %q missing from config; define it before using agentic fetch", small.ModelCfg.Provider)
}

Try / catch

resp, err := tool.Execute(ctx, params)
if err != nil && strings.Contains(err.Error(), "small model provider not configured") {
    // fix config: add the provider block or pick another small model, then retry
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of charmbracelet/crush@7944b8e522 (2026-08-29). Data as JSON: /api/errors/aa67224093bba43c. Report an issue: GitHub.