iflytek/astron-agent · warning
Request ID cannot be empty
Error message
Request ID cannot be empty
What it means
Regeneration requires the id of the original question record. If requestId is null in validateReAnswerRequest, the controller sends 'Request ID cannot be empty' over SSE and completes the stream. Without it, the backend cannot identify which turn to re-answer.
Solutions
- Capture the server-issued request/message id when the original answer is received and pass it to reAnswer
- Disable regenerate until a valid requestId exists for the selected message
- Re-fetch conversation history to recover ids if client state was lost
Example fix
// before
reAnswer({ chatId });
// after
if (!questionRecordId) return;
reAnswer({ chatId, requestId: questionRecordId }); Defensive patterns
Strategy: validation
Validate before calling
if (requestId == null) { disableRegenerate(); return; } Type guard
function hasRequestId(id) { return id != null && (typeof id === 'number' || typeof id === 'string') && String(id).length > 0; } Prevention
- Store the server requestId when the original answer arrives
- Only enable regenerate for messages with a known requestId
- Refetch history to recover ids after state loss
When it happens
Trigger: Calling the reAnswer SSE endpoint without the requestId parameter (requestId == null).
Common situations: Frontend lost the message's server id (only local ids available); regenerate button wired to a flow that never captured the question record id; API clients omitting the parameter.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12).
Data as JSON: /api/errors/0b87ca270089ee97.
Report an issue: GitHub.
Appendix: source
Thrown at console/backend/hub/src/main/java/com/iflytek/astron/console/hub/controller/chat/ChatMessageController.java:347
* Validate the validity of re-answer request
*
* @param chatId Chat room ID
* @param requestId Request ID
* @param sseId Server-sent events ID
* @param sseEmitter SSE emitter
* @return ValidationResult Validation result
*/
private ValidationResult validateReAnswerRequest(Long chatId, Long requestId, String sseId, SseEmitter sseEmitter) {
if (chatId == null) {
log.warn("chatId is empty, sseId: {}", sseId);
SseEmitterUtil.sendError(sseEmitter, "Chat ID cannot be empty");
SseEmitterUtil.sendEndAndComplete(sseEmitter);
return ValidationResult.invalid();
}
if (requestId == null) {
log.warn("requestId is empty, sseId: {}, chatId: {}", sseId, chatId);
SseEmitterUtil.sendError(sseEmitter, "Request ID cannot be empty");
SseEmitterUtil.sendEndAndComplete(sseEmitter);
return ValidationResult.invalid();
}
return ValidationResult.valid();
}
/**
* Method to process re-answer request
*
* @param chatContext Chat context object, containing chat-related information
* @param requestId Unique identifier of the request
* @param sseEmitter Server-sent events emitter, used to push events to client
* @param sseId Server-sent events ID
* @return Processed SseEmitter object
*/
private SseEmitter processReAnswerRequest(ChatContext chatContext, Long requestId, SseEmitter sseEmitter, String sseId) {
log.info("Starting to process re-answer request, sseId: {}, requestId: {}",View on GitHub (pinned to 5e758547a8)