{"record":{"id":"abb322c5860e44e1","repo":"charmbracelet/crush","slug":"coder-agent-not-configured","errorCode":null,"errorMessage":"coder agent not configured","messagePattern":"coder agent not configured","errorType":"exception","errorClass":"errCoderAgentNotConfigured","httpStatus":null,"severity":"critical","filePath":"internal/agent/coordinator.go","lineNumber":59,"sourceCode":"\t\"github.com/charmbracelet/crush/internal/session\"\n\t\"github.com/charmbracelet/crush/internal/skills\"\n\t\"golang.org/x/sync/errgroup\"\n\n\t\"charm.land/fantasy/providers/anthropic\"\n\t\"charm.land/fantasy/providers/azure\"\n\t\"charm.land/fantasy/providers/bedrock\"\n\t\"charm.land/fantasy/providers/google\"\n\t\"charm.land/fantasy/providers/openai\"\n\t\"charm.land/fantasy/providers/openaicompat\"\n\t\"charm.land/fantasy/providers/openrouter\"\n\t\"charm.land/fantasy/providers/vercel\"\n\topenaisdk \"github.com/openai/openai-go/v3/option\"\n\t\"github.com/qjebbs/go-jsons\"\n)\n\n// Coordinator errors.\nvar (\n\terrCoderAgentNotConfigured         = errors.New(\"coder agent not configured\")\n\terrModelProviderNotConfigured      = errors.New(\"model provider not configured\")\n\terrLargeModelNotSelected           = errors.New(\"large model not selected\")\n\terrSmallModelNotSelected           = errors.New(\"small model not selected\")\n\terrLargeModelProviderNotConfigured = errors.New(\"large model provider not configured\")\n\terrSmallModelProviderNotConfigured = errors.New(\"small model provider not configured\")\n\terrLargeModelNotFound              = errors.New(\"large model not found in provider config\")\n\terrSmallModelNotFound              = errors.New(\"small model not found in provider config\")\n)\n\n// Copilot models that use the Responses API instead of Chat Completions.\nvar copilotResponsesModels = map[string]bool{\n\t\"gpt-5.2\":       true,\n\t\"gpt-5.2-codex\": true,\n\t\"gpt-5.3-codex\": true,\n\t\"gpt-5.4\":       true,\n\t\"gpt-5.4-mini\":  true,\n\t\"gpt-5.5\":       true,\n\t\"gpt-5-mini\":    true,","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/charmbracelet/crush/blob/7944b8e52225d8805e31eacbf7ef24856b0dfb7a/internal/agent/coordinator.go#L41-L77","documentation":"errCoderAgentNotConfigured is a sentinel error in coordinator.go returned by NewCoordinator (line 190) and UpdateModels (line 1218) when opts.Config.Config().Agents lacks the config.AgentCoder (\"coder\") entry. The coordinator's primary agent is the coder agent; without its definition (model + prompt) the coordinator cannot start or refresh models, so construction fails fast.","triggerScenarios":"NewCoordinator called with a config whose Agents map has no \"coder\" key; UpdateModels called when the coder agent definition was removed at runtime; programmatically built configs missing Agents[config.AgentCoder].","commonSituations":"Users deleting or renaming the coder agent block in crushrc/crush.json; tools or scripts generating minimal configs that only define providers/models but no agents; upgrading from configs predating required agent definitions.","solutions":["Add/restore the coder agent definition in your config (agents.coder with a valid model).","Regenerate the default config (delete the custom one so defaults apply).","If building config in code, set Agents[config.AgentCoder] before NewCoordinator/UpdateModels."],"exampleFix":"// before\nagents {\n  // only task defined\n}\n// after\nagents {\n  coder {\n    model \"anthropic/claude-sonnet-4\"\n  }\n  task {\n    model \"anthropic/claude-sonnet-4\"\n  }\n}","handlingStrategy":"validation","validationCode":"if _, ok := cfg.Agents[config.AgentCoder]; !ok {\n    return errors.New(\"config must define a 'coder' agent before starting the coordinator\")\n}","typeGuard":null,"tryCatchPattern":"coord, err := NewCoordinator(ctx, opts)\nif errors.Is(err, errCoderAgentNotConfigured) {\n    // restore default config or add Agents[config.AgentCoder], then retry\n}","preventionTips":["Preserve the coder agent block when customizing configs.","Validate required agent keys (coder, task) before constructing the coordinator.","Version-control your crushrc so accidental deletions are recoverable."],"tags":["config","agent","coordinator","startup"],"backgroundTag":"missing-config-entry","analyzedSha":"7944b8e52225d8805e31eacbf7ef24856b0dfb7a","analyzedAt":"2026-08-29T12:48:59.079Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}