{"record":{"id":"864c01109694aba7","repo":"Tencent/WeKnora","slug":"follow-up-suggestion-count-must-be-between-1-and-5","errorCode":null,"errorMessage":"follow-up suggestion count must be between 1 and 5","messagePattern":"follow-up suggestion count must be between 1 and 5","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/types/custom_agent.go","lineNumber":383,"sourceCode":"\t\tc.FollowUps.Categories = []string{\n\t\t\tSuggestionCategoryClarify,\n\t\t\tSuggestionCategoryDeepen,\n\t\t\tSuggestionCategoryAction,\n\t\t}\n\t}\n}\n\n// Validate rejects invalid agent-authored suggestion settings before they are\n// persisted or used to incur a model call.\nfunc (c *QuestionSuggestionConfig) Validate() error {\n\tif c == nil {\n\t\treturn nil\n\t}\n\tif c.Starters.Count < 1 || c.Starters.Count > 8 {\n\t\treturn fmt.Errorf(\"starter suggestion count must be between 1 and 8\")\n\t}\n\tif c.FollowUps.Count < 1 || c.FollowUps.Count > 5 {\n\t\treturn fmt.Errorf(\"follow-up suggestion count must be between 1 and 5\")\n\t}\n\tif c.FollowUps.MaxContextTurns < 1 || c.FollowUps.MaxContextTurns > 5 {\n\t\treturn fmt.Errorf(\"follow-up max_context_turns must be between 1 and 5\")\n\t}\n\tif !oneOf(c.Starters.Mode, SuggestionModeCurated, SuggestionModeKnowledge, SuggestionModeHybrid) {\n\t\treturn fmt.Errorf(\"invalid starter suggestion mode %q\", c.Starters.Mode)\n\t}\n\tif !oneOf(c.FollowUps.Mode, SuggestionModeGenerated, SuggestionModeKnowledge, SuggestionModeHybrid) {\n\t\treturn fmt.Errorf(\"invalid follow-up suggestion mode %q\", c.FollowUps.Mode)\n\t}\n\tfor i, item := range c.Starters.Items {\n\t\ttrimmed := strings.TrimSpace(item)\n\t\tif trimmed == \"\" {\n\t\t\treturn fmt.Errorf(\"starter suggestion %d cannot be empty\", i+1)\n\t\t}\n\t\tif len([]rune(trimmed)) > 200 {\n\t\t\treturn fmt.Errorf(\"starter suggestion %d exceeds 200 characters\", i+1)\n\t\t}","sourceCodeStart":365,"sourceCodeEnd":401,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/types/custom_agent.go#L365-L401","documentation":"Configuration validation in QuestionSuggestionConfig.Validate: the follow-up suggestion Count is outside the allowed 1–5 range. The tighter cap (versus 8 for starters) reflects per-turn follow-up cost; the config is rejected before persistence to avoid expensive suggestion generation with an invalid count.","triggerScenarios":"Thrown at internal/types/custom_agent.go:383 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Clamp follow-ups.Count into 1..5 before Validate","Return a field-level error to the authoring agent"],"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-08T10:18:20.063Z"}