iflytek/astron-agent · warning · BusinessException

PROMPT_GROUP_PROMPT_CANNOT_EMPTY

PROMPT_GROUP_PROMPT_CANNOT_EMPTY

Error message

PROMPT_GROUP_PROMPT_CANNOT_EMPTY

What it means

Thrown by WorkflowService.saveComparisons when the request list of comparison groups is null or empty. There is nothing to save, so the service refuses with PROMPT_GROUP_PROMPT_CANNOT_EMPTY instead of persisting an empty batch.

Solutions

  1. Ensure the request contains at least one WorkflowComparisonSaveReq before calling the API.
  2. On the client, disable submit when the comparison list is empty or validate before send.
  3. Return a clearer validation error to the user in the UI instead of hitting the server.

Example fix

// before
workflowService.saveComparisons(reqList); // reqList may be empty
// after
if (reqList == null || reqList.isEmpty()) {
    throw new BusinessException(ResponseEnum.PROMPT_GROUP_PROMPT_CANNOT_EMPTY);
}
workflowService.saveComparisons(reqList);
Defensive patterns

Strategy: validation

Validate before calling

if (reqList == null || reqList.isEmpty()) {
    throw new IllegalArgumentException("comparison list must contain at least one item");
}
workflowService.saveComparisons(reqList);

Type guard

boolean hasItems = list != null && !list.isEmpty();

Prevention

When it happens

Trigger: Calling saveComparisons(null) or saveComparisons with an empty list — typically a frontend submitting a comparison form with zero groups, or a client serializing an empty array after deserialization issues.

Common situations: UI allows submitting the comparison dialog with all rows removed; a bulk-update job computed no items and still called the API; a request body failed to deserialize into the list, leaving it empty.

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/fd1ec9bff876d7f9. Report an issue: GitHub.

Appendix: source

Thrown at console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/service/workflow/WorkflowService.java:5506

        }
        if (domain.contains("gemini")) {
            return "google";
        }
        if (domain.contains("qwen")) {
            return "qwen";
        }
        if (domain.contains("moonshot") || domain.contains("kimi")) {
            return "moonshot";
        }
        if (domain.contains("doubao")) {
            return "doubao";
        }
        return StringUtils.isBlank(llmInfoVo.getUrl()) ? "xinghuo" : "openai";
    }

    public String saveComparisons(List<WorkflowComparisonSaveReq> workflowComparisonReqList) {
        if (workflowComparisonReqList == null || workflowComparisonReqList.isEmpty()) {
            throw new BusinessException(ResponseEnum.PROMPT_GROUP_PROMPT_CANNOT_EMPTY);
        }

        WorkflowComparisonSaveReq first = workflowComparisonReqList.getFirst();
        if (first == null || StringUtils.isBlank(first.getFlowId())
                || workflowComparisonReqList.stream()
                        .anyMatch(item -> item == null
                                || !StringUtils.equals(first.getFlowId(), item.getFlowId()))) {
            throw new BusinessException(ResponseEnum.PARAM_ERROR);
        }

        final String flowIdForLog = first.getFlowId();

        try {
            requireOwnedWorkflow(flowIdForLog);

            workflowComparisonMapper.delete(
                    Wrappers.lambdaQuery(WorkflowComparison.class)
                            .eq(WorkflowComparison::getFlowId, flowIdForLog));

View on GitHub (pinned to 5e758547a8)