Skip to content

Upstream sync: post-v1.0.0-beta.4 round 5 (schema 1.0.52, #1378, #1377, #1393, #1405)#111

Merged
krukow merged 3 commits into
mainfrom
upstream-sync/post-beta.4-round-5
May 26, 2026
Merged

Upstream sync: post-v1.0.0-beta.4 round 5 (schema 1.0.52, #1378, #1377, #1393, #1405)#111
krukow merged 3 commits into
mainfrom
upstream-sync/post-beta.4-round-5

Conversation

@krukow
Copy link
Copy Markdown
Collaborator

@krukow krukow commented May 23, 2026

Syncs copilot-sdk-clojure with upstream github/copilot-sdk through commit e89a8914.

Upstream commits

Commit PR Status Notes
e89a8914 #1393 Ported Schema bump 1.0.52-1 → 1.0.52-4. Adds mcp_app.tool_call_complete event (SEP-1865) and several optional event-data fields.
24d5ff64 #1378 Ported — BREAKING Drops v2 protocol back-compat. Minimum supported protocol version is now 3.
85d91caa #1377 Ported Adds runtime_instructions system message section. Upstream also renamed SystemPromptSectionSystemMessageSection; Clojure side adds aliases and keeps existing name.
d99871cf #1359 Skipped Java/TS-internal: x-opaque-json mapping annotations only.
0c7886c7 #1379 Skipped TS E2E flaky test fixes.
dbe9d27d #1367 Skipped Rust SDK only.

Changes

BREAKING

  • Minimum protocol version raised from 2 to 3. The SDK now rejects CLI servers reporting protocol version 2. Removes the v2 tool.call / permission.request RPC dispatcher cases and the v2 tool.call arguments escape hatch from protocol/normalize-incoming. v3 broadcast handlers cover the same behaviour. Requires Copilot CLI 1.0.46 or later.

Added

  • :runtime-instructions system message section (wire: runtime_instructions)
  • specs/system-message-sections and ::specs/system-message-section aliases
  • :copilot/mcp_app.tool_call_complete in sdk/event-types and ::specs/event-type
  • protocol/preserve-event-opaque-fields case for mcp_app.tool_call_complete so :arguments and :result keep source-defined keys verbatim
  • Passive opt-un coverage (via schema regen) for: :service-request-id, :context-tier, :transport/:plugin-name/:plugin-version, :error on mcp-server-status, :source/:trigger, :tool-description/:ui-resource

Removed

  • 7 v2-only deftests (replaced by v3 broadcast tests)

Tests

  • 8 new red/green tests covering each schema 1.0.52-4 addition and the v3 minimum-protocol-version rejection
  • Mock server gained a per-instance :protocol-version atom so a negative test can configure a v2 server

Validation

  • bb test — 275 tests, 1319 assertions, 0 failures, 0 errors
  • bb validate-docs — 13 files, 0 warnings

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

krukow and others added 2 commits May 23, 2026 18:04
Regenerates schemas and event specs. Additive changes:
- New event `mcp_app.tool_call_complete` (SEP-1865)
- Optional `serviceRequestId` on error/assistant.message/assistant.usage/
  model.call_failure/session.compaction_complete
- Optional `contextTier` on session.model_change
- Optional `transport`/`pluginName`/`pluginVersion` on loaded MCP servers
- Optional `error` on mcp_server_status_changed
- Optional `source`/`trigger` on skill.invoked
- Optional `toolDescription`/`uiResource` on tool.execution_complete

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…vent

Ports upstream PRs #1378 and #1377 plus opaque-field handling for the
new mcp_app.tool_call_complete event from schema 1.0.52-4 (SEP-1865).

BREAKING: minimum supported protocol version raised from 2 to 3
(upstream PR #1378). Removes v2 `tool.call` and `permission.request`
RPC dispatcher cases from set-request-handler! and the v2 tool.call
arguments escape hatch from protocol/normalize-incoming. v3 broadcast
cover the same behaviour. Deletes 7 obsolete v2-only deftests.

Adds (upstream PR #1377):
- :runtime-instructions to specs/system-prompt-sections
- util/section-key->wire entry for runtime_instructions
- specs/system-message-sections + ::specs/system-message-section
  aliases pointing at the system-prompt-sections data, matching
  the upstream SystemPromptSection → SystemMessageSection rename
  without breaking existing callers

Adds (upstream schema 1.0.52-4):
- :copilot/mcp_app.tool_call_complete to the public sdk/event-types
  registry and to specs/::event-type
- protocol/preserve-event-opaque-fields case for mcp_app.tool_call_complete
  so :arguments and :result keep source-defined keys (no kebab-case)

Mock server: PROTOCOL_VERSION → DEFAULT_PROTOCOL_VERSION (= 3) with a
per-instance :protocol-version atom on MockServer so tests can configure
a v2 server and verify rejection.

Tests added:
- test-schema-1-0-52-4-mcp-app-tool-call-complete-event-type
- test-schema-1-0-52-4-mcp-app-tool-call-complete-opaque-fields
- test-schema-1-0-52-4-service-request-id
- test-schema-1-0-52-4-model-change-context-tier
- test-schema-1-0-52-4-skill-invoked-source-trigger
- test-schema-1-0-52-4-runtime-instructions-section
- test-schema-1-0-52-4-runtime-instructions-wire-roundtrip
- test-schema-1-0-52-4-min-protocol-version-3

Docs:
- CHANGELOG: post-v1.0.0-beta.4 round 5 entries
- API.md: runtime-instructions section + SystemMessageSection rename
  note + mcp_app.tool_call_complete event row

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 23, 2026 16:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Syncs the Clojure SDK with upstream github/copilot-sdk through commit e89a8914, including a schema bump to 1.0.52-4, adding new session event coverage, and applying the upstream breaking change that drops protocol v2 back-compat (minimum protocol version is now 3).

Changes:

  • Bump pinned schemas to 1.0.52-4 and regenerate wire event specs, adding mcp_app.tool_call_complete plus multiple optional event-data fields.
  • Add :runtime-instructions system message section and introduce system-message-sections / ::system-message-section aliases while preserving existing system-prompt-* names.
  • Remove v2 server→client RPC back-compat (tool/permission) and update client/mock server + integration tests to enforce protocol version ≥ 3.
Show a summary per file
File Description
test/github/copilot_sdk/mock_server.clj Adds per-server configurable :protocol-version and defaults mock protocol to v3 for new minimum-version behavior.
test/github/copilot_sdk/integration_test.clj Updates ping/status assertions to v3, removes v2-only dispatcher tests, and adds schema 1.0.52-4 + min-protocol-version coverage.
src/github/copilot_sdk/util.clj Extends system section keyword↔wire mapping to include :runtime-instructions (runtime_instructions).
src/github/copilot_sdk/specs.clj Adds :runtime-instructions to section specs and introduces system-message-* aliases for the upstream rename.
src/github/copilot_sdk/protocol.clj Adds opaque-field preservation for mcp_app.tool_call_complete and removes v2 tool.call argument preservation path.
src/github/copilot_sdk/generated/event_specs.clj Regenerated schema-driven event specs for 1.0.52-4 (new event + opt fields).
src/github/copilot_sdk/client.clj Raises min protocol version to 3 and removes v2 RPC dispatcher cases from the request handler.
src/github/copilot_sdk.clj Adds :copilot/mcp_app.tool_call_complete to the public event-types set.
schemas/session-events.schema.json Updates upstream session event schema with new event + new optional properties.
schemas/README.md Updates pinned schema version text to 1.0.52-4.
schemas/api.schema.json Updates upstream API schema (incl. MCP Apps API surface + other schema tweaks).
doc/reference/API.md Documents new event type and updates system section examples/notes (but currently has a key list mismatch—see PR comments).
CHANGELOG.md Adds Unreleased entries describing the sync, including the breaking protocol v3 minimum and schema-driven additions.
.copilot-schema-version Bumps pinned schema version from 1.0.52-1 to 1.0.52-4.

Copilot's findings

Comments suppressed due to low confidence (1)

src/github/copilot_sdk/util.clj:72

  • wire->section-key's docstring still says "system prompt sections", but the surrounding mapping and specs have moved to the "system message sections" terminology. Consider updating this docstring for consistency (and to avoid confusion with the upstream rename).
   :last-instructions    "last_instructions"})

(def wire->section-key
  "Map from wire string to Clojure keyword for system prompt sections."
  (into {} (map (fn [[k v]] [v k])) section-key->wire))
  • Files reviewed: 13/14 changed files
  • Comments generated: 1

Comment thread doc/reference/API.md Outdated
…to 1.0.52

Addresses Copilot Code Review feedback on PR #111:
- The 'Available section keys' paragraph and the 'Customize Mode' table
  in doc/reference/API.md listed sections that don't exist in
  github.copilot-sdk.specs/system-prompt-sections (e.g. :proactiveness,
  :formatting, :tools, :context-collection, :task-management,
  :agent-mode, :additional-instructions) and omitted real ones
  (:tool-efficiency, :environment-context, :code-change-rules,
  :guidelines, :tool-instructions, :custom-instructions,
  :runtime-instructions). Both locations now mirror the canonical spec
  (eleven sections) verbatim, including :runtime-instructions from
  upstream PR #1377.

Also picks up upstream PR #1405 (schema bump @github/copilot
1.0.52-4 → 1.0.52 stable). The shipped JSON Schemas are byte-identical
between the two versions, so codegen produces no diff; only the pin
in .copilot-schema-version and the README/CHANGELOG references move
to the stable release name.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@krukow krukow changed the title Upstream sync: post-v1.0.0-beta.4 round 5 (schema 1.0.52-4, #1378, #1377, #1393) Upstream sync: post-v1.0.0-beta.4 round 5 (schema 1.0.52, #1378, #1377, #1393, #1405) May 24, 2026
@krukow
Copy link
Copy Markdown
Collaborator Author

krukow commented May 25, 2026

Latest commit 78f6464 addresses the Copilot review feedback on the customize-mode section list. Re-requesting review.

@copilot review

Copilot finished work on behalf of krukow May 25, 2026 06:24
@krukow krukow merged commit 0802b15 into main May 26, 2026
3 checks passed
@krukow krukow deleted the upstream-sync/post-beta.4-round-5 branch May 26, 2026 10:32
krukow added a commit that referenced this pull request May 27, 2026
…seFailure) (#112)

* chore(schema): bump to 1.0.52-4 (upstream PR #1393)

Regenerates schemas and event specs. Additive changes:
- New event `mcp_app.tool_call_complete` (SEP-1865)
- Optional `serviceRequestId` on error/assistant.message/assistant.usage/
  model.call_failure/session.compaction_complete
- Optional `contextTier` on session.model_change
- Optional `transport`/`pluginName`/`pluginVersion` on loaded MCP servers
- Optional `error` on mcp_server_status_changed
- Optional `source`/`trigger` on skill.invoked
- Optional `toolDescription`/`uiResource` on tool.execution_complete

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* feat: drop v2 protocol back-compat + runtime_instructions + mcp_app event

Ports upstream PRs #1378 and #1377 plus opaque-field handling for the
new mcp_app.tool_call_complete event from schema 1.0.52-4 (SEP-1865).

BREAKING: minimum supported protocol version raised from 2 to 3
(upstream PR #1378). Removes v2 `tool.call` and `permission.request`
RPC dispatcher cases from set-request-handler! and the v2 tool.call
arguments escape hatch from protocol/normalize-incoming. v3 broadcast
cover the same behaviour. Deletes 7 obsolete v2-only deftests.

Adds (upstream PR #1377):
- :runtime-instructions to specs/system-prompt-sections
- util/section-key->wire entry for runtime_instructions
- specs/system-message-sections + ::specs/system-message-section
  aliases pointing at the system-prompt-sections data, matching
  the upstream SystemPromptSection → SystemMessageSection rename
  without breaking existing callers

Adds (upstream schema 1.0.52-4):
- :copilot/mcp_app.tool_call_complete to the public sdk/event-types
  registry and to specs/::event-type
- protocol/preserve-event-opaque-fields case for mcp_app.tool_call_complete
  so :arguments and :result keep source-defined keys (no kebab-case)

Mock server: PROTOCOL_VERSION → DEFAULT_PROTOCOL_VERSION (= 3) with a
per-instance :protocol-version atom on MockServer so tests can configure
a v2 server and verify rejection.

Tests added:
- test-schema-1-0-52-4-mcp-app-tool-call-complete-event-type
- test-schema-1-0-52-4-mcp-app-tool-call-complete-opaque-fields
- test-schema-1-0-52-4-service-request-id
- test-schema-1-0-52-4-model-change-context-tier
- test-schema-1-0-52-4-skill-invoked-source-trigger
- test-schema-1-0-52-4-runtime-instructions-section
- test-schema-1-0-52-4-runtime-instructions-wire-roundtrip
- test-schema-1-0-52-4-min-protocol-version-3

Docs:
- CHANGELOG: post-v1.0.0-beta.4 round 5 entries
- API.md: runtime-instructions section + SystemMessageSection rename
  note + mcp_app.tool_call_complete event row

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix(docs): align customize-mode section list with specs; bump schema to 1.0.52

Addresses Copilot Code Review feedback on PR #111:
- The 'Available section keys' paragraph and the 'Customize Mode' table
  in doc/reference/API.md listed sections that don't exist in
  github.copilot-sdk.specs/system-prompt-sections (e.g. :proactiveness,
  :formatting, :tools, :context-collection, :task-management,
  :agent-mode, :additional-instructions) and omitted real ones
  (:tool-efficiency, :environment-context, :code-change-rules,
  :guidelines, :tool-instructions, :custom-instructions,
  :runtime-instructions). Both locations now mirror the canonical spec
  (eleven sections) verbatim, including :runtime-instructions from
  upstream PR #1377.

Also picks up upstream PR #1405 (schema bump @github/copilot
1.0.52-4 → 1.0.52 stable). The shipped JSON Schemas are byte-identical
between the two versions, so codegen produces no diff; only the pin
in .copilot-schema-version and the README/CHANGELOG references move
to the stable release name.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* chore(schema): bump to 1.0.55-1 and surface canvas event types

Advance `.copilot-schema-version` from 1.0.52 to 1.0.55-1, picking up:
- upstream PR #1408 (1.0.53-2)
- upstream PR #1410 (1.0.53)
- upstream PR #1411 (1.0.54)
- upstream PR #1412 (1.0.55-0)
- upstream PRs #1401 / #1413 (canvas runtime — wire-only, see below)
- upstream PR #1432 (1.0.55-1)

Schema regen surfaces two new wire-only canvas event types:
`session.canvas.opened` and `session.canvas.registry_changed`, plus
the field set behind them. These events now appear in the public
`event-types` set for forward compatibility, but the canvas runtime
(extension manifests, `requestCanvasRenderer`, `openCanvases`,
extension info, etc. — upstream PRs #1401, #1413) is intentionally
NOT yet exposed on the public Clojure API. Canvas runtime support
is deferred to a dedicated future sync round; for now the events
flow through as generic session events.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* feat(hooks): add :on-post-tool-use-failure lifecycle hook (upstream PR #1421)

Adds a new lifecycle hook dispatched after a tool execution whose result
was "failure". `:on-post-tool-use` only fires for successful results,
so register this handler to observe or react to failed tool outcomes.
Note: "rejected", "denied", and "timeout" results do not currently
trigger this hook — only "failure" does.

Handler input has `:tool-name`, `:tool-args`, `:error` (string), plus
the base hook fields (`:session-id`, `:timestamp`, `:cwd`). Optional
return value `{:additional-context "..."}` is appended as hidden
guidance to the model alongside the failed tool result.

Wiring sites:
- `specs/::on-post-tool-use-failure` fn spec, added to `::hooks` :opt-un
  `:on-post-tool-use-failure`
- `client/create-session` docstring lists the new hook key
- API.md hooks example documents input/output shape

Tests cover (a) handler invocation + `additionalContext` round-trip on
the wire, and (b) graceful nil result when only the success hook is
registered. RED→GREEN: the new tests fail without the dispatcher change.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix(review): address multi-model review on schema bump

Two findings from code-review pass on PR-candidate round-5 extension:

- (gpt-5.5) Canvas events declare `x-opaque-json` fields (`data.input`
  on `session.canvas.opened`; nested `canvases[].inputSchema` and
  `canvases[].actions[].inputSchema` on `session.canvas.registry_changed`).
  Since the canvas runtime is intentionally deferred to a future sync
  round and we have not yet implemented opaque-field preservation for
  these payloads, do not surface canvas event types in the curated public
  `::event-type` set yet — they would expose mangled JSON-Schema keys
  to consumers. The wire layer (`generated.event-specs/event-types`)
  still has them; canvas event types and their opaque-field preservation
  will land together when the canvas runtime is ported.

- (claude-opus-4.7) CHANGELOG schema-bump entry had the version/PR
  positional mapping wrong for the first two items (`1.0.53 → #1408`
  should be `1.0.53-2 → #1408`, `1.0.53 → #1410`). Reorder so each
  position is correct and add a forward-looking note about deferred
  canvas opaque-field preservation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants