iflytek/astron-agent · error · BusinessException

CHAT_REQ_ZJ_ERROR

CHAT_REQ_ZJ_ERROR

Error message

CHAT_REQ_ZJ_ERROR

What it means

CHAT_REQ_ZJ_ERROR is thrown when inserting a chat request record for a chat list that has enable == 0, i.e. the conversation is disabled. The service checks the ChatList row for (chatId, uid); if the chat exists but is disabled, no new message request is accepted.

Solutions

  1. Create a new chat session instead of reusing the disabled chatId
  2. Re-fetch chat list state and re-enable the chat if your business flow allows
  3. Check enable field of ChatList for the chatId before sending
  4. Verify the client isn't caching an outdated chatId

Example fix

// before
await chat(chatId, msg);
// after
const list = await getChatList(chatId);
if (list.enable === 0) chatId = await createChat();
await chat(chatId, msg);
Defensive patterns

Strategy: try-catch

Validate before calling

const chat = await getChatList(chatId); if (chat && chat.enable === 0) chatId = await createChat();

Try / catch

try { await sendChat(chatId, msg); } catch (e) { if (e.code === 'CHAT_REQ_ZJ_ERROR') await startNewChat(); }

Prevention

When it happens

Trigger: Sending a chat message to a conversation that was disabled (enable=0), typically after it was cleared, archived, or administratively disabled.

Common situations: Client keeps chatting on an old chatId after clearing; chat disabled by admin/moderation; user resumed a stale session in UI.

Understand the failure class

Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.

Related errors


AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12). Data as JSON: /api/errors/5acf1ba4e8e6ce7d. Report an issue: GitHub.

Appendix: source

Thrown at console/backend/hub/src/main/java/com/iflytek/astron/console/hub/data/impl/ChatDataServiceImpl.java:96

        return chatReqRecordsMapper.selectList(wrapper);
    }

    @Override
    public List<ChatReqRecords> findRequestsByChatIdAndTimeRange(Long chatId, LocalDateTime startTime, LocalDateTime endTime) {
        LambdaQueryWrapper<ChatReqRecords> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(ChatReqRecords::getChatId, chatId);
        wrapper.between(ChatReqRecords::getCreateTime, startTime, endTime);
        wrapper.orderByDesc(ChatReqRecords::getCreateTime);
        return chatReqRecordsMapper.selectList(wrapper);
    }

    @Override
    public ChatReqRecords createRequest(ChatReqRecords chatReqRecords) {
        ChatList chatList = chatListMapper.selectOne(Wrappers.lambdaQuery(ChatList.class)
                .eq(ChatList::getId, chatReqRecords.getChatId())
                .eq(ChatList::getUid, chatReqRecords.getUid()));
        if (chatList != null && chatList.getEnable() == 0) {
            throw new BusinessException(ResponseEnum.CHAT_REQ_ZJ_ERROR);
        }

        chatReqRecordsMapper.insert(chatReqRecords);

        LambdaUpdateWrapper<ChatList> updateWrapper = Wrappers.lambdaUpdate(ChatList.class);
        updateWrapper.eq(ChatList::getId, chatReqRecords.getChatId());
        updateWrapper.set(ChatList::getUpdateTime, LocalDateTime.now());
        chatListMapper.update(null, updateWrapper);
        LambdaQueryWrapper<ChatTreeIndex> chatTreeQuery = new LambdaQueryWrapper<ChatTreeIndex>()
                .eq(ChatTreeIndex::getChildChatId, chatReqRecords.getChatId())
                .eq(ChatTreeIndex::getUid, chatReqRecords.getUid())
                .orderByAsc(ChatTreeIndex::getId);
        List<ChatTreeIndex> childChatTreeIndexList = chatTreeIndexMapper.selectList(chatTreeQuery);
        Long rootId = childChatTreeIndexList.getFirst().getRootChatId();
        if (rootId != null && !rootId.equals(chatReqRecords.getChatId())) {
            updateWrapper.eq(ChatList::getId, rootId);
            chatListMapper.update(null, updateWrapper);
        }

View on GitHub (pinned to 5e758547a8)