{"record":{"id":"cbce434e4094253e","repo":"iflytek/astron-agent","slug":"not-custom-model","errorCode":"NOT_CUSTOM_MODEL","errorMessage":"BusinessException(ResponseEnum.NOT_CUSTOM_MODEL)","messagePattern":"BusinessException\\(ResponseEnum\\.NOT_CUSTOM_MODEL\\)","errorType":"error_code","errorClass":"BusinessException","httpStatus":null,"severity":"error","filePath":"console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/service/model/LLMService.java","lineNumber":544,"sourceCode":"                domainSet.add(domain);\n                String serviceId = n.getData().getNodeParam().getString(\"serviceId\");\n                String patchId = n.getData().getNodeParam().getString(\"patchId\");\n                if (\"0\".equals(patchId)) {\n                    patchId = null;\n                }\n                array.add(new JSONObject()\n                        .fluentPut(\"domain\", domain)\n                        .fluentPut(\"channel\", serviceId)\n                        .fluentPut(\"patchId\", patchId));\n            }\n        });\n\n        return array;\n    }\n\n    public Object selfModelConfig(Long id, Integer llmSource) {\n        if (llmSource != 0) {\n            throw new BusinessException(ResponseEnum.NOT_CUSTOM_MODEL);\n        }\n        String uid = UserInfoManagerHandler.getUserId();\n\n        Model one = modelMapper.selectOne(new LambdaQueryWrapper<Model>().eq(Model::getId, id));\n        if (one == null) {\n            throw new BusinessException(ResponseEnum.MODEL_NOT_EXIST);\n        }\n        if (!Objects.equals(uid, one.getUid())) {\n            throw new BusinessException(ResponseEnum.EXCEED_AUTHORITY);\n        }\n        List<Config> configs = JSON.parseArray(one.getConfig(), Config.class);\n        if (CollUtil.isNotEmpty(configs)) {\n            for (Config config : configs) {\n                Float precision = config.getPrecision();\n                if (precision != null) {\n                    // If precision is an integer greater than 1, convert to decimal form, e.g., 1 to 0.1, 2 to 0.01,\n                    // etc.\n                    int intPrec = Math.round(precision);","sourceCodeStart":526,"sourceCodeEnd":562,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/service/model/LLMService.java#L526-L562","documentation":"LLMService.selfModelConfig only supports custom (self-hosted) models, identified by llmSource == 0. Any other llmSource (built-in/platform models) throws BusinessException(NOT_CUSTOM_MODEL) because per-instance config editing is only meaningful for user-defined models.","triggerScenarios":"Calling selfModelConfig(id, llmSource) with llmSource != 0, e.g. a frontend sending the source code of a built-in model or omitting/altering the llmSource parameter when requesting self-model config for a model instance.","commonSituations":"Frontend bug sending wrong llmSource; caller invoking the self-model config endpoint for a built-in marketplace model; enum values changed between frontend/backend versions.","solutions":["Verify the llmSource value sent by the caller; only 0 (custom model) is supported","In the frontend, only offer the self-model-config UI for custom models","Check for enum drift between client and server llmSource constants","Return a clearer client-side message before calling the API when the model is not custom"],"exampleFix":"// before\nllmService.selfModelConfig(modelId, llmSource); // llmSource may be 1 for built-in\n// after\nif (llmSource == 0) {\n    llmService.selfModelConfig(modelId, llmSource);\n} else {\n    throw new IllegalArgumentException(\"self model config requires a custom model (llmSource=0)\");\n}","handlingStrategy":"validation","validationCode":"if (llmSource == null || llmSource != 0) {\n    throw new IllegalArgumentException(\"selfModelConfig requires llmSource == 0 (custom model), got: \" + llmSource);\n}","typeGuard":"boolean isCustomModel(Integer llmSource) { return llmSource != null && llmSource == 0; }","tryCatchPattern":"try {\n    Object cfg = llmService.selfModelConfig(id, llmSource);\n} catch (BusinessException e) {\n    // NOT_CUSTOM_MODEL: redirect user to built-in model config instead\n}","preventionTips":["Only expose the self-model-config UI for custom models","Share llmSource constants between frontend and backend","Validate llmSource client-side before the request","Document llmSource semantics in the API"],"tags":["validation","llm","java","argument-check"],"backgroundTag":"invalid-argument-value","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"}