Conversation
… fields, sessionFs, timeout result-type Elicitation Provider (PR #908): - Add :on-elicitation-request handler to SessionConfig/ResumeSessionConfig - Send requestElicitation flag in create/resume RPC - Handle elicitation.requested broadcast → call handler → respond via session.ui.handlePendingElicitation (cancel on error) - Handle capabilities.changed broadcast with deep-merge (state updated before event publish so observers see consistent state) - Rename steerable → remote-steerable (BREAKING, upstream wire rename) - Add event types: sampling.requested/completed, session.remote_steerable_changed, capabilities.changed Event Payload Fields (PR #916): - skill.invoked: add optional :description - subagent.started/completed/failed: add :agent-name, :agent-description, :model, :total-tool-calls, :total-tokens, :duration-ms - session.custom_agents_updated: full payload spec with :agents array, :warnings, :errors SessionFs Virtual Filesystem (PR #917): - Add :session-fs client option (initial-cwd, session-state-path, conventions) - Call sessionFs.setProvider RPC on connect (start! and connect-with-streams!) - Add :create-session-fs-handler to session config (required when sessionFs enabled) - Dispatch 10 sessionFs.* RPC operations to per-session handler maps - Add aborted? to session.task_complete event data - All 4 session creation paths (sync/async × create/resume) handle sessionFs with proper cleanup on failure Timeout Result Type (PR #970): - Add :timeout/"timeout" to ::result-type spec Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Ports four upstream github/copilot-sdk PRs into the Clojure SDK, adding elicitation provider support, SessionFs virtual filesystem support, and expanded event payload/spec coverage while keeping protocol v3 behavior aligned.
Changes:
- Add
:on-elicitation-requestsupport (wire flag + v3 broadcast handling + capabilities merge) and document/example it. - Add SessionFs provider support (
:session-fsclient option,sessionFs.setProvider, dispatch ofsessionFs.*RPCs via per-session handler maps). - Update specs/docs/changelog for new/updated event fields and tool result type
"timeout".
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/github/copilot_sdk/client.clj |
Adds v3 elicitation broadcast handler, capabilities.changed state application, and SessionFs RPC provider registration + request routing. |
src/github/copilot_sdk/session.clj |
Stores elicitation/SessionFs handlers in session state; adds SessionFs dispatcher; deep-merge capabilities updates. |
src/github/copilot_sdk/specs.clj |
Adds specs for SessionFs config, elicitation request, new/updated events, and "timeout" tool result type. |
src/github/copilot_sdk.clj |
Extends event sets to include sampling/capabilities/remote-steerable related events. |
doc/reference/API.md |
Documents :session-fs, elicitation provider, and updated event payload fields. |
test/github/copilot_sdk/integration_test.clj |
Adds integration tests covering elicitation wire flag, v3 elicitation routing, handler error→cancel, and capabilities.changed update. |
examples/elicitation_provider.clj |
New example demonstrating elicitation provider handler and event observation. |
examples/README.md |
Documents the new elicitation provider example. |
run-all-examples.sh |
Runs the new elicitation provider example in the examples script. |
CHANGELOG.md |
Records the newly ported upstream features under [Unreleased]. |
- Define fn? specs for all 10 sessionFs handler keys (read-file, write-file, etc.)
- Move handle-session-fs-request! after channel? definition and use it
instead of ManyToManyChannel instance check
- Remove (or result {}) coercion — pass nil through for void FS operations
- Add ::remote-steerable? to ::session.resume-data spec (was missing)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Addressing Copilot Code Review Feedback (4 comments)All 4 issues fixed in commit 2f87981: 1. Undefined sessionFs handler key specs (specs.clj:83) 2. ManyToManyChannel too narrow for channel detection (session.clj:155) 3. Nil coercion to {} for void FS ops (session.clj:157) 4. ::remote-steerable? missing from session.resume-data (CHANGELOG.md:21) |
- Update changelog: steerable → remote-steerable? to avoid stale entry - Define ::source spec (string?) for user.message-data and custom-agent-info Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Addressing Copilot Code Review Round 2 (2 comments)Fixed in commit d7f45f3: 1. Changelog steerable/remote-steerable? inconsistency (CHANGELOG.md:8) 2. |
Summary
Ports four upstream
github/copilot-sdkPRs in a single batch, with 3 rounds of multi-model code review (Opus 4.6, GPT-5.4, Goldeneye) that caught and fixed 11 issues before submission.Upstream Changes Ported
PR #908 — Elicitation Provider Support
:on-elicitation-requesthandler onSessionConfigandResumeSessionConfigrequestElicitation: truein session create/resume RPC when handler is providedelicitation.requestedbroadcast events → invokes handler → responds viasession.ui.handlePendingElicitationRPC{:action "cancel"}to prevent hangingcapabilities.changedbroadcast handling with deep-merge (state updated before event publish so observers see consistent state)::steerable?renamed to::remote-steerable?(upstream wire field rename)sampling.requested,sampling.completed,session.remote_steerable_changed,capabilities.changedPR #916 — Event Payload Field Updates
skill.invoked: optional:descriptionfieldsubagent.started/completed/failed::agent-name,:agent-display-name,:agent-description,:model,:total-tool-calls,:total-tokens,:duration-mssession.custom_agents_updated: full payload spec with:agentsarray,:warnings,:errorsPR #917 — SessionFs Virtual Filesystem
:session-fsclient option ({:initial-cwd :session-state-path :conventions})sessionFs.setProviderRPC on connect (bothstart!andconnect-with-streams!):create-session-fs-handleron session config — factory(fn [session] → handler-map)required when sessionFs is enabledsessionFs.*RPC operations (readFile,writeFile,appendFile,exists,stat,mkdir,readdir,readdirWithTypes,rm,rename) to per-session handler mapsaborted?field onsession.task_completeevent dataPR #970 — Timeout Result Type
:timeout/"timeout"to::result-typespecCode Review Process
3 rounds of parallel multi-model review (Claude Opus 4.6, GPT-5.4, Goldeneye):
Supersedes
This PR supersedes the following automated upstream-sync draft PRs:
connect-with-streams!coverageTesting
elicitation_provider.clj)Files Changed
src/github/copilot_sdk/client.cljsrc/github/copilot_sdk/session.cljsrc/github/copilot_sdk/specs.cljsrc/github/copilot_sdk.cljdoc/reference/API.mdtest/.../integration_test.cljexamples/elicitation_provider.cljCHANGELOG.md