{"record":{"id":"f08eafbb2e460951","repo":"charmbracelet/crush","slug":"coder-agent-configuration-is-missing","errorCode":null,"errorMessage":"coder agent configuration is missing","messagePattern":"coder agent configuration is missing","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"internal/app/app.go","lineNumber":681,"sourceCode":"\t\t\t}\n\t\t}\n\t})\n}\n\nfunc (app *App) InitCoderAgent(ctx context.Context) error {\n\treturn app.initCoderAgent(ctx, true)\n}\n\n// InitCoderAgentNonInteractive initializes the coder agent without\n// interactive-only tools (e.g. question).\nfunc (app *App) InitCoderAgentNonInteractive(ctx context.Context) error {\n\treturn app.initCoderAgent(ctx, false)\n}\n\nfunc (app *App) initCoderAgent(ctx context.Context, interactive bool) error {\n\tcoderAgentCfg := app.config.Config().Agents[config.AgentCoder]\n\tif coderAgentCfg.ID == \"\" {\n\t\treturn fmt.Errorf(\"coder agent configuration is missing\")\n\t}\n\tvar err error\n\tapp.AgentCoordinator, err = agent.NewCoordinator(ctx, agent.CoordinatorOptions{\n\t\tConfig:      app.config,\n\t\tSessions:    app.Sessions,\n\t\tMessages:    app.Messages,\n\t\tPermissions: app.Permissions,\n\t\tQuestions:   app.Questions,\n\t\tHistory:     app.History,\n\t\tFileTracker: app.FileTracker,\n\t\tLSPManager:  app.LSPManager,\n\t\tNotify:      app.agentNotifications,\n\t\tRunComplete: app.runCompletions,\n\t\tSkills:      app.Skills,\n\t\tInteractive: interactive,\n\t})\n\tif err != nil {\n\t\tslog.Error(\"Failed to create coder agent\", \"err\", err)","sourceCodeStart":663,"sourceCodeEnd":699,"githubUrl":"https://github.com/charmbracelet/crush/blob/7944b8e52225d8805e31eacbf7ef24856b0dfb7a/internal/app/app.go#L663-L699","documentation":"initCoderAgent requires a configured 'coder' agent entry in the loaded crush config before it can build the agent Coordinator. If the config's Agents map has no entry with a non-empty ID for config.AgentCoder, the app cannot start and returns this error. It is thrown during App initialization (both interactive and non-interactive paths).","triggerScenarios":"Calling InitCoderAgent or InitCoderAgentNonInteractive when app.config.Config().Agents[config.AgentCoder].ID is empty — i.e. the crushrc/crush.json defines no 'coder' agent, or the agent entry failed to parse/populate its ID.","commonSituations":"Fresh projects with no crushrc; a crushed/deleted agent block in the config; renaming the agent key so AgentCoder no longer resolves; config merge errors leaving the agents map empty.","solutions":["Add a 'coder' agent definition to your crushrc (or crush.json) with a valid ID and provider/model","Run 'crush models' / login flow to generate default agent config","Verify the config file being loaded is the one you edited (check working directory and CRUSH_CONFIG paths)"],"exampleFix":"// before (crushrc)\nprovider anthropic\n# no agent defined\n// after\nprovider anthropic\nagent coder\n  model anthropic/claude-sonnet-4\nend","handlingStrategy":"validation","validationCode":"cfg := app.config.Config()\nif cfg.Agents[config.AgentCoder].ID == \"\" {\n    return errors.New(\"no coder agent configured: add an 'agent coder' block to crushrc\")\n}","typeGuard":null,"tryCatchPattern":"if err := app.InitCoderAgent(ctx); err != nil {\n    if strings.Contains(err.Error(), \"coder agent configuration is missing\") {\n        // fall back to generating default config or prompt user to configure\n    }\n    return err\n}","preventionTips":["Commit a crushrc with a coder agent definition to the repo","Run the interactive 'crush' once after install to seed default agents","Validate config at CI time before running non-interactive workflows"],"tags":["config","agent","startup"],"backgroundTag":"missing-config-entry","analyzedSha":"7944b8e52225d8805e31eacbf7ef24856b0dfb7a","analyzedAt":"2026-08-29T12:48:59.079Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}