iflytek/astron-agent · error

Current conversation window assistant has been deleted

Error message

Current conversation window assistant has been deleted

What it means

After resolving the chat window, validateChatContext checks whether the assistant (bot) bound to that chat was deleted via chatBotDataService.botIsDeleted. If it was, the controller sends 'Current conversation window assistant has been deleted' over SSE and terminates the stream, since messaging a deleted bot is meaningless.

Solutions

  1. Detect bot deletion in the UI (e.g. via chat/bot metadata) and disable the composer with a notice
  2. Navigate the user back to the bot list or prompt them to re-create the assistant
  3. Filter out chats whose bots are deleted when listing conversations

Example fix

// before
openChat(chat); send(text);
// after
if (chat.botDeleted) { showNotice('Assistant deleted'); return; }
openChat(chat); send(text);
Defensive patterns

Strategy: fallback

Validate before calling

const bots = await getBots();
if (!bots.some(b => b.id === chat.botId && !b.deleted)) { showNotice('Assistant deleted'); return; }

Type guard

function botAlive(bot) { return bot != null && bot.deleted !== true; }

Try / catch

sse.onerror = (e) => { if (lastErrorFrame === 'Current conversation window assistant has been deleted') navigateBackToBotList(); };

Prevention

When it happens

Trigger: Sending a message in a chat whose associated botId has been deleted (botIsDeleted(botId) returns true).

Common situations: An assistant was deleted (or unpublished as deleted) while a user still had its conversation open; frontend kept a stale chat session after bot removal; soft-delete cleanup racing active chats.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — 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/94a2c5475fef38d2. Report an issue: GitHub.

Appendix: source

Thrown at console/backend/hub/src/main/java/com/iflytek/astron/console/hub/controller/chat/ChatMessageController.java:166

     * @param sseId Server-sent events ID
     * @param sseEmitter Server-sent events emitter
     * @return Valid chat context or null
     */
    private ChatContext validateChatContext(Long chatId, Long requestId, String sseId, SseEmitter sseEmitter) {
        String uid = RequestContextUtil.getUID();

        ChatList chatList = chatListDataService.findByUidAndChatId(uid, chatId);
        if (chatList == null) {
            log.warn("Chat window is unavailable or illegal access, sseId: {}, uid: {}, chatId: {}", sseId, uid, chatId);
            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;
            }

View on GitHub (pinned to 5e758547a8)