{"record":{"id":"c2ec251634b78b83","repo":"github/copilot-sdk","slug":"elicitation-is-not-supported-by-the-host-check-se","errorCode":null,"errorMessage":"Elicitation is not supported by the host. Check session.capabilities.ui?.elicitation before calling UI methods.","messagePattern":"Elicitation is not supported by the host\\. Check session\\.capabilities\\.ui\\?\\.elicitation before calling UI methods\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nodejs/src/session.ts","lineNumber":1788,"sourceCode":"     * returned array has no effect on the session.\n     */\n    get openCanvases(): OpenCanvasInstance[] {\n        return [...this.openCanvasInstances];\n    }\n\n    /**\n     * Sets the open-canvas snapshot for this session.\n     *\n     * @param instances - The `openCanvases` array from the `session.resume` response.\n     * @internal This method is typically called internally when resuming a session.\n     */\n    setOpenCanvases(instances: OpenCanvasInstance[]): void {\n        this.openCanvasInstances = [...instances];\n    }\n\n    private assertElicitation(): void {\n        if (!this._capabilities.ui?.elicitation) {\n            throw new Error(\n                \"Elicitation is not supported by the host. \" +\n                    \"Check session.capabilities.ui?.elicitation before calling UI methods.\"\n            );\n        }\n    }\n\n    private async _elicitation(params: ElicitationParams): Promise<ElicitationResult> {\n        this.assertElicitation();\n        return this.rpc.ui.elicitation({\n            message: params.message,\n            requestedSchema: params.requestedSchema,\n        });\n    }\n\n    private async _confirm(message: string): Promise<boolean> {\n        this.assertElicitation();\n        const result = await this.rpc.ui.elicitation({\n            message,","sourceCodeStart":1770,"sourceCodeEnd":1806,"githubUrl":"https://github.com/github/copilot-sdk/blob/cd8cf15dc3f9e762615790aaed0a771a0f392755/nodejs/src/session.ts#L1770-L1806","documentation":"Raised by CopilotSession.assertElicitation() whenever a UI method (e.g. elicitation requests) is invoked while the host's capabilities do not advertise `ui.elicitation`. The SDK checks the negotiated session capabilities and refuses UI calls the host cannot serve, instead of sending a doomed request.","triggerScenarios":"Calling a UI/elicitation method on a session whose `capabilities.ui?.elicitation` is false/undefined; connecting to a host or older server version that does not support elicitation; using UI methods before capability negotiation completes.","commonSituations":"Running against a headless or older host lacking UI support; copying example code that assumes elicitation support; host capability flags changed after a server downgrade.","solutions":["Guard UI calls with `if (session.capabilities.ui?.elicitation)` before invoking them","Upgrade the host/server to a version that supports elicitation","Provide a non-UI fallback (e.g. text prompt) when the capability is absent"],"exampleFix":"// before\nawait session.ui.elicit({ message: \"Continue?\" });\n// after\nif (session.capabilities.ui?.elicitation) {\n  await session.ui.elicit({ message: \"Continue?\" });\n} else {\n  console.log(\"Continue?\"); // fallback\n}","handlingStrategy":"type-guard","validationCode":"if (!session.capabilities.ui?.elicitation) {\n  console.warn(\"elicitation unsupported; using CLI fallback\");\n}","typeGuard":"function supportsElicitation(session) {\n  return session.capabilities?.ui?.elicitation === true;\n}","tryCatchPattern":"try {\n  await session.ui.elicit({ message });\n} catch (err) {\n  if (String(err?.message).includes(\"Elicitation is not supported by the host\")) {\n    return cliFallbackPrompt(message);\n  }\n  throw err;\n}","preventionTips":["Always gate UI calls on session.capabilities.ui?.elicitation","Negotiate/check capabilities right after connect, before any UI feature is used","Provide non-interactive fallbacks for headless hosts"],"tags":["capabilities","ui","elicitation"],"backgroundTag":"feature-not-enabled","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"}