charmbracelet/crush · error

model configuration not found

Error message

model configuration not found

What it means

After locating the coder agent config, setReasoningItems resolves its model. It throws this error when the model referenced by agentCfg.Model cannot be resolved — neither present in cfg.Models nor resolvable via cfg.GetModelByType — so the dialog has no model to inspect for reasoning levels.

Source

Thrown at internal/ui/dialog/reasoning.go:247

	}
	for i := 0; i < len(slice); i += 4 {
		end := min(i+4, len(slice))
		m = append(m, slice[i:end])
	}
	return m
}

func (r *Reasoning) setReasoningItems() error {
	cfg := r.com.Config()
	agentCfg, ok := cfg.Agents[config.AgentCoder]
	if !ok {
		return errors.New("agent configuration not found")
	}

	selectedModel := cfg.Models[agentCfg.Model]
	model := cfg.GetModelByType(agentCfg.Model)
	if model == nil {
		return errors.New("model configuration not found")
	}

	if len(model.ReasoningLevels) == 0 {
		return errors.New("no reasoning levels available")
	}

	currentEffort := selectedModel.ReasoningEffort
	if currentEffort == "" {
		currentEffort = model.DefaultReasoningEffort
	}

	items := make([]list.FilterableItem, 0, len(model.ReasoningLevels))
	selectedIndex := 0
	for i, effort := range model.ReasoningLevels {
		item := &ReasoningItem{
			Versioned: list.NewVersioned(),
			effort:    effort,
			title:     common.FormatReasoningEffort(effort),

View on GitHub (pinned to 7944b8e522)

Solutions

  1. Set the coder agent's model to a valid model type defined in the config or known provider catalog
  2. Re-add the missing model definition that the agent references
  3. Verify with the models list command which model IDs are available

Example fix

// before
agent coder --model claude-sonnet-999
// after
agent coder --model anthropic/claude-sonnet-4
Defensive patterns

Strategy: validation

Validate before calling

agentCfg := cfg.Agents[config.AgentCoder]
if cfg.GetModelByType(agentCfg.Model) == nil {
	return fmt.Errorf("unknown model %q for coder agent", agentCfg.Model)
}

Type guard

func modelResolvable(cfg *config.Config, mt config.SelectedModelType) bool {
	return cfg.GetModelByType(mt) != nil
}

Try / catch

if err := dialog.SetReasoningItems(); err != nil {
	log.Warn("Reasoning dialog unavailable", "err", err)
}

Prevention

When it happens

Trigger: The coder agent's `model` field names a model type that is not defined in the config and not known to GetModelByType; opening the reasoning dialog against such a config.

Common situations: Provider/model IDs typed incorrectly; a model definition removed while the agent still references it; provider catalog changes (renamed model IDs) after an upgrade.

Related errors


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