You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* chore(schema): bump CLI schema 1.0.61 -> 1.0.63 and regenerate
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>
* feat(sync): port post-v1.0.1 config, lifecycle, and event additions
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>
* test(sync): cover memory, otlp, graceful shutdown, and deferTools
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>
* docs(sync): document new config and bump version to 1.0.1.1
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>
* fix(sync): address Copilot review feedback
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>
* docs(sync): drop non-exposed RPC method reference from todos_changed row
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>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy file name to clipboardExpand all lines: doc/mcp/overview.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -111,6 +111,7 @@ Here's a complete working example using the official [`@modelcontextprotocol/ser
111
111
|`:mcp-tools`| vector | Yes | Tools to enable (`["*"]` for all, `[]` for none, or specific tool names) |
112
112
|`:mcp-server-type`| keyword | No |`:local` or `:stdio` (defaults to local) |
113
113
|`:mcp-timeout`| number | No | Timeout in milliseconds |
114
+
|`:mcp-defer-tools`| keyword | No | Tool-deferral policy: `:auto` (defer tool registration until needed) or `:never`. Wire-encoded as `deferTools` (upstream schema 1.0.63) |
114
115
|`:env`| map | No | Environment variables for the subprocess |
115
116
|`:cwd`| string | No | Working directory for the subprocess |
116
117
@@ -122,12 +123,15 @@ Here's a complete working example using the official [`@modelcontextprotocol/ser
122
123
|`:mcp-url`| string | Yes | Server URL |
123
124
|`:mcp-tools`| vector | Yes | Tools to enable (`["*"]` for all) |
124
125
|`:mcp-timeout`| number | No | Timeout in milliseconds |
126
+
|`:mcp-defer-tools`| keyword | No | Tool-deferral policy: `:auto` or `:never`. Wire-encoded as `deferTools` (upstream schema 1.0.63) |
125
127
|`:mcp-headers`| map | No | HTTP headers (e.g., for authentication) |
126
128
127
129
### Key Naming Convention
128
130
129
131
MCP server config keys use an `:mcp-` prefix in Clojure (e.g., `:mcp-command`, `:mcp-args`, `:mcp-tools`) to distinguish them from other configuration options. On the wire, the SDK automatically strips this prefix to match the upstream protocol (e.g., `command`, `args`, `tools`).
130
132
133
+
Some prefixed keys map to a camelCase wire key rather than a bare strip: `:mcp-defer-tools` becomes `deferTools`, and its keyword value (`:auto`/`:never`) is stringified.
134
+
131
135
The non-prefixed keys `:env` and `:cwd` are shared with other config types and do not have an `:mcp-` prefix.
Copy file name to clipboardExpand all lines: doc/reference/API.md
+24-7Lines changed: 24 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -133,11 +133,11 @@ Get information about the current shared client state. Returns `nil` if no share
133
133
|`:remote?`| boolean |`false`| When `true`, append `--remote` to the spawned CLI args so the CLI exposes the session over a GitHub-hosted remote endpoint. Ignored when `:cli-url` is set. (upstream PR #1192) |
134
134
|`:session-idle-timeout-seconds`| integer |`0` (disabled) | Server-wide session idle timeout in seconds. When `> 0`, append `--session-idle-timeout <n>` to the spawned CLI so idle sessions are cleaned up after the given duration. |
135
135
|`:on-list-models`| fn | nil | Zero-arg function returning model info maps. Bypasses `models.list` RPC; does not require `start!`. Results are cached the same way as RPC results |
136
-
|`:telemetry`| map | nil | OpenTelemetry export config, applied as environment variables to the **spawned** CLI (ignored when connecting to an existing server via `:cli-url` or a parent process via `:is-child-process?`, since no CLI is spawned). When present, enables OTel. Keys (all optional): `:otlp-endpoint` (OTLP HTTP endpoint), `:file-path` (write spans to a file), `:exporter-type` (exporter selection), `:source-name` (service/source name), `:capture-content?` (boolean — capture prompt/response content; **off by default for privacy**). See [Observability](#observability). (upstream PR #785) |
136
+
|`:telemetry`| map | nil | OpenTelemetry export config, applied as environment variables to the **spawned** CLI (ignored when connecting to an existing server via `:cli-url` or a parent process via `:is-child-process?`, since no CLI is spawned). When present, enables OTel. Keys (all optional): `:otlp-endpoint` (OTLP HTTP endpoint), `:otlp-protocol` (`"http/json"` or `"http/protobuf"` — sets `OTEL_EXPORTER_OTLP_PROTOCOL`), `:file-path` (write spans to a file), `:exporter-type` (exporter selection), `:source-name` (service/source name), `:capture-content?` (boolean — capture prompt/response content; **off by default for privacy**). See [Observability](#observability). (upstream PR #785, [PR #1648](https://github.com/github/copilot-sdk/pull/1648)) |
137
137
|`:on-get-trace-context`| fn | nil | Zero-arg function returning `{:traceparent "..." :tracestate "..."}`, called per request (session create/resume and each message send) to propagate a distributed-trace context. Only `:traceparent` and `:tracestate` are forwarded. See [Observability](#observability)|
138
138
|`:is-child-process?`| boolean |`false`| When `true`, connect via own stdio to a parent Copilot CLI process (no process spawning). Requires `:use-stdio?``true`; mutually exclusive with `:cli-url`|
139
139
|`:session-fs`| map | nil | Session filesystem provider config. Keys: `:initial-cwd` (string, required), `:session-state-path` (string, required), `:conventions` (`"windows"` or `"posix"`, required). When set, the client calls `sessionFs.setProvider` on connect and routes filesystem operations through per-session handlers. See [Session Filesystem](#session-filesystem)|
140
-
|`:mode`| keyword |`:copilot-cli`| Client multitenancy mode: `:copilot-cli` (default — preserve historical CLI behavior) or `:empty` (multi-tenant SaaS hosts that must isolate sessions from local machine state). In `:empty` mode the SDK requires at least one tenant-scoped storage root (`:copilot-home`, `:session-fs`, `:cli-url`, or `:is-child-process?`), sets `COPILOT_DISABLE_KEYTAR=1` on the spawned CLI, spreads 9 safe defaults under caller session config, forces `installedPlugins []`, and normalizes `:system-message` to strip `environment_context`. See [Client Mode](#client-mode-empty). (upstream PR #1428) |
140
+
|`:mode`| keyword |`:copilot-cli`| Client multitenancy mode: `:copilot-cli` (default — preserve historical CLI behavior) or `:empty` (multi-tenant SaaS hosts that must isolate sessions from local machine state). In `:empty` mode the SDK requires at least one tenant-scoped storage root (`:copilot-home`, `:session-fs`, `:cli-url`, or `:is-child-process?`), sets `COPILOT_DISABLE_KEYTAR=1` on the spawned CLI, spreads 10 safe defaults under caller session config, forces `installedPlugins []`, and normalizes `:system-message` to strip `environment_context`. See [Client Mode](#client-mode-empty). (upstream PR #1428) |
141
141
142
142
### Methods
143
143
@@ -167,6 +167,13 @@ Create a client, start it, and ensure `stop!` runs on exit.
167
167
168
168
Stop the server and close all sessions gracefully.
169
169
170
+
For SDK-spawned processes (not `:external-server?`), `stop!` issues a
171
+
`runtime.shutdown` RPC before closing the connection, giving the CLI a chance to
172
+
flush state and exit cleanly. The call is bounded by a 10-second timeout; on
173
+
timeout or error the SDK falls back to terminating the process (SIGTERM, then
174
+
SIGKILL). Connecting to an external server (`:cli-url`) skips the shutdown RPC and
175
+
the process is left running. (upstream [PR #1667](https://github.com/github/copilot-sdk/pull/1667))
176
+
170
177
#### `force-stop!`
171
178
172
179
```clojure
@@ -291,6 +298,7 @@ Create a client and session together, ensuring both are cleaned up on exit.
291
298
|`:coauthor-enabled`| boolean | Add a Copilot Co-authored-by trailer to commits made by the CLI. Forwarded via `session.options.update`. Defaulted to `false` in `:empty` mode. (upstream PR #1428) |
292
299
|`:manage-schedule-enabled`| boolean | Enable the built-in schedule-management tools. Forwarded via `session.options.update`. Defaulted to `false` in `:empty` mode. (upstream PR #1428) |
293
300
|`:open-canvases`| vector | (resume-session / join-session only) Seed the open-canvases snapshot when reconnecting. Each entry: `{:instance-id ... :extension-id ... :canvas-id ... :reopen bool :availability "ready"\|"stale" :extension-name? ... :title? ... :status? ... :url? ... :input? {...}}`. Caller-defined `:input` keys are preserved verbatim through wire conversion (no kebab→camel re-casing). See [`open-canvases`](#open-canvases). (upstream PR #1604) |
301
+
|`:memory`| map | Persistent-memory configuration. Shape: `{:enabled boolean}`. Sent on **both**`session.create` and `session.resume`; omitted entirely when the key is absent (never wire `null`). Wire-encoded as `memory`. In `:mode :empty` it is defaulted to `{:enabled false}` (caller can override). (upstream [PR #1617](https://github.com/github/copilot-sdk/pull/1617)) |
294
302
295
303
#### `resume-session`
296
304
@@ -441,7 +449,14 @@ Requires authentication (unless `:on-list-models` is provided). Returns a vector
441
449
:max-prompt-image-size20971520}}}
442
450
:model-policy {:policy-state"enabled"
443
451
:terms"..."}
444
-
:model-billing {:multiplier1.0}
452
+
:model-billing {:multiplier1.0
453
+
;; Per-token prices (upstream PR #1633), present when the
@@ -1470,6 +1485,7 @@ Convert an unqualified event keyword to a namespace-qualified `:copilot/` keywor
1470
1485
|`:copilot/session.plan_changed`| Session plan created/updated/deleted; data: `{:operation "create"/"update"/"delete"}`|
1471
1486
|`:copilot/session.workspace_file_changed`| Workspace file created or updated; data: `{:path "...", :operation "create"/"update"}`|
1472
1487
|`:copilot/session.task_complete`| Task completed by the session agent; data: `{:summary "..." :aborted? false}` (both optional) |
1488
+
|`:copilot/session.todos_changed`| Signal-only: the agent's todos / todo-deps table was written. **No payload.** Events arrive in order; debounce on arrival if needed (upstream schema 1.0.63) |
|`:copilot/assistant.usage`| Token usage for this turn |
1504
+
|`:copilot/assistant.usage`| Token usage for this turn; data may include optional `:content-filter-triggered` (boolean) and `:finish-reason` (string) (upstream schema 1.0.63)|
1489
1505
|`:copilot/abort`| Current message aborted |
1490
1506
|`:copilot/tool.user_requested`| Tool execution requested by user |
1491
1507
|`:copilot/tool.execution_start`| Tool execution started; data includes `:tool-call-id`, `:tool-name`, optional `:arguments`, `:parent-tool-call-id`, `:mcp-server-name`, `:mcp-tool-name`, `:model`|
|`:source-name`| string | Service / source name attached to spans |`COPILOT_OTEL_SOURCE_NAME`|
1636
1653
|`:capture-content?`| boolean | Capture prompt/response content in spans. **Defaults to off** — only enable in trusted environments, as it records message content |`OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT`|
1637
1654
1638
1655
When `:telemetry` is present the SDK sets `COPILOT_OTEL_ENABLED=true` on the CLI process.
0 commit comments