iflytek/astron-agent · warning
Please enter chat content
Error message
Please enter chat content
What it means
BotChatServiceImpl.chatMessageBot rejects chat requests whose user input (ask) is blank. Instead of throwing, it completes the SSE emitter with an error whose message is "Please enter chat content". This is an input-validation guard preventing empty prompts from reaching the agent engine.
Solutions
- Disable send / validate non-blank input in the UI before calling the chat API.
- Trim and check the ask field client-side; show the validation message instead of opening an SSE stream.
- If legitimate messages are rejected, verify the client serializes the message into the correct DTO field (ask).
Example fix
// before
SseEmitterUtil.completeWithError(sseEmitter, "Please enter chat content");
// after
// client-side guard
if (!ask || !ask.trim()) { showError('Please enter chat content'); return; }
const res = await api.chat({ ...body, ask: ask.trim() }); Defensive patterns
Strategy: validation
Validate before calling
// before calling the chat API
const ask = (input ?? '').trim();
if (!ask) { showWarning('Please enter chat content'); return; }
await chatApi.send({ ...body, ask }); Type guard
function hasContent(s) {
return typeof s === 'string' && s.trim().length > 0;
} Prevention
- Disable the send button while the input is empty/whitespace.
- Trim user input before submit.
- Handle the SSE error event and show the message instead of a blank stream failure.
- Ensure the message is serialized into the correct DTO field (ask).
When it happens
Trigger: chatMessageBot invoked with chatBotReqDto.getAsk() being null, empty string, or whitespace-only (StrUtil.isBlank).
Common situations: Frontend sends the chat request before the user typed anything (Enter on empty box); whitespace-only input; form submitted programmatically; message field serialization mismatch between client and DTO.
Understand the failure class
Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.
Related errors
- Please enter chat content
- Chat ID cannot be empty
- PARAMETER_ERROR
- LONG_CONTENT_CHAT_ID_ERROR
- LONG_CONTENT_MISS_FILE_INFO
AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12).
Data as JSON: /api/errors/898ecde44e4cb894.
Report an issue: GitHub.
Appendix: source
Thrown at console/backend/hub/src/main/java/com/iflytek/astron/console/hub/service/chat/impl/BotChatServiceImpl.java:133
@Autowired
private AgentMemoryRuntimeService agentMemoryRuntimeService;
/**
* Function to handle chat messages
*
* @param chatBotReqDto Chat bot request data object
* @param sseEmitter Server-sent events emitter
* @param sseId Server-sent events ID
* @param workflowOperation Workflow operation
* @param workflowVersion Workflow version
*/
@Override
public void chatMessageBot(ChatBotReqDto chatBotReqDto, SseEmitter sseEmitter, String sseId, String workflowOperation, String workflowVersion) {
try {
if (StrUtil.isBlank(chatBotReqDto.getAsk())) {
log.warn("Rejecting chat request with empty user input, sseId: {}, chatId: {}, uid: {}",
sseId, chatBotReqDto.getChatId(), chatBotReqDto.getUid());
SseEmitterUtil.completeWithError(sseEmitter, "Please enter chat content");
return;
}
log.info("Processing chat request, sseId: {}, chatId: {}, uid: {}", sseId, chatBotReqDto.getChatId(), chatBotReqDto.getUid());
Long spaceId = SpaceInfoUtil.getSpaceId();
BotConfiguration botConfig = getBotConfiguration(chatBotReqDto.getBotId());
if (botConfig.version.equals(BotTypeEnum.WORKFLOW_BOT.getType()) || botConfig.version.equals(BotTypeEnum.TALK.getType())) {
syncWorkflowRuntimeModel(chatBotReqDto.getBotId(), botConfig, chatBotReqDto.getUid(), spaceId, sseEmitter);
workflowBotChatService.chatWorkflowBot(chatBotReqDto, sseEmitter, sseId, workflowOperation, workflowVersion);
} else {
ChatReqRecords chatReqRecords = createChatRequest(chatBotReqDto);
ModelConfigResult modelConfig = resolveChatModelConfiguration(
botConfig.modelId, botConfig.model, chatBotReqDto.getUid(), spaceId, sseEmitter);
int maxInputTokens = modelConfig == null ? this.maxInputTokens : modelConfig.maxInputTokens();
List<SparkChatRequest.MessageDto> messages = buildMessageList(chatBotReqDto, botConfig.supportContext,
botConfig.supportDocument, botConfig.prompt, maxInputTokens, chatReqRecords.getId());View on GitHub (pinned to 5e758547a8)