iflytek/astron-agent · warning · BusinessException

PARAMETER_ERROR

PARAMETER_ERROR

Error message

ResponseEnum.PARAMETER_ERROR

What it means

AgentMemoryServiceImpl.saveConfig throws PARAMETER_ERROR when the request body is null or botId is null. It is the first validation after validateUser, before bot permission checks. It means the minimal identifiers needed to save a memory config were not supplied.

Solutions

  1. Always include a valid botId in the request body.
  2. Add @NotNull on botId in SaveAgentMemoryConfigRequest for a clearer validation error.
  3. Check the client serializes the field with the exact name the DTO expects (botId).

Example fix

// before
POST /agent-memory/config
{}
// after
POST /agent-memory/config
{"botId": 123, "provider": "openai", "apiKeyCiphertext": "...", "enabled": true}
Defensive patterns

Strategy: validation

Validate before calling

if (request == null || request.getBotId() == null) { return Promise.reject(new Error("botId is required")); }

Type guard

boolean hasBotId(SaveAgentMemoryConfigRequest r) { return r != null && r.getBotId() != null; }

Prevention

When it happens

Trigger: POSTing the agent memory config save endpoint with a missing/empty body, or with botId absent (null) in SaveAgentMemoryConfigRequest.

Common situations: Frontend form not yet bound to a bot when saving; API called via script/curl with incomplete JSON; DTO field name mismatch so botId never deserializes.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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

Appendix: source

Thrown at console/backend/hub/src/main/java/com/iflytek/astron/console/hub/service/agentmemory/impl/AgentMemoryServiceImpl.java:61

    private final ChatBotBaseMapper chatBotBaseMapper;
    private final AgentMemorySecretService secretService;
    private final AgentMemoryProviderFactory providerFactory;

    @Override
    public AgentMemoryConfigDto getConfig(String uid, Long spaceId, Integer botId) {
        validateUser(uid);
        checkBotPermission(uid, spaceId, botId);
        return findConfig(uid, spaceId, botId, Mem0MemoryProvider.PROVIDER)
                .map(this::toDto)
                .orElseGet(() -> defaultDto(botId));
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public AgentMemoryConfigDto saveConfig(String uid, Long spaceId, SaveAgentMemoryConfigRequest request) {
        validateUser(uid);
        if (request == null || request.getBotId() == null) {
            throw new BusinessException(ResponseEnum.PARAMETER_ERROR);
        }
        checkBotPermission(uid, spaceId, request.getBotId());

        String provider = normalizeProvider(request.getProvider());
        Optional<AgentMemoryConfig> existing = findConfig(uid, spaceId, request.getBotId(), provider);
        LocalDateTime now = LocalDateTime.now();

        String nextApiKeyCiphertext = StringUtils.trimToNull(request.getApiKeyCiphertext());
        if (nextApiKeyCiphertext == null && existing.isPresent()) {
            nextApiKeyCiphertext = existing.get().getApiKeyCiphertext();
        }
        boolean enabled = Boolean.TRUE.equals(request.getEnabled());
        if (enabled && StringUtils.isBlank(nextApiKeyCiphertext)) {
            throw new BusinessException(ResponseEnum.PARAMETER_ERROR);
        }

        AgentMemoryConfig config = existing.orElseGet(AgentMemoryConfig::new);
        config.setBotId(request.getBotId());

View on GitHub (pinned to 5e758547a8)