{"record":{"id":"ae660d3cab86673c","repo":"conductor-oss/conductor","slug":"start-request-is-required","errorCode":null,"errorMessage":"Start request is required","messagePattern":"Start request is required","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":400,"severity":"error","filePath":"agentspan/src/main/java/org/conductoross/conductor/ai/agentspan/runtime/service/AgentService.java","lineNumber":809,"sourceCode":"        if (normalizedConfig != null) {\n            metadata.put(\"normalizedAgentDef\", MAPPER.convertValue(normalizedConfig, Map.class));\n        }\n    }\n\n    private static int toInt(Object value) {\n        if (value instanceof Number) return ((Number) value).intValue();\n        if (value instanceof String) {\n            try {\n                return Integer.parseInt((String) value);\n            } catch (NumberFormatException ignored) {\n            }\n        }\n        return 0;\n    }\n\n    private void validateStartInput(AgentStartRequest request) {\n        if (request == null) {\n            throw new IllegalArgumentException(\"Start request is required\");\n        }\n        if (StringUtils.isNotBlank(request.getPrompt())\n                || hasMedia(request.getMedia())\n                || isNotEmpty(request.getContext())) {\n            return;\n        }\n        throw new IllegalArgumentException(\n                \"Agent execution requires a non-empty prompt, at least one media item, or non-empty context.\");\n    }\n\n    private void validateStartSource(AgentStartRequest request) {\n        boolean hasName = StringUtils.isNotEmpty(request.getName());\n        boolean hasInlineConfig =\n                request.getAgentConfig() != null\n                        || StringUtils.isNotEmpty(request.getFramework())\n                        || request.getRawConfig() != null\n                        || request.getSkillRef() != null;\n","sourceCodeStart":791,"sourceCodeEnd":827,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/agentspan/src/main/java/org/conductoross/conductor/ai/agentspan/runtime/service/AgentService.java#L791-L827","documentation":"Thrown by AgentService.validateStartInput (called from start) when the AgentStartRequest is null. This is the first validation gate in the start flow — a null request means no body was deserialized or null was passed programmatically. IllegalArgumentException maps to HTTP 400.","triggerScenarios":"POST /api/agent/start with an empty or missing request body; calling service.start(null) programmatically; a proxy/gateway stripped the body before forwarding.","commonSituations":"API client sends Content-Type without a body; SDK marshalling bug produces null; controller receives a malformed JSON that deserializes to null.","solutions":["Ensure the request body is a valid JSON AgentStartRequest object.","Add a null check in the controller layer before delegating to AgentService.","Validate the API client is sending Content-Type: application/json with a non-empty body."],"exampleFix":"// before\n// POST /api/agent/start with empty body\nservice.start(null); // -> error\n\n// after\n// Controller-level guard\nif (request == null) {\n    return ResponseEntity.badRequest().body(\"Request body is required\");\n}\nservice.start(request);","handlingStrategy":"validation","validationCode":"if (request == null) {\n    return ResponseEntity.badRequest().body(\"Request body is required\");\n}\nservice.start(request);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate request body presence at the controller layer.","Ensure API clients send Content-Type: application/json with a non-empty body.","Add @NotNull on the controller parameter for framework-level validation."],"tags":["validation","start","bad-request","null-input"],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}