iflytek/astron-agent · error · BusinessException

PARAMETER_ERROR

PARAMETER_ERROR

Error message

PARAMETER_ERROR

What it means

PARAMETER_ERROR thrown by AgentDebugService.createSession when the request is null or lacks botId. Creating an agent debug session requires a target bot; the service rejects the call before permission checks.

Solutions

  1. Include botId in the create-session request body
  2. Verify request Content-Type is application/json and body is serialized
  3. Check frontend binds the selected bot's id to the request model
  4. Add client-side validation before invoking the API

Example fix

// before
await api.post('/agent-debug/session', { spaceId });
// after
await api.post('/agent-debug/session', { spaceId, botId });
Defensive patterns

Strategy: validation

Validate before calling

if (!botId) throw new Error('botId required before creating debug session');

Type guard

if (request && typeof request.botId === 'number') { /* valid */ }

Prevention

When it happens

Trigger: POST to the agent debug session creation endpoint with an empty body, or body missing the botId field (wrong field name or unserialized payload).

Common situations: Frontend sending JSON with different key casing; request body not parsed; tests omitting botId; UI opening debug panel without a selected bot.

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

Appendix: source

Thrown at console/backend/hub/src/main/java/com/iflytek/astron/console/hub/service/agentdebug/impl/AgentDebugServiceImpl.java:62

        checkBotPermission(uid, spaceId, botId);
        LambdaQueryWrapper<AgentDebugSession> query = Wrappers.lambdaQuery(AgentDebugSession.class)
                .eq(AgentDebugSession::getBotId, botId)
                .eq(AgentDebugSession::getUid, uid)
                .eq(AgentDebugSession::getIsDelete, 0)
                .orderByDesc(AgentDebugSession::getUpdateTime)
                .last("LIMIT " + MAX_SESSION_SIZE);
        addSpaceCondition(query, spaceId);
        return sessionMapper.selectList(query)
                .stream()
                .map(this::toDto)
                .toList();
    }

    @Override
    public AgentDebugSessionDto createSession(String uid, Long spaceId, CreateAgentDebugSessionRequest request) {
        validateUser(uid);
        if (request == null || request.getBotId() == null) {
            throw new BusinessException(ResponseEnum.PARAMETER_ERROR);
        }
        checkBotPermission(uid, spaceId, request.getBotId());

        LocalDateTime now = LocalDateTime.now();
        AgentDebugSession session = new AgentDebugSession();
        session.setId(UUID.randomUUID().toString().replace("-", ""));
        session.setBotId(request.getBotId());
        session.setUid(uid);
        session.setSpaceId(spaceId);
        session.setTitle(normalizeTitle(request.getTitle(), DEFAULT_TITLE));
        session.setMessageCount(0);
        session.setIsDelete(0);
        session.setCreateTime(now);
        session.setUpdateTime(now);
        sessionMapper.insert(session);
        return toDto(session);
    }

View on GitHub (pinned to 5e758547a8)