iflytek/astron-agent · error
Record for re-answer request does not exist
Error message
Record for re-answer request does not exist
What it means
When a re-answer (regenerate) request includes requestId, validateChatContext verifies the original ChatReqRecords row exists via chatDataService.findRequestById. If the record is missing, 'Record for re-answer request does not exist' is sent over SSE and the stream ends. The requestId must point to a persisted prior question turn.
Solutions
- Refresh the message history from the server and use a valid requestId of an existing question turn
- Disable the re-answer button until a server-confirmed message id is available
- Check record retention settings if old messages are routinely purged
Example fix
// before
reAnswer({ chatId, requestId: msg.localId });
// after
const rec = messages.find(m => m.serverRequestId);
if (!rec) return;
reAnswer({ chatId, requestId: rec.serverRequestId }); Defensive patterns
Strategy: validation
Validate before calling
const rec = history.find(m => m.requestId === requestId && m.role === 'user');
if (!rec) { await reloadHistory(); return; } Type guard
function hasRequestId(m) { return m != null && (typeof m.requestId === 'number' || typeof m.requestId === 'string') && !!m.requestId; } Prevention
- Only use server-issued record ids for regeneration
- Reload history when ids look stale
- Do not fabricate or cache requestIds across sessions
When it happens
Trigger: Calling the reAnswer endpoint with a requestId that has no matching row in the chat request-records table.
Common situations: Frontend retries regeneration with a stale or fabricated requestId; record purged by retention/cleanup; pointing at a record from another environment/database; id type mismatch causing lookup miss.
Understand the failure class
Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.
Related errors
- Current conversation window is unavailable
- DATA_NOT_FOUND
- Chat ID cannot be empty
- Please enter chat content
- Current conversation window assistant has been deleted
AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12).
Data as JSON: /api/errors/6dfc07e22c5405fa.
Report an issue: GitHub.
Appendix: source
Thrown at console/backend/hub/src/main/java/com/iflytek/astron/console/hub/controller/chat/ChatMessageController.java:176
SseEmitterUtil.sendError(sseEmitter, "Current conversation window is unavailable");
SseEmitterUtil.sendEndAndComplete(sseEmitter);
return null;
}
Integer botId = chatList.getBotId();
if (chatBotDataService.botIsDeleted(botId.longValue())) {
log.warn("Current conversation window assistant has been deleted, sseId: {}, uid: {}, chatId: {}, botId: {}", sseId, uid, chatId, botId);
SseEmitterUtil.sendError(sseEmitter, "Current conversation window assistant has been deleted");
SseEmitterUtil.sendEndAndComplete(sseEmitter);
return null;
}
// Re-answering requires validating the legitimacy of question ID
if (requestId != null) {
ChatReqRecords chatReqRecord = chatDataService.findRequestById(requestId);
if (chatReqRecord == null) {
log.warn("Record for re-answer request does not exist, sseId: {}, requestId: {}", sseId, requestId);
SseEmitterUtil.sendError(sseEmitter, "Record for re-answer request does not exist");
SseEmitterUtil.sendEndAndComplete(sseEmitter);
return null;
} else if (!chatReqRecord.getChatId().equals(chatId) || !chatReqRecord.getUid().equals(uid)) {
log.warn("Record for re-answer request does not match, sseId: {}, uid: {}, chatId: {}, requestId: {}", sseId, uid, chatId, requestId);
SseEmitterUtil.sendError(sseEmitter, "Record for re-answer request does not match");
SseEmitterUtil.sendEndAndComplete(sseEmitter);
return null;
}
}
return new ChatContext(uid, chatId, botId);
}
/**
* Method to process chat request
*
* @param chatContext Chat context object
* @param text User input textView on GitHub (pinned to 5e758547a8)