plandex-ai/plandex · error

No model config found for: %s

Error message

No model config found for: %s

What it means

Thrown when modelConfig.GetBaseModelConfig returns nil — i.e., no base model configuration could be resolved for the resolved model ID given the auth vars, plan settings, and org/user config. The tell flow cannot construct an LLM client without a base config, so it logs the offending ModelId, notifies, sends a 500 ApiError, and returns.

Source

Thrown at app/server/model/plan/tell_exec.go:419

			log.Println("Tell plan - got modelConfig for context phase")
		} else if state.currentStage.PlanningPhase == shared.PlanningPhaseTasks {
			modelConfig = state.settings.GetModelPack().Planner.GetRoleForInputTokens(requestTokens, state.settings)
			log.Println("Tell plan - got modelConfig for tasks phase")
		}
	} else if state.currentStage.TellStage == shared.TellStageImplementation {
		modelConfig = state.settings.GetModelPack().GetCoder().GetRoleForInputTokens(requestTokens, state.settings)
		log.Println("Tell plan - got modelConfig for implementation stage")
	}

	state.modelConfig = &modelConfig

	baseModelConfig := modelConfig.GetBaseModelConfig(authVars, state.settings, state.orgUserConfig)

	if baseModelConfig == nil {
		log.Println("Tell plan - baseModelConfig is nil")
		log.Println("Tell plan - modelConfig id:", modelConfig.ModelId)

		go notify.NotifyErr(notify.SeverityError, fmt.Errorf("No model config found for: %s", state.modelConfig.ModelId))
		active.StreamDoneCh <- &shared.ApiError{
			Type:   shared.ApiErrorTypeOther,
			Status: http.StatusInternalServerError,
			Msg:    "No model config found for: " + string(state.modelConfig.ModelId),
		}
		return
	}

	state.baseModelConfig = baseModelConfig

	// if the model doesn't support cache control, remove the cache control spec from the messages
	if !baseModelConfig.SupportsCacheControl {
		for i := range state.messages {
			for j := range state.messages[i].Content {
				if state.messages[i].Content[j].CacheControl != nil {
					state.messages[i].Content[j].CacheControl = nil
				}
			}

View on GitHub (pinned to e2d772072e)

Solutions

  1. Check the logged 'modelConfig id' and fix the model name in the plan's model pack settings
  2. Select a built-in/known model pack in plan settings
  3. Re-create the missing model config in the org's model registry
  4. Verify required auth vars / API keys for the model provider are set

Example fix

// before (settings.json)
"modelPack": { "planner": { "modelId": "gpt-4o-mini-pro" } }  // unknown id
// after
"modelPack": { "planner": { "modelId": "gpt-4o-mini" } }      // registered model id
Defensive patterns

Strategy: validation

Validate before calling

// before Tell, confirm the model pack resolves to known models
pack := settings.GetModelPack()
for _, role := range []string{"architect","planner","coder"} {
    if lookupBaseModelConfig(pack.Role(role).ModelId, authVars, orgUserConfig) == nil {
        return fmt.Errorf("model %q for role %s is not configured", pack.Role(role).ModelId, role)
    }
}

Try / catch

if apiErr := <-active.StreamDoneCh; apiErr != nil && strings.HasPrefix(apiErr.Msg, "No model config found for:") {
    // switch settings to a built-in model pack or register the missing model
}

Prevention

When it happens

Trigger: The model pack's planner/architect/coder role resolves to a model ID that has no matching base model config (GetRoleForInputTokens picked a role whose model is unknown); custom model packs referencing an unregistered model name; deleted/renamed model configs.

Common situations: Org switched to a custom model pack with a typo in the model name; model config removed from the database while a plan still references it; auth vars (API key env vars) missing so lookup fails; after a version upgrade renamed built-in model IDs.

Related errors


AI-assisted analysis of plandex-ai/plandex@e2d772072e (2026-09-05). Data as JSON: /api/errors/33251d4838314f7b. Report an issue: GitHub.