From b2674f2cc3b906ce6dcfcb49ef3b3f9ff5619629 Mon Sep 17 00:00:00 2001 From: Karl Krukow Date: Mon, 19 Oct 2026 09:49:10 +0200 Subject: [PATCH 1/2] feat: sync CLI 1.0.100-1 MCP and event contracts Sync the stable Node surface at https://github.com/github/copilot-sdk/commit/b96cd2b54f7eb87458fd50f485a751c712e88f62. Preserve experimental/internal exclusions and keep the library version unchanged. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 10751080-0767-4895-bfed-9f72f2b6982c --- .copilot-schema-version | 2 +- .github/workflows/ci.yml | 2 +- CHANGELOG.md | 10 +- .../2026-10-19-mcp-recovery-and-readiness.md | 57 ++ ...2026-08-08-query-seq-scoped-lifecycle.html | 2 +- ...6-08-10-host-owned-inference-boundary.html | 2 +- ...2026-09-27-dynamic-workflow-migration.html | 2 +- ...09-30-model-policy-and-lifecycle-sync.html | 2 +- ...02-transcript-recovery-and-owned-exit.html | 2 +- .../2026-10-04-byok-provider-telemetry.html | 2 +- ...26-10-05-callback-and-event-contracts.html | 2 +- ...xtensible-routing-and-event-contracts.html | 2 +- ...ansport-diagnostics-and-opaque-policy.html | 2 +- ...26-10-16-session-hooks-and-compaction.html | 2 +- ...2026-10-19-mcp-recovery-and-readiness.html | 19 + doc/api/API.html | 73 +- doc/api/azure-managed-identity.html | 2 +- doc/api/byok.html | 2 +- doc/api/codegen.html | 2 +- doc/api/custom-agents.html | 2 +- doc/api/debugging.html | 2 +- doc/api/doc-auth-index.html | 2 +- doc/api/doc-index.html | 3 +- doc/api/dynamic-workflows.html | 2 +- doc/api/getting-started.html | 2 +- doc/api/github.copilot-sdk.client.html | 2 +- .../github.copilot-sdk.generated.coerce.html | 2 +- ....copilot-sdk.generated.event-metadata.html | 2 +- ...hub.copilot-sdk.generated.event-specs.html | 2 +- doc/api/github.copilot-sdk.helpers.html | 2 +- doc/api/github.copilot-sdk.html | 2 +- doc/api/github.copilot-sdk.instrument.html | 2 +- doc/api/github.copilot-sdk.logging.html | 2 +- doc/api/github.copilot-sdk.process.html | 2 +- doc/api/github.copilot-sdk.protocol.html | 2 +- doc/api/github.copilot-sdk.session.html | 6 +- doc/api/github.copilot-sdk.specs.html | 2 +- doc/api/github.copilot-sdk.teardown.html | 2 +- doc/api/github.copilot-sdk.tool-set.html | 2 +- doc/api/github.copilot-sdk.tools.html | 2 +- doc/api/github.copilot-sdk.util.html | 2 +- doc/api/github.copilot-sdk.workflow.html | 2 +- doc/api/index.html | 2 +- doc/api/overview.html | 20 +- doc/api/style.html | 2 +- doc/api/topic-manifest.edn | 2 +- doc/api/upstream-doc-gap-matrix.html | 2 +- doc/index.md | 1 + doc/mcp/overview.md | 51 +- doc/reference/API.md | 104 ++- resources/github/copilot_sdk/api_surface.edn | 9 + schemas/README.md | 4 +- schemas/api.schema.json | 795 +++++++++++++++- schemas/session-events.schema.json | 308 +++++- src/github/copilot_sdk.clj | 4 + .../copilot_sdk/generated/event_specs.clj | 48 +- src/github/copilot_sdk/instrument.clj | 6 + src/github/copilot_sdk/session.clj | 41 +- src/github/copilot_sdk/specs.clj | 28 +- test/github/copilot_sdk/codegen_test.clj | 10 + test/github/copilot_sdk/e2e_test.clj | 106 +++ .../integration/stable_sync_b96cd2b_test.clj | 258 +++++ .../integration/upstream_1_0_100_1_test.clj | 261 ++++++ .../stable_upstream_delta_b96cd2b.edn | 882 ++++++++++++++++++ 64 files changed, 3020 insertions(+), 164 deletions(-) create mode 100644 doc/adr/2026-10-19-mcp-recovery-and-readiness.md create mode 100644 doc/api/2026-10-19-mcp-recovery-and-readiness.html create mode 100644 test/github/copilot_sdk/integration/stable_sync_b96cd2b_test.clj create mode 100644 test/github/copilot_sdk/integration/upstream_1_0_100_1_test.clj create mode 100644 test/resources/stable_upstream_delta_b96cd2b.edn diff --git a/.copilot-schema-version b/.copilot-schema-version index 2147b21..0b71356 100644 --- a/.copilot-schema-version +++ b/.copilot-schema-version @@ -1 +1 @@ -1.0.99-2 +1.0.100-1 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 36f09e2..f2339ad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: uses: actions/checkout@v6 with: repository: github/copilot-sdk - ref: 404304416ac5358651e3877a33bc9e8f4e482162 + ref: b96cd2b54f7eb87458fd50f485a751c712e88f62 path: .upstream/copilot-sdk persist-credentials: false fetch-depth: 0 diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c78fde..c4fe11c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. This change ## [Unreleased] ### Added (post-v1.0.22 sync) +- Added capability-gated MCP OAuth runtime refresh handoff, persisted recovery + outcomes, live-only MCP tool-readiness events, and request-compression fallback + diagnostics on usage and failure events. + ([upstream snapshot](https://github.com/github/copilot-sdk/commit/b96cd2b54f7eb87458fd50f485a751c712e88f62)) - Added creation-time session names; discovery-only agent and hook directories; interactive-user telemetry and read-only GitHub-cache-store options; and declarative custom-agent hooks with preserved JSON keys. @@ -13,6 +17,8 @@ All notable changes to this project will be documented in this file. This change ([upstream snapshot](https://github.com/github/copilot-sdk/commit/404304416ac5358651e3877a33bc9e8f4e482162)) ### Fixed (post-v1.0.22 sync) +- Explicit MCP OAuth cancellation takes precedence over a supplied token; + empty or non-string tokens cancel rather than reaching the runtime as tokens. - Forward discovery-root strings unchanged so the runtime can trim whitespace and ignore blank entries consistently across skills, instructions, agents, and file hooks. @@ -24,7 +30,9 @@ All notable changes to this project will be documented in this file. This change - **BREAKING**: Removed the retired `::specs/factory-run-id` contract; use `:workflow-run-id` for subagent Workflow attribution. Historical event maps still pass through unknown fields. -- Advanced CLI compatibility and schema provenance to `1.0.99-2`, preserving +- Documented additional startup directories as authorization for repository + hooks, including containing Git roots, cold-resume scope, and hook controls. +- Advanced CLI compatibility and schema provenance to `1.0.100-1`, preserving historical certification and explicitly inventorying source-only snapshots without upstream tests. New experimental and internal APIs remain excluded. The library version remains `1.0.16.0`; no release, tag, or deployment is cut. diff --git a/doc/adr/2026-10-19-mcp-recovery-and-readiness.md b/doc/adr/2026-10-19-mcp-recovery-and-readiness.md new file mode 100644 index 0000000..a38ec75 --- /dev/null +++ b/doc/adr/2026-10-19-mcp-recovery-and-readiness.md @@ -0,0 +1,57 @@ +# ADR: Preserve MCP recovery and readiness contracts + +- Status: Accepted +- Related: [upstream snapshot](https://github.com/github/copilot-sdk/commit/b96cd2b54f7eb87458fd50f485a751c712e88f62) + +## Context + +The Node SDK lets an MCP OAuth handler delegate advertised, noninteractive +credential renewal to the runtime. New events distinguish authorization +recovery completion from accepting the host response, and MCP tool readiness +from connection status. Usage and failure events gain compression-fallback +diagnostics. Other additions remain experimental or internal. + +## Decision + +Use the canonical handler result `{:kind :runtime-refresh}` and send +`"runtimeRefresh"` only when the request has `:runtime-refresh-supported true`. +Preserve omission and explicit false in callback data. Explicit cancellation +takes precedence over a token; a nonempty string token takes precedence over +handoff. Preserve bare-token maps and existing optional-token-field omission. +Malformed results and handler exceptions are logged and cancel the host request. +The same callback path serves create, resume, join, and channel variants. + +Keep renewal, grant storage, reconnect, and cancellation runtime-owned. +Handoff acceptance is not completion. Expose the persisted +`:copilot/mcp.oauth_recovery_completed` event with its request/server identity +and exact `"succeeded"`, `"cancelled"`, or `"failed"` outcome. +Expose ephemeral `:copilot/session.mcp_server_tools_loaded` with string server +name and the schema's integer tool count. Do not infer readiness from +`"connected"`, impose event ordering, or fabricate history for an ephemeral event. + +Expose the three optional compression diagnostic fields on both usage and +failure events. Preserve string enums and the schema's integer status range +of 0-999. Omission is not zero; explicit `nil` is invalid. Keep payload maps +open for future fields and preserve live/history behavior without new coercion. + +Retain the existing `:additional-directories` and `:enable-file-hooks` APIs. +Document startup directories as trust in repository commands and prompts, +including the containing Git root. Prove enabled/disabled and cold-resume +behavior with isolated repositories and a local model provider. Do not add +runtime discovery or authorization logic to the SDK. + +Keep skill-provider supporting files, Azure ML model acquisition, catalog +category filtering, hosting discovery hints, and generated MCP configuration +observations outside the supported API. Internal provider-type telemetry and +the durable compression-disable marker remain wire-only. + +## Consequences + +The public snapshot adds event/spec membership and the existing OAuth +dispatcher's fdef, without new client or session operations. Complete +symbol-based evidence extends the historical certification at its original pin. +The target has no Node test tree; retained upstream tests remain historical, +while new behavior is checked through local protocol and real-runtime tests. + +CLI compatibility and schema provenance advance to `1.0.100-1`. The library +version stays `1.0.16.0`; this decision does not cut a release, tag, or deployment. diff --git a/doc/api/2026-08-08-query-seq-scoped-lifecycle.html b/doc/api/2026-08-08-query-seq-scoped-lifecycle.html index df4abf8..71a47ff 100644 --- a/doc/api/2026-08-08-query-seq-scoped-lifecycle.html +++ b/doc/api/2026-08-08-query-seq-scoped-lifecycle.html @@ -1,6 +1,6 @@ -ADR: Add scope-bound query sequences before deprecating query-seq!

ADR: Add scope-bound query sequences before deprecating query-seq!

+ADR: Add scope-bound query sequences before deprecating query-seq!

ADR: Add scope-bound query sequences before deprecating query-seq!