iflytek/astron-agent · error · BusinessException
NOT_CUSTOM_MODEL
NOT_CUSTOM_MODEL
Error message
BusinessException(ResponseEnum.NOT_CUSTOM_MODEL)
What it means
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.
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
Example fix
// before
llmService.selfModelConfig(modelId, llmSource); // llmSource may be 1 for built-in
// after
if (llmSource == 0) {
llmService.selfModelConfig(modelId, llmSource);
} else {
throw new IllegalArgumentException("self model config requires a custom model (llmSource=0)");
} Defensive patterns
Strategy: validation
Validate before calling
if (llmSource == null || llmSource != 0) {
throw new IllegalArgumentException("selfModelConfig requires llmSource == 0 (custom model), got: " + llmSource);
} Type guard
boolean isCustomModel(Integer llmSource) { return llmSource != null && llmSource == 0; } Try / catch
try {
Object cfg = llmService.selfModelConfig(id, llmSource);
} catch (BusinessException e) {
// NOT_CUSTOM_MODEL: redirect user to built-in model config instead
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.
Related errors
AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12).
Data as JSON: /api/errors/cbce434e4094253e.
Report an issue: GitHub.
Appendix: source
Thrown at console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/service/model/LLMService.java:544
domainSet.add(domain);
String serviceId = n.getData().getNodeParam().getString("serviceId");
String patchId = n.getData().getNodeParam().getString("patchId");
if ("0".equals(patchId)) {
patchId = null;
}
array.add(new JSONObject()
.fluentPut("domain", domain)
.fluentPut("channel", serviceId)
.fluentPut("patchId", patchId));
}
});
return array;
}
public Object selfModelConfig(Long id, Integer llmSource) {
if (llmSource != 0) {
throw new BusinessException(ResponseEnum.NOT_CUSTOM_MODEL);
}
String uid = UserInfoManagerHandler.getUserId();
Model one = modelMapper.selectOne(new LambdaQueryWrapper<Model>().eq(Model::getId, id));
if (one == null) {
throw new BusinessException(ResponseEnum.MODEL_NOT_EXIST);
}
if (!Objects.equals(uid, one.getUid())) {
throw new BusinessException(ResponseEnum.EXCEED_AUTHORITY);
}
List<Config> configs = JSON.parseArray(one.getConfig(), Config.class);
if (CollUtil.isNotEmpty(configs)) {
for (Config config : configs) {
Float precision = config.getPrecision();
if (precision != null) {
// If precision is an integer greater than 1, convert to decimal form, e.g., 1 to 0.1, 2 to 0.01,
// etc.
int intPrec = Math.round(precision);View on GitHub (pinned to 5e758547a8)