{"record":{"id":"c115a9d66315c980","repo":"iflytek/astron-agent","slug":"parameter-error-c115a9","errorCode":"PARAMETER_ERROR","errorMessage":"PARAMETER_ERROR","messagePattern":"PARAMETER_ERROR","errorType":"error_code","errorClass":"BusinessException","httpStatus":null,"severity":"error","filePath":"console/backend/hub/src/main/java/com/iflytek/astron/console/hub/service/agentdebug/impl/AgentDebugServiceImpl.java","lineNumber":62,"sourceCode":"        checkBotPermission(uid, spaceId, botId);\n        LambdaQueryWrapper<AgentDebugSession> query = Wrappers.lambdaQuery(AgentDebugSession.class)\n                .eq(AgentDebugSession::getBotId, botId)\n                .eq(AgentDebugSession::getUid, uid)\n                .eq(AgentDebugSession::getIsDelete, 0)\n                .orderByDesc(AgentDebugSession::getUpdateTime)\n                .last(\"LIMIT \" + MAX_SESSION_SIZE);\n        addSpaceCondition(query, spaceId);\n        return sessionMapper.selectList(query)\n                .stream()\n                .map(this::toDto)\n                .toList();\n    }\n\n    @Override\n    public AgentDebugSessionDto createSession(String uid, Long spaceId, CreateAgentDebugSessionRequest request) {\n        validateUser(uid);\n        if (request == null || request.getBotId() == null) {\n            throw new BusinessException(ResponseEnum.PARAMETER_ERROR);\n        }\n        checkBotPermission(uid, spaceId, request.getBotId());\n\n        LocalDateTime now = LocalDateTime.now();\n        AgentDebugSession session = new AgentDebugSession();\n        session.setId(UUID.randomUUID().toString().replace(\"-\", \"\"));\n        session.setBotId(request.getBotId());\n        session.setUid(uid);\n        session.setSpaceId(spaceId);\n        session.setTitle(normalizeTitle(request.getTitle(), DEFAULT_TITLE));\n        session.setMessageCount(0);\n        session.setIsDelete(0);\n        session.setCreateTime(now);\n        session.setUpdateTime(now);\n        sessionMapper.insert(session);\n        return toDto(session);\n    }\n","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/console/backend/hub/src/main/java/com/iflytek/astron/console/hub/service/agentdebug/impl/AgentDebugServiceImpl.java#L44-L80","documentation":"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.","triggerScenarios":"POST to the agent debug session creation endpoint with an empty body, or body missing the botId field (wrong field name or unserialized payload).","commonSituations":"Frontend sending JSON with different key casing; request body not parsed; tests omitting botId; UI opening debug panel without a selected bot.","solutions":["Include botId in the create-session request body","Verify request Content-Type is application/json and body is serialized","Check frontend binds the selected bot's id to the request model","Add client-side validation before invoking the API"],"exampleFix":"// before\nawait api.post('/agent-debug/session', { spaceId });\n// after\nawait api.post('/agent-debug/session', { spaceId, botId });","handlingStrategy":"validation","validationCode":"if (!botId) throw new Error('botId required before creating debug session');","typeGuard":"if (request && typeof request.botId === 'number') { /* valid */ }","tryCatchPattern":null,"preventionTips":["Bind selected bot to the debug form","Validate request body schema client-side","Serialize bodies with application/json"],"tags":["validation","request-params","agent-debug"],"backgroundTag":"missing-required-argument","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"}