{"record":{"id":"7a9b7b1cf74438f5","repo":"quarkusio/quarkus","slug":"invalidrequest","errorCode":"InvalidRequest","errorMessage":"Debuggee agent is not enabled.","messagePattern":"Debuggee agent is not enabled\\.","errorType":"error_code","errorClass":"ResponseErrorException","httpStatus":null,"severity":"error","filePath":"independent-projects/qute/debug/src/main/java/io/quarkus/qute/debug/agent/evaluations/EvaluationSupport.java","lineNumber":48,"sourceCode":"    public EvaluationSupport(DebuggeeAgent agent) {\n        this.agent = agent;\n    }\n\n    /**\n     * Evaluates a string expression in the context of a given stack frame.\n     *\n     * @param frameId the ID of the stack frame where the expression should be evaluated\n     * @param expression the expression to evaluate\n     * @param context the evaluation context (e.g., HOVER, WATCH)\n     * @return a CompletableFuture resolving to an {@link EvaluateResponse}\n     */\n    public CompletableFuture<EvaluateResponse> evaluate(Integer frameId, String expression, String context) {\n        if (!agent.isEnabled()) {\n            // Debugger not enabled: return an error immediately\n            ResponseError re = new ResponseError();\n            re.setCode(ResponseErrorCode.InvalidRequest);\n            re.setMessage(\"Debuggee agent is not enabled.\");\n            throw new ResponseErrorException(re);\n        }\n\n        // Find the stack frame\n        RemoteStackFrame frame = agent.findStackFrame(frameId);\n        if (frame == null) {\n            // Frame not found: return null\n            return CompletableFuture.completedFuture(null);\n        }\n\n        // Evaluate the expression asynchronously\n        return frame.evaluate(expression)\n                .handle((result, error) -> {\n                    // Handle evaluation errors\n                    if (error != null) {\n                        if (EvaluateArgumentsContext.HOVER.equals(context)) {\n                            // Ignore errors in hover context\n                            return IGNORE_RESULT;\n                        }","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/qute/debug/src/main/java/io/quarkus/qute/debug/agent/evaluations/EvaluationSupport.java#L30-L66","documentation":"EvaluationSupport.evaluate() implements the DAP 'evaluate' request for the Qute debugger. It throws ResponseErrorException with code InvalidRequest when the debuggee agent (QuteDebugAgent) is not enabled, meaning expression evaluation is unavailable because debugging was never activated for the render process.","triggerScenarios":"Calling evaluate() (directly or via resolve/result/evaluateMessageKey/evaluateMessageParams/collectionResolveAsync) when agent.isEnabled() is false — i.e. the Qute debugging agent was not started/enabled before the evaluation request arrived.","commonSituations":"DAP client attached without enabling the Qute debug agent (missing quarkus.qute.debug / dev-mode debug flag); evaluation attempted before agent initialization finished; running a production build where debug support is off.","solutions":["Enable the Qute debugger before evaluating — e.g. start the app with Qute debugging enabled (dev mode / quarkus.qute.debug=true or the DAP launch that enables the agent).","Verify agent.isEnabled() returns true in your client before sending evaluate requests.","If using the Qute DAP integration, use the launch/attach flow that calls the agent's enable/start, not raw attach to a non-debug process.","Rebuild/run in dev mode; production builds typically do not enable the debug agent."],"exampleFix":"// before\nEvaluateResponse r = evaluationSupport.evaluate(frameId, expr, ctx);\n// after\nif (!agent.isEnabled()) {\n    agent.enable(); // start the Qute debug agent first\n}\nEvaluateResponse r = evaluationSupport.evaluate(frameId, expr, ctx);","handlingStrategy":"validation","validationCode":"if (!agent.isEnabled()) {\n    throw new IllegalStateException(\"Enable the Qute debug agent before evaluating\");\n}","typeGuard":"boolean canEvaluate(io.quarkus.qute.debug.agent.QuteDebugAgent agent) {\n    return agent != null && agent.isEnabled();\n}","tryCatchPattern":"try {\n    return evaluationSupport.evaluate(frameId, expression, context).get();\n} catch (ResponseErrorException e) {\n    if (e.getResponseError().getCode() == ResponseErrorCode.InvalidRequest\n            && \"Debuggee agent is not enabled.\".equals(e.getResponseError().getMessage())) {\n        // enable the agent (dev mode / quarkus.qute.debug) and retry\n    }\n    throw e;\n}","preventionTips":["Run in dev mode with Qute debugging enabled before attaching an evaluator","Check agent.isEnabled() before sending DAP evaluate requests","Use the supported launch/attach flow that enables the agent"],"tags":["qute","debugger","dap","evaluation","agent-disabled"],"backgroundTag":"debug-agent-not-enabled","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"}