[upstream-sync] Port onElicitationRequest handler from upstream copilot-sdk PR #908#78
Closed
github-actions[bot] wants to merge 1 commit intomainfrom
Closed
[upstream-sync] Port onElicitationRequest handler from upstream copilot-sdk PR #908#78github-actions[bot] wants to merge 1 commit intomainfrom
github-actions[bot] wants to merge 1 commit intomainfrom
Conversation
- Add :on-elicitation-request option to create-session and resume-session - Registers client as elicitation provider (requestElicitation on wire) - Handle elicitation.requested broadcast events in v3 protocol router - Auto-merge capabilities.changed events into session capabilities - Add handle-elicitation-request! in session.clj following same pattern as handle-user-input-request! and handle-permission-request! - Add new event types: capabilities.changed, sampling.requested, sampling.completed, session.remote_steerable_changed - Update session-config, resume-session-config, join-session-config specs to include ::on-elicitation-request Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ports the
onElicitationRequestcallback from upstream Node.js SDK PR #908 (Add onElicitationRequest Callback for Elicitation Provider Support).Upstream Changes Ported
✅ PR #908 —
[Node] Add onElicitationRequest Callback for Elicitation Provider SupportWhat it adds:
onElicitationRequesthandler inSessionConfigandResumeSessionConfigrequestElicitationcapability on session create/resumeelicitation.requestedbroadcast events from server → invokes handler → responds viasession.ui.handlePendingElicitationRPCcapabilities.changedbroadcast events to dynamically update session capabilitiescapabilities.changed,sampling.requested,sampling.completed,session.remote_steerable_changed❌ PR #957 —
doc: Add OnPermissionRequest handler to .NET / Getting Started codeSkipped — .NET documentation only, no relevance to Clojure port.
Clojure Implementation
session.clj:elicitation-handlerto session state storagehandle-elicitation-request!function following the same pattern ashandle-user-input-request!andhandle-permission-request!client.cljhandle-v3-elicitation-requested!— processeselicitation.requestedevents, invokes handler, sendssession.ui.handlePendingElicitationRPC response; on failure sends cancel to avoid hanging requestshandle-v3-capabilities-changed!— merges incomingcapabilities.changeddata into session capabilities atom (so(capabilities session)stays current as providers join/leave)handle-v3-broadcast-event!with cases for:copilot/elicitation.requestedand:copilot/capabilities.changed:request-elicitationboolean flag to bothbuild-create-session-paramsandbuild-resume-session-params:on-elicitation-requesttopre-register-sessioncreate-sessionandresume-sessionspecs.clj::on-elicitation-request fn?spec:on-elicitation-requesttosession-config-keys,::session-config,::resume-session-config,::join-session-config:copilot/capabilities.changed,:copilot/sampling.requested,:copilot/sampling.completed,:copilot/session.remote_steerable_changedTesting
Tests could not be run in this environment (Maven repository not available in sandbox). The implementation follows established patterns (
handle-user-input-request!,handle-v3-permission-requested!) and should be verified by CI.Handler Contract