{"record":{"id":"aeed1125d08029c6","repo":"quarkusio/quarkus","slug":"either-function-assistantfunction-or-runtimevalue","errorCode":null,"errorMessage":"Either function, assistantFunction or runtimeValue must be provided","messagePattern":"Either function, assistantFunction or runtimeValue must be provided","errorType":"validation","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/devui/deployment-spi/src/main/java/io/quarkus/devui/spi/buildtime/BuildTimeActionBuildItem.java","lineNumber":209,"sourceCode":"            if (parameters.isEmpty())\n                parameters = null;\n            if (function != null) {\n                return addAction(\n                        new DeploymentJsonRpcMethod(methodName, description, parameters, autoUsage(usage, description),\n                                mcpEnabledByDefault,\n                                function));\n            } else if (runtimeValue != null) {\n                return addAction(\n                        new RecordedJsonRpcMethod(methodName, description, autoUsage(usage, description),\n                                mcpEnabledByDefault,\n                                runtimeValue));\n            } else if (assistantFunction != null) {\n                return addAction(\n                        new DeploymentJsonRpcMethod(methodName, description, parameters, autoUsage(usage, description),\n                                mcpEnabledByDefault,\n                                assistantFunction));\n            } else {\n                throw new IllegalStateException(\"Either function, assistantFunction or runtimeValue must be provided\");\n            }\n        }\n    }\n\n    public final class SubscriptionBuilder {\n        private String methodName;\n        private String description;\n        private Map<String, AbstractJsonRpcMethod.Parameter> parameters = new LinkedHashMap<>();;\n        private EnumSet<Usage> usage;\n        private boolean mcpEnabledByDefault = false;\n        private Function<Map<String, String>, ?> function;\n        private RuntimeValue<?> runtimeValue;\n\n        public SubscriptionBuilder methodName(String methodName) {\n            this.methodName = methodName;\n            return this;\n        }\n","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/devui/deployment-spi/src/main/java/io/quarkus/devui/spi/buildtime/BuildTimeActionBuildItem.java#L191-L227","documentation":"Thrown by BuildTimeActionBuildItem.ActionBuilder.build when an action is registered with neither a function, an assistantFunction, nor a runtimeValue. Every build-time action must be backed by exactly one implementation — an in-deployment BiFunction, an AI-assistant function, or a recorded runtime value invoked via a recorder — so a contribution providing none of them is rejected at build time as incomplete.","triggerScenarios":"Building an ActionBuilder with only methodName/description set and no implementation setter called.","commonSituations":"Commenting out the implementation line during debugging and forgetting to restore it.","solutions":["Add one of .runtime(...), .function(...), or .assistantFunction(...) before build()","If the action is intentionally empty, remove it instead of building it"],"exampleFix":"// before\nBuildTimeActionBuildItem item = new BuildTimeActionBuildItem(\"ext\")\n    .methodName(\"getInfo\")\n    .build();\n// after\nBuildTimeActionBuildItem item = new BuildTimeActionBuildItem(\"ext\")\n    .methodName(\"getInfo\")\n    .function(map -> Map.of(\"version\", \"1.0\"))\n    .build();","handlingStrategy":"validation","validationCode":"boolean hasImpl = function != null || assistantFunction != null || runtimeValue != null;\nif (!hasImpl) { throw new IllegalArgumentException(\"Provide function, assistantFunction or runtimeValue\"); }","typeGuard":null,"tryCatchPattern":"try {\n    item = actionBuilder.build();\n} catch (IllegalStateException e) {\n    if (e.getMessage().contains(\"must be provided\")) { /* attach an implementation */ }\n    else throw e;\n}","preventionTips":["Never leave an implementation setter commented out in committed code","Each ActionBuilder must end with exactly one implementation call"],"tags":["quarkus","devui","jsonrpc","builder-validation"],"backgroundTag":"missing-required-argument","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}