iflytek/astron-agent · warning · BusinessException

PARAM_ERROR

PARAM_ERROR

Error message

PARAM_ERROR

What it means

Generic parameter-validation business error returned by takeoffBot (POST /take-off-bot): the takedown request payload is invalid. Here specifically when takeoffList.reason exceeds 100 characters; the controller returns PARAM_ERROR instead of processing the takedown.

Solutions

  1. Trim/limit the reason client-side (maxLength=100 on the input) before submitting
  2. Truncate or split the reason server-side if longer reasons should be allowed
  3. Catch BusinessException PARAM_ERROR and show a clear 'reason must be ≤100 characters' message
  4. Coordinate with the team if the 100-char limit should be raised

Example fix

// before
await api.takeoffBot({ botId, reason: longText });
// after
const reason = longText.slice(0, 100);
await api.takeoffBot({ botId, reason });
Defensive patterns

Strategy: validation

Validate before calling

const valid = typeof reason === 'string' && reason.length > 0 && reason.length <= 100;

Type guard

const isShortReason = (r: unknown): r is string => typeof r === 'string' && r.length <= 100;

Try / catch

try { await api.takeoffBot(body); } catch (e) { if (e.code === 400 /* PARAM_ERROR */) showToast('Reason must be 100 characters or fewer'); }

Prevention

When it happens

Trigger: POSTing to the bot takeoff endpoint with takeoffList.reason longer than 100 chars (note: a null reason would NPE before this check, so the error specifically indicates a too-long string).

Common situations: Users paste long explanations into a free-text reason field; frontend lacks a maxLength input constraint; API consumers bypassing the UI.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


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

Appendix: source

Thrown at console/backend/hub/src/main/java/com/iflytek/astron/console/hub/controller/bot/BotController.java:196

    }

    /**
     * Apply to take down assistant
     *
     * @param request
     * @param takeoffList
     * @return
     */
    @SpacePreAuth(key = "BotController_takeoffBot_POST")
    @PostMapping("/take-off-bot")
    @Operation(summary = "take off agent")
    public ApiResult<Boolean> takeoffBot(HttpServletRequest request, @RequestBody TakeoffList takeoffList) {
        botPermissionUtil.checkBot(takeoffList.getBotId());
        String uid = RequestContextUtil.getUID();
        Long spaceId = SpaceInfoUtil.getSpaceId();

        if (takeoffList.getReason().length() > 100) {
            throw new BusinessException(ResponseEnum.PARAM_ERROR);
        }
        return ApiResult.success(chatBotDataService.takeoffBot(uid, spaceId, takeoffList));
    }

    @PostMapping("/updateSynchronize")
    @Transactional(rollbackFor = Exception.class)
    public ApiResult<Long> updateSynchronize(@RequestBody MaasDuplicate update) {
        log.info("----- Xingchen canvas update: {}", JSON.toJSONString(update));
        Long maasId = update.getMaasId();
        List<UserLangChainInfo> list = userLangChainDataService.findByMaasId(maasId);
        if (Objects.isNull(list) || list.isEmpty()) {
            log.info("----- Xinghuo did not find Xingchen's workflow: {}", maasId);
            return ApiResult.error(ResponseEnum.DATA_NOT_FOUND);
        }
        Integer botId = list.getFirst().getBotId();
        if (redissonClient.getBucket(MaasUtil.generatePrefix(maasId.toString(), botId)).isExists()) {
            log.info("----- Xinghuo internal service, no processing needed: {}", JSON.toJSONString(update));
            redissonClient.getBucket(MaasUtil.generatePrefix(maasId.toString(), botId)).delete();

View on GitHub (pinned to 5e758547a8)