charmbracelet/crush · critical · errCoderAgentNotConfigured

coder agent not configured

Error message

coder agent not configured

What it means

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.

Source

Thrown at internal/agent/coordinator.go:59

	"github.com/charmbracelet/crush/internal/session"
	"github.com/charmbracelet/crush/internal/skills"
	"golang.org/x/sync/errgroup"

	"charm.land/fantasy/providers/anthropic"
	"charm.land/fantasy/providers/azure"
	"charm.land/fantasy/providers/bedrock"
	"charm.land/fantasy/providers/google"
	"charm.land/fantasy/providers/openai"
	"charm.land/fantasy/providers/openaicompat"
	"charm.land/fantasy/providers/openrouter"
	"charm.land/fantasy/providers/vercel"
	openaisdk "github.com/openai/openai-go/v3/option"
	"github.com/qjebbs/go-jsons"
)

// Coordinator errors.
var (
	errCoderAgentNotConfigured         = errors.New("coder agent not configured")
	errModelProviderNotConfigured      = errors.New("model provider not configured")
	errLargeModelNotSelected           = errors.New("large model not selected")
	errSmallModelNotSelected           = errors.New("small model not selected")
	errLargeModelProviderNotConfigured = errors.New("large model provider not configured")
	errSmallModelProviderNotConfigured = errors.New("small model provider not configured")
	errLargeModelNotFound              = errors.New("large model not found in provider config")
	errSmallModelNotFound              = errors.New("small model not found in provider config")
)

// Copilot models that use the Responses API instead of Chat Completions.
var copilotResponsesModels = map[string]bool{
	"gpt-5.2":       true,
	"gpt-5.2-codex": true,
	"gpt-5.3-codex": true,
	"gpt-5.4":       true,
	"gpt-5.4-mini":  true,
	"gpt-5.5":       true,
	"gpt-5-mini":    true,

View on GitHub (pinned to 7944b8e522)

Solutions

  1. Add/restore the coder agent definition in your config (agents.coder with a valid model).
  2. Regenerate the default config (delete the custom one so defaults apply).
  3. If building config in code, set Agents[config.AgentCoder] before NewCoordinator/UpdateModels.

Example fix

// before
agents {
  // only task defined
}
// after
agents {
  coder {
    model "anthropic/claude-sonnet-4"
  }
  task {
    model "anthropic/claude-sonnet-4"
  }
}
Defensive patterns

Strategy: validation

Validate before calling

if _, ok := cfg.Agents[config.AgentCoder]; !ok {
    return errors.New("config must define a 'coder' agent before starting the coordinator")
}

Try / catch

coord, err := NewCoordinator(ctx, opts)
if errors.Is(err, errCoderAgentNotConfigured) {
    // restore default config or add Agents[config.AgentCoder], then retry
}

Prevention

When it happens

Trigger: 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].

Common situations: 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.

Related errors


AI-assisted analysis of charmbracelet/crush@7944b8e522 (2026-08-29). Data as JSON: /api/errors/abb322c5860e44e1. Report an issue: GitHub.