MCPcopy Index your code
hub / github.com/github/copilot-sdk / _handleElicitationRequest

Method _handleElicitationRequest

nodejs/src/session.ts:942–963  ·  view source on GitHub ↗

* Handles an elicitation.requested broadcast event. * Invokes the registered handler and responds via handlePendingElicitation RPC. * @internal

(context: ElicitationContext, requestId: string)

Source from the content-addressed store, hash-verified

940 * @internal
941 */
942 async _handleElicitationRequest(context: ElicitationContext, requestId: string): Promise<void> {
943 if (!this.elicitationHandler) {
944 return;
945 }
946 try {
947 const result = await this.elicitationHandler(context);
948 await this.rpc.ui.handlePendingElicitation({ requestId, result });
949 } catch {
950 // Handler failed — attempt to cancel so the request doesn't hang
951 try {
952 await this.rpc.ui.handlePendingElicitation({
953 requestId,
954 result: { action: "cancel" },
955 });
956 } catch (rpcError) {
957 if (!(rpcError instanceof ConnectionError || rpcError instanceof ResponseError)) {
958 throw rpcError;
959 }
960 // Connection lost or RPC error — nothing we can do
961 }
962 }
963 }
964
965 /**
966 * Handles an exitPlanMode.request callback from the runtime.

Callers 2

_handleBroadcastEventMethod · 0.95
client.test.tsFile · 0.80

Calls 1

Tested by

no test coverage detected