iflytek/astron-agent · error · BusinessException

TOO_MANY_BOTS

TOO_MANY_BOTS

Error message

TOO_MANY_BOTS

What it means

BusinessException with code TOO_MANY_BOTS thrown by validateBotCreation when the user already owns more than 100 bots (counted either globally by uid or within the given spaceId). This is a platform quota limit enforced before creating another bot.

Solutions

  1. Delete unused bots to get under the 100-bot limit.
  2. Reuse or update an existing bot instead of creating a new one.
  3. Move bots into a different space if the limit is space-scoped.
  4. If this is a legitimate enterprise need, request a quota increase by adjusting the limit (>100) in validateBotCreation.

Example fix

// before: unbounded creation loop
for (const cfg of configs) await createBot(cfg);
// after: check quota first
const count = await countMyBots();
if (count + configs.length > 100) throw new Error('Bot quota exceeded; delete unused bots first');
for (const cfg of configs) await createBot(cfg);
Defensive patterns

Strategy: validation

Validate before calling

const count = (await listBots()).length;
if (count >= 100) throw new Error('Bot limit (100) reached; delete unused bots first');

Try / catch

try { await createBot(form); } catch (e) { if (e.code === 'TOO_MANY_BOTS') { showQuotaDialog(); } else throw e; }

Prevention

When it happens

Trigger: Calling insertWorkflowBot or insertBotBasicInfo when countBotsByUid(uid[, spaceId]) returns a count > 100 — i.e. the 101st bot for that user/space.

Common situations: Power users or scripts that bulk-create agents; test environments accumulating bots; integrations that create a bot per workflow without cleanup; migrations importing many bots into one account.

Related errors


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

Appendix: source

Thrown at console/backend/commons/src/main/java/com/iflytek/astron/console/commons/service/bot/impl/BotServiceImpl.java:327

        } catch (Exception e) {
            log.error("Operation failed with lock: {}", lockKey, e);
            throw e;
        } finally {
            if (lock.isHeldByCurrentThread()) {
                lock.unlock();
            }
        }
    }

    private void validateBotCreation(String uid, String botName, Long spaceId) {
        if (chatBotDataService.checkRepeatBotName(uid, null, botName, spaceId)) {
            throw new BusinessException(ResponseEnum.DUPLICATE_BOT_NAME);
        }

        Long count = (spaceId == null) ? chatBotDataService.countBotsByUid(uid) : chatBotDataService.countBotsByUid(uid, spaceId);

        if (count.intValue() > 100) {
            throw new BusinessException(ResponseEnum.TOO_MANY_BOTS);
        }
    }

    private void validateBotNameForUpdate(String uid, String botName, Long spaceId) {
        if (chatBotDataService.checkRepeatBotName(uid, null, botName, spaceId)) {
            throw new BusinessException(ResponseEnum.DUPLICATE_BOT_NAME);
        }
    }

    private void validateBotNameForUpdate(String uid, String botName, Integer botId, Long spaceId) {
        if (chatBotDataService.checkRepeatBotName(uid, botId, botName, spaceId)) {
            throw new BusinessException(ResponseEnum.DUPLICATE_BOT_NAME);
        }
    }

    private ChatBotBase createWorkflowBotBase(String uid, BotCreateForm bot, Long spaceId, Integer version) {
        Integer botType = normalizeBotFormType(bot);
        ChatBotBase botBase = new ChatBotBase();

View on GitHub (pinned to 5e758547a8)