{"record":{"id":"bcabbaddd3a0e60e","repo":"alibaba/nacos","slug":"background-information-is-required","errorCode":null,"errorMessage":"Background information is required","messagePattern":"Background information is required","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":400,"severity":"error","filePath":"copilot/src/main/java/com/alibaba/nacos/copilot/form/SkillGenerationForm.java","lineNumber":53,"sourceCode":"    private String backgroundInfo;\n    \n    /**\n     * Selected MCP tools (optional).\n     */\n    private List<Map<String, Object>> selectedMcpTools;\n    \n    /**\n     * Conversation history (optional).\n     * Contains user inputs, tool calls, and model responses.\n     */\n    private ConversationHistory conversationHistory;\n    \n    /**\n     * Validate form data.\n     */\n    public void validate() {\n        if (StringUtils.isBlank(backgroundInfo)) {\n            throw new IllegalArgumentException(\"Background information is required\");\n        }\n    }\n    \n    public String getBackgroundInfo() {\n        return backgroundInfo;\n    }\n    \n    public void setBackgroundInfo(String backgroundInfo) {\n        this.backgroundInfo = backgroundInfo;\n    }\n    \n    public List<Map<String, Object>> getSelectedMcpTools() {\n        return selectedMcpTools;\n    }\n    \n    public void setSelectedMcpTools(List<Map<String, Object>> selectedMcpTools) {\n        this.selectedMcpTools = selectedMcpTools;\n    }","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/copilot/src/main/java/com/alibaba/nacos/copilot/form/SkillGenerationForm.java#L35-L71","documentation":"Thrown by SkillGenerationForm.validate() (copilot module) when the `backgroundInfo` field is null, empty, or whitespace-only. This form backs the POST /v3/console/copilot/skill/generate SSE endpoint. Background information is the only required field — selectedMcpTools and conversationHistory are optional — because the AI needs context to generate a skill.","triggerScenarios":"Posting to /v3/console/copilot/skill/generate with backgroundInfo omitted, null, empty, or whitespace. Selected tools and conversation history are optional and won't trigger this error.","commonSituations":"User clicks 'generate skill' without describing the desired skill. Form reset clearing the background field. Programmatic call with an empty body.","solutions":["Provide a non-blank `backgroundInfo` string describing the skill to generate.","Disable the generate button in the UI until backgroundInfo has content.","Validate the payload before posting to the SSE endpoint."],"exampleFix":"// before\nbody: JSON.stringify({ backgroundInfo, selectedMcpTools })\n\n// after\nif (!backgroundInfo.trim()) {\n  setError('Please describe the skill you want to generate');\n  return;\n}\nbody: JSON.stringify({ backgroundInfo, selectedMcpTools })","handlingStrategy":"validation","validationCode":"function hasBackgroundInfo(backgroundInfo: unknown): boolean {\n  return typeof backgroundInfo === 'string' && backgroundInfo.trim().length > 0;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Provide a non-blank backgroundInfo describing the skill to generate.","Disable the generate button until background info is entered.","Validate the payload before posting to the SSE endpoint."],"tags":["copilot","skill-generation","java","validation","form"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}