{"record":{"id":"75588cac2df6c907","repo":"Tencent/WeKnora","slug":"invalid-starter-suggestion-mode-q","errorCode":null,"errorMessage":"invalid starter suggestion mode %q","messagePattern":"invalid starter suggestion mode %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/types/custom_agent.go","lineNumber":389,"sourceCode":"}\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}\n\t}\n\tif len([]rune(strings.TrimSpace(c.FollowUps.AdditionalInstruction))) > 2000 {\n\t\treturn fmt.Errorf(\"follow-up additional_instruction exceeds 2000 characters\")\n\t}\n\tfor _, category := range c.FollowUps.Categories {\n\t\tif !oneOf(category, SuggestionCategoryClarify, SuggestionCategoryDeepen, SuggestionCategoryAction) {","sourceCodeStart":371,"sourceCodeEnd":407,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/types/custom_agent.go#L371-L407","documentation":"Validation error from QuestionSuggestionConfig.Validate: starters.Mode is not one of curated, knowledge, or hybrid, so the starter suggestion mode is rejected. The invalid raw mode value is quoted in the message.","triggerScenarios":"Thrown at internal/types/custom_agent.go:389 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use one of the allowed starter modes: curated, knowledge, hybrid","Map legacy mode names to supported values before validation"],"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"}