{"record":{"id":"46d197f36f7366ce","repo":"iflytek/astron-agent","slug":"personality-ai-generate-error","errorCode":"PERSONALITY_AI_GENERATE_ERROR","errorMessage":"ResponseEnum.PERSONALITY_AI_GENERATE_ERROR","messagePattern":"ResponseEnum\\.PERSONALITY_AI_GENERATE_ERROR","errorType":"error_code","errorClass":"BusinessException","httpStatus":null,"severity":"error","filePath":"console/backend/hub/src/main/java/com/iflytek/astron/console/hub/service/bot/impl/PersonalityConfigServiceImpl.java","lineNumber":55,"sourceCode":"    private final PersonalityCategoryMapper personalityCategoryMapper;\n\n    private final PersonalityRoleMapper personalityRoleMapper;\n\n    private final OpenAiModelProcessService openAiModelProcessService;\n\n    @Override\n    public String aiGeneratedPersonality(String botName, String category, String info, String prompt) {\n        if (StringUtils.isBlank(botName) || StringUtils.isBlank(category) || StringUtils.isBlank(info)\n                || StringUtils.isBlank(prompt)) {\n            throw new BusinessException(ResponseEnum.PERSONALITY_AI_GENERATE_PARAM_EMPTY);\n        }\n        String answer;\n        try {\n            String format = smartFormat(I18nUtil.getMessage(\"personality.ai.generated\"), botName, category, info, prompt);\n            answer = openAiModelProcessService.processNonStreaming(format);\n        } catch (Exception e) {\n            log.error(\"aiGeneratedPersonality error, botName: {}, category: {}, info: {}, prompt: {}\", botName, category, info, prompt, e);\n            throw new BusinessException(ResponseEnum.PERSONALITY_AI_GENERATE_ERROR);\n        }\n        if (StringUtils.isBlank(answer)) {\n            throw new BusinessException(ResponseEnum.PERSONALITY_AI_GENERATE_ERROR);\n        }\n        return answer;\n    }\n\n    @Override\n    public String aiPolishing(String botName, String category, String info, String prompt, String personality) {\n        if (StringUtils.isBlank(botName) || StringUtils.isBlank(category) || StringUtils.isBlank(info)\n                || StringUtils.isBlank(prompt)) {\n            throw new BusinessException(ResponseEnum.PERSONALITY_AI_GENERATE_PARAM_EMPTY);\n        }\n        String answer;\n        try {\n            String format = smartFormat(I18nUtil.getMessage(\"personality.ai.polishing\"), botName, category, info, prompt, personality);\n            answer = openAiModelProcessService.processNonStreaming(format);\n        } catch (Exception e) {","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/console/backend/hub/src/main/java/com/iflytek/astron/console/hub/service/bot/impl/PersonalityConfigServiceImpl.java#L37-L73","documentation":"PERSONALITY_AI_GENERATE_ERROR is thrown from aiGeneratedPersonality when the downstream LLM call (openAiModelProcessService.processNonStreaming) raises any exception. It wraps model-call failures — network problems, auth errors, timeouts — behind a single business error.","triggerScenarios":"openAiModelProcessService.processNonStreaming(format) throws: model service unreachable, invalid/expired API credentials, request timeout, or the i18n message 'personality.ai.generated' missing causing template formatting failure.","commonSituations":"Model API key not configured or rotated; LLM provider outage; network egress blocked from the hub service; missing i18n resource bundle key in a locale.","solutions":["Check hub logs for the 'aiGeneratedPersonality error' entry with the full stack trace to see the underlying cause.","Verify the OpenAI/model process service credentials and endpoint configuration.","Confirm the i18n key 'personality.ai.generated' exists for the active locale.","Retry after confirming the model service is healthy; if the provider is down, wait for recovery."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// verify model service reachability/credentials before calling\nObjects.requireNonNull(openAiModelProcessService, \"model process service not configured\");","typeGuard":null,"tryCatchPattern":"try {\n    String answer = openAiModelProcessService.processNonStreaming(prompt);\n} catch (BusinessException e) {\n    throw e;\n} catch (Exception e) {\n    log.error(\"personality AI generation failed\", e);\n    throw new BusinessException(ResponseEnum.PERSONALITY_AI_GENERATE_ERROR, e.getMessage());\n}","preventionTips":["Monitor model service health and alert on failures","Keep platform API keys rotated and valid in config","Ensure i18n keys exist for every deployed locale","Add timeouts and retries around the model call"],"tags":["llm","network","upstream-failure","business-exception"],"backgroundTag":"api-request-failed","analyzedSha":"5e758547a83371a5a4b29dadf4ac03e8dd527635","analyzedAt":"2026-09-12T08:03:51.356Z","contentChangedAt":"2026-09-12T08:03:51.356Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}