{"record":{"id":"1258dca76d1dbfef","repo":"github/copilot-sdk","slug":"elicitation-is-not-supported-by-the-host-check-se-1258dc","errorCode":null,"errorMessage":"Elicitation is not supported by the host. Check session.getCapabilities().getUi().getElicitation().orElse(false) before calling UI methods.","messagePattern":"Elicitation is not supported by the host\\. Check session\\.getCapabilities\\(\\)\\.getUi\\(\\)\\.getElicitation\\(\\)\\.orElse\\(false\\) before calling UI methods\\.","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"java/sdk/src/main/java/com/github/copilot/CopilotSession.java","lineNumber":1374,"sourceCode":"            if (executor != null) {\n                CompletableFuture.runAsync(task, executor);\n            } else {\n                CompletableFuture.runAsync(task);\n            }\n        } catch (RejectedExecutionException e) {\n            LOG.log(Level.WARNING, \"Executor rejected elicitation task for requestId=\" + requestId + \"; running inline\",\n                    e);\n            task.run();\n        }\n    }\n\n    /**\n     * Throws if the host does not support elicitation.\n     */\n    private void assertElicitation() {\n        SessionCapabilities caps = capabilities;\n        if (caps == null || caps.getUi() == null || !caps.getUi().getElicitation().orElse(false)) {\n            throw new IllegalStateException(\"Elicitation is not supported by the host. \"\n                    + \"Check session.getCapabilities().getUi().getElicitation().orElse(false) before calling UI methods.\");\n        }\n    }\n\n    /**\n     * Implements {@link SessionUiApi} backed by the session's RPC connection.\n     */\n    private final class SessionUiApiImpl implements SessionUiApi {\n\n        @Override\n        public CompletableFuture<ElicitationResult> elicitation(ElicitationParams params) {\n            assertElicitation();\n            return getRpc().ui.elicitation(new SessionUiElicitationParams(sessionId, null, params.getMessage(),\n                    new UIElicitationSchema(params.getRequestedSchema().getType(),\n                            params.getRequestedSchema().getProperties(), params.getRequestedSchema().getRequired()),\n                    null, null)).thenApply(resp -> {\n                        var result = new ElicitationResult();\n                        if (resp.action() != null) {","sourceCodeStart":1356,"sourceCodeEnd":1392,"githubUrl":"https://github.com/github/copilot-sdk/blob/cd8cf15dc3f9e762615790aaed0a771a0f392755/java/sdk/src/main/java/com/github/copilot/CopilotSession.java#L1356-L1392","documentation":"Before any UI elicitation call, CopilotSession checks the negotiated session capabilities; assertElicitation() throws IllegalStateException if the host did not advertise ui.elicitation=true. Elicitation simply is not available in that environment.","triggerScenarios":"Calling elicitation UI methods (e.g. showMessage/requestInput on the session's UI API) when capabilities is null, caps.getUi() is null, or caps.getUi().getElicitation() is empty/false.","commonSituations":"Running under hosts (IDE versions, CLI/agent runtimes) that do not implement elicitation; calling UI methods before capabilities were received; assuming feature parity across Copilot host versions.","solutions":["Check session.getCapabilities().getUi().getElicitation().orElse(false) before invoking UI methods and branch to a non-UI flow otherwise","Upgrade the host/extension to a version supporting elicitation","Wait for the capabilities handshake to complete before evaluating support","Provide a fallback prompt mechanism (e.g. log-based or callback input) when elicitation is unsupported"],"exampleFix":"// before\nsession.getUi().requestInput(\"Name?\");\n// after\nboolean supported = session.getCapabilities().getUi().getElicitation().orElse(false);\nif (supported) {\n    session.getUi().requestInput(\"Name?\");\n} else {\n    log.info(\"Elicitation unsupported; using fallback input flow\");\n}","handlingStrategy":"validation","validationCode":"boolean elicitationSupported =\n    session.getCapabilities() != null\n        && session.getCapabilities().getUi() != null\n        && session.getCapabilities().getUi().getElicitation().orElse(false);","typeGuard":null,"tryCatchPattern":"try {\n    session.getUi().requestInput(\"...\");\n} catch (IllegalStateException e) {\n    if (e.getMessage().contains(\"Elicitation is not supported\")) {\n        // switch to non-UI fallback flow\n    }\n}","preventionTips":["Always feature-check capabilities before UI calls","Handle null/empty capabilities gracefully (treat as unsupported)","Document host-version requirements for elicitation features"],"tags":["capabilities","ui","elicitation"],"backgroundTag":"unsupported-operation","analyzedSha":"cd8cf15dc3f9e762615790aaed0a771a0f392755","analyzedAt":"2026-09-09T18:32:31.973Z","contentChangedAt":"2026-09-09T18:32:31.973Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}