{"record":{"id":"59994364339ad5e3","repo":"charmbracelet/crush","slug":"no-reasoning-levels-available","errorCode":null,"errorMessage":"no reasoning levels available","messagePattern":"no reasoning levels available","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"internal/ui/dialog/reasoning.go","lineNumber":251,"sourceCode":"\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),\n\t\t\tisCurrent: effort == currentEffort,\n\t\t\tt:         r.com.Styles,\n\t\t}\n\t\titems = append(items, item)","sourceCodeStart":233,"sourceCodeEnd":269,"githubUrl":"https://github.com/charmbracelet/crush/blob/7944b8e52225d8805e31eacbf7ef24856b0dfb7a/internal/ui/dialog/reasoning.go#L233-L269","documentation":"setReasoningItems throws this error when the resolved coder model has an empty ReasoningLevels map, meaning the model offers no reasoning effort settings — so a reasoning-selection dialog has nothing to display.","triggerScenarios":"Opening the reasoning dialog while the selected model is a non-reasoning model (no ReasoningLevels defined in the provider catalog); a custom model definition that omits reasoning levels.","commonSituations":"Selecting models like small/fast chat models that do not expose thinking/reasoning controls; stale or hand-written model definitions missing ReasoningLevels; provider catalog versions where a model dropped reasoning support.","solutions":["Switch the coder model to one that exposes reasoning levels (e.g. a thinking-capable Claude or GPT model)","Add ReasoningLevels to the custom model definition if it does support reasoning","Skip opening the reasoning dialog for models without reasoning support"],"exampleFix":"// before: reasoning dialog opened for a non-reasoning model\nmodel := cfg.GetModelByType(agentCfg.Model)\nif len(model.ReasoningLevels) > 0 {\n\tNewReasoning(...)\n}\n// after: guard the caller\nif model := cfg.GetModelByType(agentCfg.Model); model != nil && len(model.ReasoningLevels) > 0 {\n\tNewReasoning(...)\n}","handlingStrategy":"type-guard","validationCode":"model := cfg.GetModelByType(agentCfg.Model)\nif model != nil && len(model.ReasoningLevels) == 0 {\n\t// hide the reasoning dialog entry for this model\n}","typeGuard":"func supportsReasoning(cfg *config.Config, mt config.SelectedModelType) bool {\n\tm := cfg.GetModelByType(mt)\n\treturn m != nil && len(m.ReasoningLevels) > 0\n}","tryCatchPattern":"if err := dialog.SetReasoningItems(); err != nil {\n\t// gracefully omit the reasoning option in the UI\n}","preventionTips":["Only show the reasoning dialog for reasoning-capable models","Check ReasoningLevels before advertising reasoning controls","Keep custom model definitions complete with ReasoningLevels and DefaultReasoningEffort"],"tags":["tui","config","reasoning"],"backgroundTag":"model-not-found","analyzedSha":"7944b8e52225d8805e31eacbf7ef24856b0dfb7a","analyzedAt":"2026-08-29T12:48:59.079Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}