iflytek/astron-agent · error · BusinessException
MODEL_CHECK_FAILED
MODEL_CHECK_FAILED
Error message
MODEL_CHECK_FAILED
What it means
Thrown in BotChatServiceImpl.debugChatMessageBot when modelService.checkModelBase rejects the resolved model's llmId/serviceId/url for the requesting uid/spaceId. It wraps ResponseEnum.MODEL_CHECK_FAILED, meaning the model failed a base availability/authorization check before the chat task was built.
Solutions
- Confirm the bot's configured model still exists and is deployed (check llmId/serviceId/url).
- Verify the user (uid) has access to the model in spaceId; grant model permissions if needed.
- Re-select a valid model in the bot configuration and save.
- Check model service health/logs for why checkModelBase returned false.
Example fix
// before
if (!modelService.checkModelBase(modelConfig.llmInfoVo().getLlmId(),
modelConfig.llmInfoVo().getServiceId(), modelConfig.llmInfoVo().getUrl(), request.getUid(), request.getSpaceId())) {
throw new BusinessException(ResponseEnum.MODEL_CHECK_FAILED);
}
// after
if (!modelService.checkModelBase(modelConfig.llmInfoVo().getLlmId(),
modelConfig.llmInfoVo().getServiceId(), modelConfig.llmInfoVo().getUrl(), request.getUid(), request.getSpaceId())) {
log.error("Model check failed, llmId: {}, uid: {}, spaceId: {}",
modelConfig.llmInfoVo().getLlmId(), request.getUid(), request.getSpaceId());
throw new BusinessException(ResponseEnum.MODEL_CHECK_FAILED);
} Defensive patterns
Strategy: validation
Validate before calling
// Pre-flight check before debug chat:
boolean ok = modelService.checkModelBase(llmId, serviceId, url, uid, spaceId);
if (!ok) { throw new BusinessException(ResponseEnum.MODEL_CHECK_FAILED); } Try / catch
try {
botChatService.debugChatMessageBot(request, sseEmitter);
} catch (BusinessException e) {
if (ResponseEnum.MODEL_CHECK_FAILED == e.getCode()) {
// prompt user to re-select an available model for this space
}
} Prevention
- Re-validate bot model configuration whenever models are republished or removed.
- Keep per-space model permission lists in sync with bot configs.
- Surface model availability in the UI before allowing chat.
When it happens
Trigger: debugChatMessageBot resolves a modelConfig; if modelConfig != null and checkModelBase(llmId, serviceId, url, uid, spaceId) returns false (model unavailable, not deployed, or not permitted in that space), BusinessException(MODEL_CHECK_FAILED) is thrown.
Common situations: Bot configured with a model the user/space has no access to; model service URL changed or deployment is down; model was unpublished/removed but still referenced in bot config; cross-space usage of a private model.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- MODEL_NOT_EXIST
- EXCEED_AUTHORITY
- Current conversation window is unavailable
- Record for re-answer request does not match
- CHAT_REQ_NOT_BELONG_ERROR
AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12).
Data as JSON: /api/errors/b55ae8be73c72e1c.
Report an issue: GitHub.
Appendix: source
Thrown at console/backend/hub/src/main/java/com/iflytek/astron/console/hub/service/chat/impl/BotChatServiceImpl.java:253
* @param request Debug chat bot request parameters
* @param sseEmitter SSE emitter
* @param sseId SSE ID
*/
@Override
public void debugChatMessageBot(DebugChatBotReqDto request, SseEmitter sseEmitter, String sseId) {
try {
List<SparkChatRequest.MessageDto> messageList;
// get personality config prompt
String prompt = personalityConfigService.getChatPrompt(request.getPersonalityConfig(), request.getPrompt());
ModelConfigResult modelConfig = resolveChatModelConfiguration(
request.getModelId(), request.getModel(), request.getUid(), request.getSpaceId(), sseEmitter);
int maxInputTokens = modelConfig == null ? this.maxInputTokens : modelConfig.maxInputTokens();
messageList = buildDebugMessageList(request.getText(), prompt, request.getMessages(), maxInputTokens,
request.getMaasDatasetList());
if (modelConfig != null) {
if (!modelService.checkModelBase(modelConfig.llmInfoVo().getLlmId(),
modelConfig.llmInfoVo().getServiceId(), modelConfig.llmInfoVo().getUrl(), request.getUid(), request.getSpaceId())) {
throw new BusinessException(ResponseEnum.MODEL_CHECK_FAILED);
}
}
AgentChatTask task = AgentChatTask.builder()
.llmInfoVo(modelConfig == null ? null : modelConfig.llmInfoVo())
.sparkModelName(modelConfig == null ? request.getModel() : null)
.messages(messageList)
.openedTool(request.getOpenedTool())
.mcpServerUrls(request.getMcpServerUrls())
.skills(enrichBotSkills(request.getSkills()))
.tools(request.getTools())
.workflows(request.getWorkflows())
.userId(request.getUid())
.chatId(null)
.botId(request.getBotId())
.spaceId(request.getSpaceId())
.debugSessionId(request.getDebugSessionId())
.rawUserText(request.getText())
.chatReqRecords(null)View on GitHub (pinned to 5e758547a8)