{"record":{"id":"c5793b3d74979527","repo":"charmbracelet/crush","slug":"model-configuration-not-found","errorCode":null,"errorMessage":"model configuration not found","messagePattern":"model configuration not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/ui/dialog/reasoning.go","lineNumber":247,"sourceCode":"\t}\n\tfor i := 0; i < len(slice); i += 4 {\n\t\tend := min(i+4, len(slice))\n\t\tm = append(m, slice[i:end])\n\t}\n\treturn m\n}\n\nfunc (r *Reasoning) setReasoningItems() error {\n\tcfg := r.com.Config()\n\tagentCfg, ok := cfg.Agents[config.AgentCoder]\n\tif !ok {\n\t\treturn errors.New(\"agent configuration not found\")\n\t}\n\n\tselectedModel := cfg.Models[agentCfg.Model]\n\tmodel := cfg.GetModelByType(agentCfg.Model)\n\tif model == nil {\n\t\treturn errors.New(\"model configuration not found\")\n\t}\n\n\tif len(model.ReasoningLevels) == 0 {\n\t\treturn errors.New(\"no reasoning levels available\")\n\t}\n\n\tcurrentEffort := selectedModel.ReasoningEffort\n\tif currentEffort == \"\" {\n\t\tcurrentEffort = model.DefaultReasoningEffort\n\t}\n\n\titems := make([]list.FilterableItem, 0, len(model.ReasoningLevels))\n\tselectedIndex := 0\n\tfor i, effort := range model.ReasoningLevels {\n\t\titem := &ReasoningItem{\n\t\t\tVersioned: list.NewVersioned(),\n\t\t\teffort:    effort,\n\t\t\ttitle:     common.FormatReasoningEffort(effort),","sourceCodeStart":229,"sourceCodeEnd":265,"githubUrl":"https://github.com/charmbracelet/crush/blob/7944b8e52225d8805e31eacbf7ef24856b0dfb7a/internal/ui/dialog/reasoning.go#L229-L265","documentation":"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.","triggerScenarios":"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.","commonSituations":"Provider/model IDs typed incorrectly; a model definition removed while the agent still references it; provider catalog changes (renamed model IDs) after an upgrade.","solutions":["Set the coder agent's model to a valid model type defined in the config or known provider catalog","Re-add the missing model definition that the agent references","Verify with the models list command which model IDs are available"],"exampleFix":"// before\nagent coder --model claude-sonnet-999\n// after\nagent coder --model anthropic/claude-sonnet-4","handlingStrategy":"validation","validationCode":"agentCfg := cfg.Agents[config.AgentCoder]\nif cfg.GetModelByType(agentCfg.Model) == nil {\n\treturn fmt.Errorf(\"unknown model %q for coder agent\", agentCfg.Model)\n}","typeGuard":"func modelResolvable(cfg *config.Config, mt config.SelectedModelType) bool {\n\treturn cfg.GetModelByType(mt) != nil\n}","tryCatchPattern":"if err := dialog.SetReasoningItems(); err != nil {\n\tlog.Warn(\"Reasoning dialog unavailable\", \"err\", err)\n}","preventionTips":["Copy model IDs from the models list output verbatim","Update agent model refs after provider catalog changes","Validate agent→model references at config load time"],"tags":["tui","config","models"],"backgroundTag":"model-not-found","analyzedSha":"7944b8e52225d8805e31eacbf7ef24856b0dfb7a","analyzedAt":"2026-08-29T12:48:59.079Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}