feat: sync upstream copilot-sdk (post-v1.0.1, CLI schema 1.0.63)#139
Merged
Conversation
Pins @github/copilot to 1.0.63 and regenerates generated/event_specs.clj from the refreshed JSON Schemas. Pulls in new wire surface: the session.todos_changed event, optional AssistantUsageData fields (contentFilterTriggered, finishReason), ToolExecutionCompleteResult structuredContent, ToolExecutionStartData toolDescription, and the plugin/session ExtensionSource values. Upstream: github/copilot-sdk#1686 (1.0.63), commit a115246a (1.0.62). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds the public-SDK surface introduced upstream after v1.0.1:
- :memory session config ({:enabled boolean}) forwarded on both
create-session and resume-session, omitted when unset.
github/copilot-sdk#1617
- :otlp-protocol telemetry option mapped to OTEL_EXPORTER_OTLP_PROTOCOL.
github/copilot-sdk#1648
- Graceful runtime.shutdown in stop! for SDK-owned processes, bounded by
a 10s timeout; force-stop! left unchanged.
github/copilot-sdk#1667
- :mcp-defer-tools (#{:auto :never}) on MCP stdio/http server configs,
rendered as deferTools on the wire (1.0.63 schema).
- :token-prices on ::model-billing.
github/copilot-sdk#1633
- Optional event-data fields surfaced by the 1.0.63 schema
(assistant.usage content-filter/finish-reason,
tool.execution_complete structured-content) and the
:copilot/session.todos_changed public event.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds integration coverage for the new session config and wire mappings, mock-server handling for the runtime.shutdown RPC, and process-level assertions for graceful termination ordering. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Documents :memory, :otlp-protocol, MCP :defer-tools, :token-prices, the session.todos_changed event, and graceful shutdown across API.md, the MCP overview, and CHANGELOG. Bumps the Clojure patch to 1.0.1.1. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Syncs the Clojure Copilot SDK to upstream changes post-v1.0.1, including a CLI schema bump to 1.0.63 and corresponding SDK/API surface updates (session :memory, OTLP protocol telemetry, graceful shutdown, MCP deferTools, and new/updated event/spec shapes).
Changes:
- Add session
:memoryconfig (forwarded on create/resume; defaulted off in:emptymode) and update specs/tests/docs accordingly. - Add telemetry
:otlp-protocol→OTEL_EXPORTER_OTLP_PROTOCOL, plus gracefulruntime.shutdownhandling instop!(with wait-for-exit). - Regenerate schema-derived artifacts for CLI schema 1.0.63 (new
session.todos_changedevent, optional usage/tool fields, MCPdeferTools, etc.), and bump project version/pinned schema.
Show a summary per file
| File | Description |
|---|---|
| test/github/copilot_sdk/process_test.clj | Adds unit coverage for OTLP protocol env var mapping and omission behavior. |
| test/github/copilot_sdk/mock_server.clj | Extends mock RPC surface to include runtime.shutdown for shutdown-path tests. |
| test/github/copilot_sdk/integration_test.clj | Updates spec assertions, adds coverage for :memory, MCP deferTools, and graceful shutdown behavior. |
| src/github/copilot_sdk/util.clj | Adds MCP :mcp-defer-tools mapping and value stringification in wire conversion. |
| src/github/copilot_sdk/specs.clj | Adds/updates specs for OTLP protocol, MCP defer-tools, memory config, new events/fields, and token pricing metadata. |
| src/github/copilot_sdk/process.clj | Maps :otlp-protocol to env var; introduces wait-for-exit! helper for graceful stop. |
| src/github/copilot_sdk/generated/event_specs.clj | Regenerated wire specs for schema 1.0.63 (new event + field changes). |
| src/github/copilot_sdk/client.clj | Implements graceful stop! via runtime.shutdown + bounded wait; adds :memory to create/resume wire config; updates docs/comments. |
| src/github/copilot_sdk.clj | Exposes new :copilot/session.todos_changed in curated event sets. |
| schemas/session-events.schema.json | Updates pinned upstream session-events schema (serverTools, todos_changed, optional usage/tool fields, etc.). |
| schemas/README.md | Updates documented pinned schema version. |
| schemas/api.schema.json | Updates pinned upstream API schema (todos deps RPC, provider endpoint RPC, MCP deferTools, memory config, etc.). |
| README.md | Bumps documented dependency version to 1.0.1.1. |
| doc/reference/API.md | Documents new :memory, :otlp-protocol, updated :empty defaults count, graceful stop, and new event fields. |
| doc/mcp/overview.md | Documents :mcp-defer-tools and its wire encoding. |
| doc/getting-started.md | Bumps documented dependency version to 1.0.1.1. |
| CHANGELOG.md | Adds unreleased entries describing the upstream sync features and schema bump. |
| build.clj | Bumps project version to 1.0.1.1. |
| .copilot-schema-version | Bumps pinned schema version to 1.0.63. |
Copilot's findings
- Files reviewed: 18/19 changed files
- Comments generated: 4
Resolve four findings from the Copilot Code Review bot on PR #139: - process.clj: preserve the thread interrupt flag in wait-for-exit!. .waitFor throws InterruptedException (a subclass of Exception), so the generic catch was swallowing it and clearing the interrupt flag. Catch it separately and re-set the flag via (.interrupt (Thread/currentThread)) so callers still observe cancellation. - util.clj: correct the mcp-server->wire docstring example. clj->wire produces camelCase keyword keys, not string keys. - specs.clj: fix the memory-config comment to cite upstream PR #1617 (not #1638). - CHANGELOG.md: drop the nonexistent ::memory-enabled spec reference; only ::memory exists (reusing the existing ::enabled spec). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The session.todos_changed event reference pointed Clojure users at session.plan.readSqlTodosWithDependencies(), a TS-style method call for an @experimental upstream method this SDK does not expose. Reword the row as signal-only with no payload, consistent with how the rest of the doc names JSON-RPC methods. 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.
Brings the Clojure SDK to parity with the unreleased public-SDK surface upstream has merged since
v1.0.1, and bumps the pinned CLI schema1.0.61 → 1.0.63. Clojure patch version1.0.1.0 → 1.0.1.1.What this adds
:memorysession config ({:enabled boolean}) — forwarded on bothcreate-sessionandresume-session. (upstream #1617):otlp-protocoltelemetry option —"http/json"/"http/protobuf", mapped to theOTEL_EXPORTER_OTLP_PROTOCOLenv var on the spawned CLI. (upstream #1648)stop!now sends aruntime.shutdownRPC and waits for SDK-owned processes to exit naturally (10s bound) before terminating.force-stop!is unchanged. (upstream #1667):defer-toolson MCP stdio/http server configs —#{:auto :never}, rendered asdeferToolson the wire (1.0.63 schema).:token-priceson::model-billing. (upstream #1633):copilot/session.todos_changedpublic event, optionalassistant.usagefields (content-filter/finish-reason), andtool.execution_completestructured content.Implementation notes
:memoryis omit-vs-null. It is only placed on the wire when the caller sets it, never sent asnull. In:emptymode it defaults to{:enabled false}to match upstreamconfigDefaultsForMode; caller config always wins over the mode default.runtime.shutdownis sent after sessions disconnect but before the connection closes, and only for SDK-owned (non-external) processes. If the RPC fails or the process doesn't exit within the timeout,stop!falls back to SIGTERM→SIGKILL — it never hangs. The wait usesProcess.waitForrather than the exit channel to avoid racing the existing exit-watcher consumer.generated/is regenerated, not hand-edited. The schema additions flow in throughbb codegen; the idiom layer only moves under curated review.Validation
bb ci:fullgreen — E2E tests, all examples,bb validate-docs(17 files, 0 warnings), andbb jar.Multi-model review (claude-opus-4.8 + gpt-5.5) surfaced three findings, all fixed and re-validated:
:emptymode missing thememory {:enabled false}defaultconfig-defaults-for-mode; caller override winswait-for-exit!;stop!waits up to 10s for natural exit:server-tools/:service-request-idassertionsOpening as a draft for @krukow's review.