iflytek/astron-agent · warning · BusinessException

PARAMETER_ERROR

PARAMETER_ERROR

Error message

PARAMETER_ERROR

What it means

BusinessException with code PARAMETER_ERROR thrown by chatWorkflowBot when the user's ask (AGENT_USER_INPUT) is blank (StrUtil.isBlank). The service rejects empty chat input before invoking the workflow, since an empty prompt cannot drive the agent.

Solutions

  1. Ensure the ask field contains non-empty, non-whitespace text before calling the chat endpoint.
  2. Trim input client-side and block submission when trimmed length is 0.
  3. If whitespace-only input should be valid, pre-normalize it into meaningful text rather than sending raw whitespace.
  4. Fix client code that re-submits the last (now empty) input on retry.

Example fix

// before
await chat({ botId, ask: input.value });
// after
const ask = input.value.trim();
if (!ask) { showWarning('Please enter a message'); return; }
await chat({ botId, ask });
Defensive patterns

Strategy: validation

Validate before calling

const ask = (raw ?? '').trim();
if (!ask) throw new Error('Message cannot be empty');

Type guard

function hasMeaningfulInput(s) { return typeof s === 'string' && s.trim().length > 0; }

Try / catch

try { await chat({ botId, ask }); } catch (e) { if (e.code === 'PARAMETER_ERROR') { focusInputAndWarnUser(); } else throw e; }

Prevention

When it happens

Trigger: POSTing to the workflow bot chat endpoint with ask = "", whitespace-only, or null; clients that send empty messages on enter-key presses or retry after a failed send with a cleared input.

Common situations: Frontend bug submitting empty text boxes; whitespace-only input from copy-paste; automated scripts sending placeholder empty payloads; localized input where only invisible characters were typed.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


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

Appendix: source

Thrown at console/backend/commons/src/main/java/com/iflytek/astron/console/commons/service/workflow/impl/WorkflowBotChatServiceImpl.java:116

     *
     * @param chatBotReqDto Chat bot request data transfer object
     * @param sseEmitter Server-Sent Events emitter
     * @param sseId Server-sent event identifier
     * @param workflowOperation Workflow operation type
     * @param workflowVersion Workflow version
     */
    @Override
    public void chatWorkflowBot(ChatBotReqDto chatBotReqDto, SseEmitter sseEmitter, String sseId, String workflowOperation, String workflowVersion) {
        String uid = chatBotReqDto.getUid();
        Long chatId = chatBotReqDto.getChatId();
        String ask = chatBotReqDto.getAsk();
        String url = chatBotReqDto.getUrl();
        Integer botId = chatBotReqDto.getBotId();

        if (StrUtil.isBlank(ask)) {
            log.warn("Rejecting workflow chat request with empty user input, uid: {}, chatId: {}, botId: {}",
                    uid, chatId, botId);
            throw new BusinessException(ResponseEnum.PARAMETER_ERROR);
        }

        JSONObject inputs = new JSONObject();
        inputs.put("AGENT_USER_INPUT", ask);

        UserLangChainInfo userLangChainInfo = userLangChainDataService.findOneByBotId(botId);
        if (userLangChainInfo == null) {
            throw new BusinessException(ResponseEnum.BOT_CHAIN_SUBMIT_ERROR);
        }
        String flowId = userLangChainInfo.getFlowId();
        String effectiveWorkflowVersion = resolveWorkflowVersion(botId, flowId, workflowVersion);
        // Record current question
        ChatReqRecords chatReqRecords = new ChatReqRecords();
        chatReqRecords.setChatId(chatId);
        chatReqRecords.setUid(uid);
        chatReqRecords.setMessage(ask);
        chatReqRecords.setClientType(0);
        chatReqRecords.setCreateTime(LocalDateTime.now());

View on GitHub (pinned to 5e758547a8)