{"record":{"id":"33251d4838314f7b","repo":"plandex-ai/plandex","slug":"no-model-config-found-for-s","errorCode":null,"errorMessage":"No model config found for: %s","messagePattern":"No model config found for: (.+?)","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"app/server/model/plan/tell_exec.go","lineNumber":419,"sourceCode":"\t\t\tlog.Println(\"Tell plan - got modelConfig for context phase\")\n\t\t} else if state.currentStage.PlanningPhase == shared.PlanningPhaseTasks {\n\t\t\tmodelConfig = state.settings.GetModelPack().Planner.GetRoleForInputTokens(requestTokens, state.settings)\n\t\t\tlog.Println(\"Tell plan - got modelConfig for tasks phase\")\n\t\t}\n\t} else if state.currentStage.TellStage == shared.TellStageImplementation {\n\t\tmodelConfig = state.settings.GetModelPack().GetCoder().GetRoleForInputTokens(requestTokens, state.settings)\n\t\tlog.Println(\"Tell plan - got modelConfig for implementation stage\")\n\t}\n\n\tstate.modelConfig = &modelConfig\n\n\tbaseModelConfig := modelConfig.GetBaseModelConfig(authVars, state.settings, state.orgUserConfig)\n\n\tif baseModelConfig == nil {\n\t\tlog.Println(\"Tell plan - baseModelConfig is nil\")\n\t\tlog.Println(\"Tell plan - modelConfig id:\", modelConfig.ModelId)\n\n\t\tgo notify.NotifyErr(notify.SeverityError, fmt.Errorf(\"No model config found for: %s\", state.modelConfig.ModelId))\n\t\tactive.StreamDoneCh <- &shared.ApiError{\n\t\t\tType:   shared.ApiErrorTypeOther,\n\t\t\tStatus: http.StatusInternalServerError,\n\t\t\tMsg:    \"No model config found for: \" + string(state.modelConfig.ModelId),\n\t\t}\n\t\treturn\n\t}\n\n\tstate.baseModelConfig = baseModelConfig\n\n\t// if the model doesn't support cache control, remove the cache control spec from the messages\n\tif !baseModelConfig.SupportsCacheControl {\n\t\tfor i := range state.messages {\n\t\t\tfor j := range state.messages[i].Content {\n\t\t\t\tif state.messages[i].Content[j].CacheControl != nil {\n\t\t\t\t\tstate.messages[i].Content[j].CacheControl = nil\n\t\t\t\t}\n\t\t\t}","sourceCodeStart":401,"sourceCodeEnd":437,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/server/model/plan/tell_exec.go#L401-L437","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Check the logged 'modelConfig id' and fix the model name in the plan's model pack settings","Select a built-in/known model pack in plan settings","Re-create the missing model config in the org's model registry","Verify required auth vars / API keys for the model provider are set"],"exampleFix":"// before (settings.json)\n\"modelPack\": { \"planner\": { \"modelId\": \"gpt-4o-mini-pro\" } }  // unknown id\n// after\n\"modelPack\": { \"planner\": { \"modelId\": \"gpt-4o-mini\" } }      // registered model id","handlingStrategy":"validation","validationCode":"// before Tell, confirm the model pack resolves to known models\npack := settings.GetModelPack()\nfor _, role := range []string{\"architect\",\"planner\",\"coder\"} {\n    if lookupBaseModelConfig(pack.Role(role).ModelId, authVars, orgUserConfig) == nil {\n        return fmt.Errorf(\"model %q for role %s is not configured\", pack.Role(role).ModelId, role)\n    }\n}","typeGuard":null,"tryCatchPattern":"if apiErr := <-active.StreamDoneCh; apiErr != nil && strings.HasPrefix(apiErr.Msg, \"No model config found for:\") {\n    // switch settings to a built-in model pack or register the missing model\n}","preventionTips":["Only reference registered model IDs in custom model packs","Re-validate model pack settings after upgrades that rename models","Ensure provider auth vars exist for every model referenced","Spot-check plan settings model pack before long sessions"],"tags":["configuration","model","plan","llm"],"backgroundTag":"missing-model-configuration","analyzedSha":"e2d772072efadbe41d2946d97d79be55532dbab5","analyzedAt":"2026-09-05T20:56:53.631Z","contentChangedAt":"2026-09-05T20:56:53.631Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}