{"record":{"id":"48940b1c5bd827b0","repo":"Tencent/WeKnora","slug":"summary-model-is-not-configured","errorCode":null,"errorMessage":"summary model is not configured","messagePattern":"summary model is not configured","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/application/service/knowledge_process.go","lineNumber":2270,"sourceCode":"}\n\n// RegenerateKnowledgeSummary refreshes both the knowledge description and the\n// summary chunk(s), then reindexes only those summary chunks. It is\n// intentionally idempotent.\nfunc (s *knowledgeService) RegenerateKnowledgeSummary(\n\tctx context.Context, knowledgeID string,\n) (*types.Knowledge, error) {\n\ttenantID := types.MustTenantIDFromContext(ctx)\n\tknowledge, err := s.repo.GetKnowledgeByID(ctx, tenantID, knowledgeID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tkb, err := s.kbService.GetKnowledgeBaseByID(ctx, knowledge.KnowledgeBaseID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif kb.SummaryModelID == \"\" {\n\t\treturn nil, fmt.Errorf(\"summary model is not configured\")\n\t}\n\tallChunks, err := s.chunkRepo.ListChunksByKnowledgeID(ctx, tenantID, knowledgeID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\ttextChunks := make([]*types.Chunk, 0)\n\tfor _, chunk := range allChunks {\n\t\tif chunk.ChunkType == types.ChunkTypeText && chunk.IsEnabled {\n\t\t\ttextChunks = append(textChunks, chunk)\n\t\t}\n\t}\n\tif len(textChunks) == 0 {\n\t\tknowledge.Description = \"\"\n\t\tknowledge.SummaryStatus = types.SummaryStatusFailed\n\t\tknowledge.UpdatedAt = time.Now()\n\t\tif updateErr := s.repo.UpdateKnowledge(ctx, knowledge); updateErr != nil {\n\t\t\treturn knowledge, updateErr\n\t\t}","sourceCodeStart":2252,"sourceCodeEnd":2288,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/application/service/knowledge_process.go#L2252-L2288","documentation":"Configuration guard in RegenerateKnowledgeSummary: the knowledge base has no SummaryModelID configured, so summary refresh cannot run. Same root cause as question generation failing: incomplete KB model configuration, not a runtime fault.","triggerScenarios":"Thrown at internal/application/service/knowledge_process.go:2270 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set a summary model on the knowledge base","Retry RegenerateKnowledgeSummary once configured","Surface KB config completeness in admin UI to prevent the call"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"988cbb03305e055d8ebb7d46d9ac6cc0803cd074","analyzedAt":"2026-09-02T14:41:08.344Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}