{"record":{"id":"dbfeefa78f332e98","repo":"alibaba/nacos","slug":"20002-dbfeef","errorCode":"20002","errorMessage":"Unsupported Agent orderBy: %s","messagePattern":"Unsupported Agent orderBy: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":400,"severity":"error","filePath":"ai/src/main/java/com/alibaba/nacos/ai/form/agent/admin/AgentListForm.java","lineNumber":48,"sourceCode":" * @author Nacos\n */\npublic class AgentListForm implements NacosForm {\n    \n    @Serial\n    private static final long serialVersionUID = 1L;\n    \n    private String namespaceId;\n    \n    private String agentName;\n    \n    private String orderBy;\n    \n    @Override\n    public void validate() throws NacosApiException {\n        namespaceId = NamespaceUtil.processNamespaceParameter(namespaceId);\n        AgentValidationUtils.validateNamespaceId(namespaceId);\n        if (StringUtils.isNotBlank(orderBy) && !\"download_count\".equals(orderBy)) {\n            throw new IllegalArgumentException(\"Unsupported Agent orderBy: \" + orderBy);\n        }\n    }\n    \n    public String getNamespaceId() {\n        return namespaceId;\n    }\n    \n    public void setNamespaceId(String namespaceId) {\n        this.namespaceId = namespaceId;\n    }\n    \n    public String getAgentName() {\n        return agentName;\n    }\n    \n    public void setAgentName(String agentName) {\n        this.agentName = agentName;\n    }","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/ai/src/main/java/com/alibaba/nacos/ai/form/agent/admin/AgentListForm.java#L30-L66","documentation":"Thrown by AgentValidationUtils.validateTransport when the transport token is null, longer than 64 chars, or fails [0-9A-Za-z+-]{1,64}. A transport token is 1-64 characters drawn from alphanumerics, '+', or '-' only. Unlike protocol, the transport pattern allows '+' and '-' anywhere and has no 'must start with alphanumeric' rule, but rejects underscore, space, and other symbols.","triggerScenarios":"Registering/canonicalizing an Endpoint whose transport is null or uses underscores (e.g. 'grpc_web'), spaces, or >64 chars. Callers: EndpointCanonicalizer.canonicalize (line 63), EndpointNaturalKey.of (line 91), RadModelValidator.validateTransports (line 513), AgentRuntimeEndpointMapper (line 183).","commonSituations":"Reusing an internal transport identifier that contains underscores; lowercase/uppercase inconsistency (both are allowed, but teams may expect normalization); sending the scheme ('https') where the transport token is expected.","solutions":["Use a token of [0-9A-Za-z+-] only, e.g. 'grpc', 'http2', 'JSON-RPC-2.0', 'SSE'.","Confirm whether the field expects a transport token vs a URI scheme and set it accordingly.","Trim and null-check transport before binding the Endpoint."],"exampleFix":"// before\nendpoint.setTransport(\"grpc_web\");\n// after\nendpoint.setTransport(\"grpc-web\");","handlingStrategy":"validation","validationCode":"if (transport == null || transport.length() > 64\n        || !transport.matches(\"^[0-9A-Za-z+-]{1,64}$\")) {\n    throw new IllegalArgumentException(\"Invalid transport\");\n}","typeGuard":"static boolean isValidTransport(String s) {\n    return s != null && s.length() <= 64\n        && s.matches(\"^[0-9A-Za-z+-]{1,64}$\");\n}","tryCatchPattern":"try {\n    AgentValidationUtils.validateTransport(transport);\n} catch (IllegalArgumentException e) {\n    // return 400, field 'transport'\n}","preventionTips":["Replace underscores with dashes in transport tokens.","Confirm transport token vs URI scheme before binding."],"tags":["ai-agent","validation","transport","endpoint","illegal-argument"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}