{"record":{"id":"c1a5bb0c6662470c","repo":"iflytek/astron-agent","slug":"param-error-c1a5bb","errorCode":"PARAM_ERROR","errorMessage":"PARAM_ERROR","messagePattern":"PARAM_ERROR","errorType":"exception","errorClass":"BusinessException","httpStatus":null,"severity":"warning","filePath":"console/backend/hub/src/main/java/com/iflytek/astron/console/hub/controller/bot/BotController.java","lineNumber":196,"sourceCode":"    }\n\n    /**\n     * Apply to take down assistant\n     *\n     * @param request\n     * @param takeoffList\n     * @return\n     */\n    @SpacePreAuth(key = \"BotController_takeoffBot_POST\")\n    @PostMapping(\"/take-off-bot\")\n    @Operation(summary = \"take off agent\")\n    public ApiResult<Boolean> takeoffBot(HttpServletRequest request, @RequestBody TakeoffList takeoffList) {\n        botPermissionUtil.checkBot(takeoffList.getBotId());\n        String uid = RequestContextUtil.getUID();\n        Long spaceId = SpaceInfoUtil.getSpaceId();\n\n        if (takeoffList.getReason().length() > 100) {\n            throw new BusinessException(ResponseEnum.PARAM_ERROR);\n        }\n        return ApiResult.success(chatBotDataService.takeoffBot(uid, spaceId, takeoffList));\n    }\n\n    @PostMapping(\"/updateSynchronize\")\n    @Transactional(rollbackFor = Exception.class)\n    public ApiResult<Long> updateSynchronize(@RequestBody MaasDuplicate update) {\n        log.info(\"----- Xingchen canvas update: {}\", JSON.toJSONString(update));\n        Long maasId = update.getMaasId();\n        List<UserLangChainInfo> list = userLangChainDataService.findByMaasId(maasId);\n        if (Objects.isNull(list) || list.isEmpty()) {\n            log.info(\"----- Xinghuo did not find Xingchen's workflow: {}\", maasId);\n            return ApiResult.error(ResponseEnum.DATA_NOT_FOUND);\n        }\n        Integer botId = list.getFirst().getBotId();\n        if (redissonClient.getBucket(MaasUtil.generatePrefix(maasId.toString(), botId)).isExists()) {\n            log.info(\"----- Xinghuo internal service, no processing needed: {}\", JSON.toJSONString(update));\n            redissonClient.getBucket(MaasUtil.generatePrefix(maasId.toString(), botId)).delete();","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/console/backend/hub/src/main/java/com/iflytek/astron/console/hub/controller/bot/BotController.java#L178-L214","documentation":"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.","triggerScenarios":"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).","commonSituations":"Users paste long explanations into a free-text reason field; frontend lacks a maxLength input constraint; API consumers bypassing the UI.","solutions":["Trim/limit the reason client-side (maxLength=100 on the input) before submitting","Truncate or split the reason server-side if longer reasons should be allowed","Catch BusinessException PARAM_ERROR and show a clear 'reason must be ≤100 characters' message","Coordinate with the team if the 100-char limit should be raised"],"exampleFix":"// before\nawait api.takeoffBot({ botId, reason: longText });\n// after\nconst reason = longText.slice(0, 100);\nawait api.takeoffBot({ botId, reason });","handlingStrategy":"validation","validationCode":"const valid = typeof reason === 'string' && reason.length > 0 && reason.length <= 100;","typeGuard":"const isShortReason = (r: unknown): r is string => typeof r === 'string' && r.length <= 100;","tryCatchPattern":"try { await api.takeoffBot(body); } catch (e) { if (e.code === 400 /* PARAM_ERROR */) showToast('Reason must be 100 characters or fewer'); }","preventionTips":["Set maxLength=100 on the reason input","Trim whitespace before checking length","Enforce the same limit in backend DTO validation"],"tags":["validation","http-400","bot","request"],"backgroundTag":"invalid-argument-value","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"}