github/copilot-sdk · error

Elicitation is not supported by the host. Check…

Error message

Elicitation is not supported by the host. Check session.capabilities.ui?.elicitation before calling UI methods.

What it means

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.

Solutions

  1. Guard UI calls with `if (session.capabilities.ui?.elicitation)` before invoking them
  2. Upgrade the host/server to a version that supports elicitation
  3. Provide a non-UI fallback (e.g. text prompt) when the capability is absent

Example fix

// before
await session.ui.elicit({ message: "Continue?" });
// after
if (session.capabilities.ui?.elicitation) {
  await session.ui.elicit({ message: "Continue?" });
} else {
  console.log("Continue?"); // fallback
}
Defensive patterns

Strategy: type-guard

Validate before calling

if (!session.capabilities.ui?.elicitation) {
  console.warn("elicitation unsupported; using CLI fallback");
}

Type guard

function supportsElicitation(session) {
  return session.capabilities?.ui?.elicitation === true;
}

Try / catch

try {
  await session.ui.elicit({ message });
} catch (err) {
  if (String(err?.message).includes("Elicitation is not supported by the host")) {
    return cliFallbackPrompt(message);
  }
  throw err;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of github/copilot-sdk@cd8cf15dc3 (2026-09-09). Data as JSON: /api/errors/c2ec251634b78b83. Report an issue: GitHub.

Appendix: source

Thrown at nodejs/src/session.ts:1788

     * returned array has no effect on the session.
     */
    get openCanvases(): OpenCanvasInstance[] {
        return [...this.openCanvasInstances];
    }

    /**
     * Sets the open-canvas snapshot for this session.
     *
     * @param instances - The `openCanvases` array from the `session.resume` response.
     * @internal This method is typically called internally when resuming a session.
     */
    setOpenCanvases(instances: OpenCanvasInstance[]): void {
        this.openCanvasInstances = [...instances];
    }

    private assertElicitation(): void {
        if (!this._capabilities.ui?.elicitation) {
            throw new Error(
                "Elicitation is not supported by the host. " +
                    "Check session.capabilities.ui?.elicitation before calling UI methods."
            );
        }
    }

    private async _elicitation(params: ElicitationParams): Promise<ElicitationResult> {
        this.assertElicitation();
        return this.rpc.ui.elicitation({
            message: params.message,
            requestedSchema: params.requestedSchema,
        });
    }

    private async _confirm(message: string): Promise<boolean> {
        this.assertElicitation();
        const result = await this.rpc.ui.elicitation({
            message,

View on GitHub (pinned to cd8cf15dc3)