{"record":{"id":"46719b91d44968ea","repo":"charmbracelet/crush","slug":"agent-configuration-not-found","errorCode":null,"errorMessage":"agent configuration not found","messagePattern":"agent configuration not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/ui/dialog/reasoning.go","lineNumber":241,"sourceCode":"\tm := [][]key.Binding{}\n\tslice := []key.Binding{\n\t\tr.keyMap.Select,\n\t\tr.keyMap.Next,\n\t\tr.keyMap.Previous,\n\t\tr.keyMap.Close,\n\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))","sourceCodeStart":223,"sourceCodeEnd":259,"githubUrl":"https://github.com/charmbracelet/crush/blob/7944b8e52225d8805e31eacbf7ef24856b0dfb7a/internal/ui/dialog/reasoning.go#L223-L259","documentation":"The Reasoning dialog builds its items from the app config. It throws this error when cfg.Agents has no entry for the 'coder' agent (config.AgentCoder), meaning the required coder agent is not configured at all.","triggerScenarios":"Opening the reasoning dialog (NewReasoning → setReasoningItems) with a config whose Agents map lacks the 'coder' key — e.g. a hand-edited config that removed or renamed the coder agent.","commonSituations":"Custom crushrc/config files that define only 'task' agents and drop 'coder'; typos in agent names; loading a partial/minimal config in tests.","solutions":["Restore the 'coder' agent definition in the config (crushrc `agent` builtin or crush.json agents map)","Fix the agent name typo so the key is exactly `coder`","Regenerate or reset to a default config that includes the coder agent"],"exampleFix":"// before (crushrc)\nagent task\n// after\nagent coder\nagent task","handlingStrategy":"fallback","validationCode":"if _, ok := cfg.Agents[config.AgentCoder]; !ok {\n\t// repair config or skip dialog\n}","typeGuard":"func hasCoderAgent(cfg *config.Config) bool {\n\t_, ok := cfg.Agents[config.AgentCoder]\n\treturn ok\n}","tryCatchPattern":"if err := dialog.SetReasoningItems(); err != nil {\n\t// disable the reasoning dialog for this session\n\tdialog.SetEnabled(false)\n}","preventionTips":["Never remove the 'coder' agent from config","Validate config with the CLI before launching the TUI","Keep agent names unmodified when hand-editing configs"],"tags":["tui","config","agents"],"backgroundTag":"missing-config-key","analyzedSha":"7944b8e52225d8805e31eacbf7ef24856b0dfb7a","analyzedAt":"2026-08-29T12:48:59.079Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}