{"record":{"id":"5acf1ba4e8e6ce7d","repo":"iflytek/astron-agent","slug":"chat-req-zj-error","errorCode":"CHAT_REQ_ZJ_ERROR","errorMessage":"CHAT_REQ_ZJ_ERROR","messagePattern":"CHAT_REQ_ZJ_ERROR","errorType":"error_code","errorClass":"BusinessException","httpStatus":null,"severity":"error","filePath":"console/backend/hub/src/main/java/com/iflytek/astron/console/hub/data/impl/ChatDataServiceImpl.java","lineNumber":96,"sourceCode":"        return chatReqRecordsMapper.selectList(wrapper);\n    }\n\n    @Override\n    public List<ChatReqRecords> findRequestsByChatIdAndTimeRange(Long chatId, LocalDateTime startTime, LocalDateTime endTime) {\n        LambdaQueryWrapper<ChatReqRecords> wrapper = new LambdaQueryWrapper<>();\n        wrapper.eq(ChatReqRecords::getChatId, chatId);\n        wrapper.between(ChatReqRecords::getCreateTime, startTime, endTime);\n        wrapper.orderByDesc(ChatReqRecords::getCreateTime);\n        return chatReqRecordsMapper.selectList(wrapper);\n    }\n\n    @Override\n    public ChatReqRecords createRequest(ChatReqRecords chatReqRecords) {\n        ChatList chatList = chatListMapper.selectOne(Wrappers.lambdaQuery(ChatList.class)\n                .eq(ChatList::getId, chatReqRecords.getChatId())\n                .eq(ChatList::getUid, chatReqRecords.getUid()));\n        if (chatList != null && chatList.getEnable() == 0) {\n            throw new BusinessException(ResponseEnum.CHAT_REQ_ZJ_ERROR);\n        }\n\n        chatReqRecordsMapper.insert(chatReqRecords);\n\n        LambdaUpdateWrapper<ChatList> updateWrapper = Wrappers.lambdaUpdate(ChatList.class);\n        updateWrapper.eq(ChatList::getId, chatReqRecords.getChatId());\n        updateWrapper.set(ChatList::getUpdateTime, LocalDateTime.now());\n        chatListMapper.update(null, updateWrapper);\n        LambdaQueryWrapper<ChatTreeIndex> chatTreeQuery = new LambdaQueryWrapper<ChatTreeIndex>()\n                .eq(ChatTreeIndex::getChildChatId, chatReqRecords.getChatId())\n                .eq(ChatTreeIndex::getUid, chatReqRecords.getUid())\n                .orderByAsc(ChatTreeIndex::getId);\n        List<ChatTreeIndex> childChatTreeIndexList = chatTreeIndexMapper.selectList(chatTreeQuery);\n        Long rootId = childChatTreeIndexList.getFirst().getRootChatId();\n        if (rootId != null && !rootId.equals(chatReqRecords.getChatId())) {\n            updateWrapper.eq(ChatList::getId, rootId);\n            chatListMapper.update(null, updateWrapper);\n        }","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/console/backend/hub/src/main/java/com/iflytek/astron/console/hub/data/impl/ChatDataServiceImpl.java#L78-L114","documentation":"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.","triggerScenarios":"Sending a chat message to a conversation that was disabled (enable=0), typically after it was cleared, archived, or administratively disabled.","commonSituations":"Client keeps chatting on an old chatId after clearing; chat disabled by admin/moderation; user resumed a stale session in UI.","solutions":["Create a new chat session instead of reusing the disabled chatId","Re-fetch chat list state and re-enable the chat if your business flow allows","Check enable field of ChatList for the chatId before sending","Verify the client isn't caching an outdated chatId"],"exampleFix":"// before\nawait chat(chatId, msg);\n// after\nconst list = await getChatList(chatId);\nif (list.enable === 0) chatId = await createChat();\nawait chat(chatId, msg);","handlingStrategy":"try-catch","validationCode":"const chat = await getChatList(chatId); if (chat && chat.enable === 0) chatId = await createChat();","typeGuard":null,"tryCatchPattern":"try { await sendChat(chatId, msg); } catch (e) { if (e.code === 'CHAT_REQ_ZJ_ERROR') await startNewChat(); }","preventionTips":["Track chat enable state in the client","Create a new chat after clearing instead of reusing chatId","Re-fetch chat state on session resume"],"tags":["chat","disabled-conversation","state"],"backgroundTag":"invalid-state-transition","analyzedSha":"5e758547a83371a5a4b29dadf4ac03e8dd527635","analyzedAt":"2026-09-12T08:03:51.356Z","contentChangedAt":"2026-09-12T08:03:51.356Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}