Skip to content

Upstream sync: Copilot CLI 1.0.48#103

Merged
krukow merged 6 commits into
mainfrom
upstream-sync/v1.0.48
May 15, 2026
Merged

Upstream sync: Copilot CLI 1.0.48#103
krukow merged 6 commits into
mainfrom
upstream-sync/v1.0.48

Conversation

@krukow
Copy link
Copy Markdown
Collaborator

@krukow krukow commented May 15, 2026

Sync the Clojure SDK with upstream github/copilot-sdk through the CLI 1.0.48 GA release (npm @github/copilot@1.0.48).

Changes

Schema bump (8b41b5d)

  • .copilot-schema-version: 1.0.44-21.0.48
  • Regenerated schemas/{api,session-events}.schema.json and src/github/copilot_sdk/generated/event_specs.clj

New SDK features ported (6136960)

PR CLI Feature
#1288 1.0.48-1 session/remote-enable! 2-arity overload with :mode opts
#1295 1.0.48 :remote-session session config option for create-session / resume-session
#1292 1.0.48 :copilot/session.custom_notification event (Skills Notify)
#1286 1.0.47 :is-autopilot-continuation on user.message, :api-endpoint on assistant.usage
#1288 1.0.48-1 :recurring on session.schedule_created
#1239 1.0.44-3 Extension permission kinds (:extension-management, :extension-permission-access)

Key-preservation for session.custom_notification — the new event's :subject and :payload fields carry source-defined identifiers and opaque JSON. protocol/normalize-incoming now preserves their keys verbatim (no kebab-casing), matching the existing escape hatch for external_tool.requested arguments. Without this, identifiers like "GitHub-Login" and "Actor"/"actor" would collapse or change shape.

Tests (bd7e271)

  • test-custom-notification-event-type — exercises protocol/normalize-incoming end-to-end with a raw wire-shape event and verifies preserved keys.
  • test-remote-session-config-forwarded-on-wire — covers :on / :export / :off / absence / spec rejection of bogus values for both session.create and session.resume.
  • Fixed two pre-existing tests that used string-keyed wire data (silently bypassed wire->clj).

Docs (8d679df)

  • CHANGELOG.md — entries under [Unreleased] citing each upstream PR
  • doc/reference/API.md:remote-session config row, custom-notification event row

Validation

  • bb test254 tests, 1192 assertions, 0 failures, 0 errors
  • bb validate-docs13 files, 0 warnings
  • bb ci — green (tests + docs + jar build)
  • bb ci:full — green except for one transient test-e2e-blob-attachment timeout unrelated to this change
  • ./run-all-examples.sh — all examples green

Multi-model code review

Two reviewers were run in parallel before commit (Claude Opus 4.7 and GPT-5.5).

# Finding Source Severity Decision
1 :remote-session had no s/def:bogus accepted and forwarded on the wire GPT-5.5 Medium Fixed: added (s/def ::remote-session ::remote-session-mode) and a regression test that :remote-session :bogus now throws on create-session
2 subject/payload keys silently kebab-cased by normalize-incoming, mangling source-defined identifiers and collapsing "actor"/"Actor" into one keyword Claude Opus 4.7 High Fixed: added a third cond branch to normalize-incoming for session.custom_notification, preserving :subject and :payload raw; added an end-to-end normalize test
3 test-custom-notification-event-type only validated static registration, no wire round-trip Claude Opus 4.7 Medium Fixed: test now drives a raw wire-shape message through protocol/normalize-incoming

Branch notes

This branch was created fresh off main after the prior 1.0.46 sync (#102) was squash-merged. The 4 commits here are the net-new 1.0.47 + 1.0.48 work.

krukow and others added 4 commits May 15, 2026 09:44
Pinned upstream @github/copilot npm version advanced from 1.0.46 to the
1.0.48 GA release. Regenerated session-events.schema.json and
api.schema.json from the upstream package, then regenerated wire specs
in generated/event_specs.clj.

This brings the schema in line with upstream PRs:
- PR #1292 (CLI 1.0.48) — session.custom_notification event
- PR #1295 (CLI 1.0.48) — remoteSession session config option
- and the previously-pinned 1.0.48-1 prerelease changes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Three upstream features ported with idiomatic Clojure surface:

1. Per-session remote mode for remote-enable (PR #1288, CLI 1.0.48-1)
   - session/remote-enable! now accepts a 2-arity overload with :mode
     opts (:off / :export / :on). Existing 1-arity form preserved.
   - New ::remote-session-mode and ::remote-enable-opts specs.

2. :remote-session session config option (PR #1295, CLI 1.0.48)
   - create-session and resume-session accept :remote-session set to
     :off, :export, or :on; forwarded on the wire as remoteSession.
     Validated by ::remote-session (alias of ::remote-session-mode);
     bogus values are rejected at session-create time.

3. :copilot/session.custom_notification event (PR #1292, CLI 1.0.48)
   - Skills can emit application-level events via the Notify block.
     Exposed in sdk/event-types and sdk/session-events; idiom spec
     ::session.custom_notification-data covers :source, :name,
     :payload, :subject, :version.
   - Protocol normalizer preserves :subject and :payload verbatim
     (no kebab-casing) because both carry source-defined identifiers
     and opaque JSON. Mirrors the existing escape hatch for
     external_tool.requested arguments.

Also surfaces post-1.0.46 wire fields previously left implicit:
:recurring on schedule events, :is-autopilot-continuation on user
messages, and :api-endpoint on extension auth events. Extension
permission kinds (:extension-management,
:extension-permission-access) added to ::permission-kind.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- test-custom-notification-event-type: verifies public event-types/
  session-events registration, idiom spec acceptance, and that
  protocol/normalize-incoming preserves source-defined :subject keys
  (e.g., :GitHub-Login) and opaque :payload contents verbatim.
- test-remote-session-config-forwarded-on-wire: covers :on, :export,
  :off, omission, and spec rejection of bogus values for both
  session.create and session.resume params.
- Fix two pre-existing tests (test-schedule-created-recurring-field,
  test-user-message-is-autopilot-continuation-field) to use
  keyword-keyed wire data — util/wire->clj only transforms keyword
  keys, so string-keyed fixtures bypassed conversion silently.
- Codegen fixture for session.custom_notification added so wire/idiom
  spec drift would be caught.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- CHANGELOG: schema bump to 1.0.48 GA, new :remote-session config
  (PR #1295), new :copilot/session.custom_notification event with
  key-preservation note (PR #1292), plus the previously-pinned
  1.0.48-1 entries.
- doc/reference/API.md: :remote-session row in create-session config
  table; :copilot/session.custom_notification row in events table.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 15, 2026 07:48
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 this Clojure Copilot SDK with upstream Copilot CLI 1.0.48 GA by bumping schemas/codegen and porting the corresponding SDK-surfaced features (remote-session config, remote-enable mode opts, and the custom notification event), plus tests/docs.

Changes:

  • Bumped .copilot-schema-version to 1.0.48 and refreshed schemas + regenerated wire event specs.
  • Added/ported support for :remote-session session config and session/remote-enable {:mode ...} opts, with spec + integration test coverage.
  • Added :copilot/session.custom_notification support, including protocol-level key preservation for :subject/:payload, plus tests and API docs.
Show a summary per file
File Description
test/github/copilot_sdk/integration_test.clj Adds end-to-end tests for session.custom_notification key preservation, :remote-session forwarding/spec rejection, and new event fields.
test/github/copilot_sdk/codegen_test.clj Extends generated-spec fixtures to cover session.custom_notification.
src/github/copilot_sdk/specs.clj Adds idiomatic specs for :remote-session, remote mode/opts, session.custom_notification data, and new event fields.
src/github/copilot_sdk/session.clj Adds 2-arity remote-enable overload supporting {:mode ...}.
src/github/copilot_sdk/protocol.clj Updates normalize-incoming to preserve :subject/:payload verbatim for session.custom_notification.
src/github/copilot_sdk/instrument.clj Updates fdef for session/remote-enable to allow optional opts.
src/github/copilot_sdk/generated/event_specs.clj Regenerated wire event specs for schema 1.0.48 additions.
src/github/copilot_sdk/client.clj Forwards :remote-session into session.create/session.resume wire params; updates create-session docstring.
src/github/copilot_sdk.clj Registers :copilot/session.custom_notification in public event sets.
schemas/session-events.schema.json Updated upstream schema snapshot (custom notification event, new fields, etc.).
schemas/api.schema.json Updated upstream API schema snapshot for CLI 1.0.48.
schemas/README.md Updates pinned schema version note to 1.0.48.
doc/reference/API.md Documents :remote-session, remote-enable opts, and session.custom_notification event.
CHANGELOG.md Adds Unreleased entries describing the sync and new surfaced features.
.copilot-schema-version Bumps pinned schema version to 1.0.48.

Copilot's findings

  • Files reviewed: 14/15 changed files
  • Comments generated: 1

Comment thread CHANGELOG.md Outdated
Copilot Code Review round 1: the CHANGELOG entry said the schema was
'previously pinned at 1.0.48-1' but main had 1.0.46 at the point this
PR branched. Fix to reflect 1.0.46 → 1.0.48.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

Copilot's findings

  • Files reviewed: 14/15 changed files
  • Comments generated: 3

Comment thread doc/reference/API.md Outdated
Comment thread src/github/copilot_sdk/protocol.clj Outdated
Comment thread src/github/copilot_sdk/session.clj
Three findings, all valid:

1. CHANGELOG already-fixed in 6ff9421 (round 1).

2. doc/reference/API.md said custom_notification fields :subject and
   :version were `:subject?`/`:version?`. The actual keys do not
   carry a `?` suffix (subject is a map, version is a positive int —
   neither is a boolean, and camel-snake-kebab doesn't append `?`).
   Fix the row to use the actual keys and call out that they are
   optional in prose.

3. protocol/normalize-incoming only preserved opaque event fields
   (subject/payload for custom_notification; arguments for
   external_tool.requested) on live session.event notifications.
   Historical events returned by session.getMessages flow through the
   same function as response messages (no :method, id present) and
   fell into the :else branch, so their opaque keys were kebab-cased.
   Refactor the preservation logic into preserve-event-opaque-fields
   and apply it to both live notifications and response :result
   :events collections, so live and historical events have the same
   shape. New test covers both new (custom_notification) and existing
   (external_tool.requested) event preservation through the response
   path.

4. session/remote-enable 2-arity did not validate the :mode opt
   before sending — outside spec instrumentation, {:mode :bogus}
   would forward as wire data. Validate opts against
   ::remote-enable-opts at the API boundary and throw on bad shape,
   matching the synchronous rejection create-session does for
   :remote-session.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

Copilot's findings

  • Files reviewed: 14/15 changed files
  • Comments generated: 0 new

@krukow krukow merged commit d1e7b98 into main May 15, 2026
3 checks passed
@krukow krukow deleted the upstream-sync/v1.0.48 branch May 15, 2026 09:25
krukow added a commit that referenced this pull request May 16, 2026
Bumps version marker from 1.0.0-beta.3.0 to 1.0.0-beta.4.0.

Upstream v1.0.0-beta.4 (2026-05-13) shipped no new Node.js SDK API
surface relative to v1.0.0-beta.3. Every SDK-visible change in the
upstream diff was already brought in by the earlier CLI 1.0.48 schema
sync (PR #103):

  - ModelBilling.multiplier optional
  - extension-management / extension-permission-access permission kinds
  - StartData.detachedFromSpawningParentSessionId
  - AssistantMessageData.{anthropicAdvisorBlocks,anthropicAdvisorModel,model}
  - Model.modelPickerCategory / modelPickerPriceCategory
  - session.commands.respondToQueuedCommand (exposed as

Out-of-scope per the API-parity rule (Node.js public surface unchanged):
session.tasks.sendMessage and Go/C# specific changes.

Files changed:
  - build.clj, README.md: version bump
  - CHANGELOG.md: rename Unreleased sub-headings to
    '(v1.0.0-beta.4 sync)' and add a top-of-section note recording that
    beta.4's nodejs/src diff was pre-covered by the CLI 1.0.48 schema
    sync.

Validation: bb ci (254 tests, 1197 assertions, 0 failures), bb validate-docs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
krukow added a commit that referenced this pull request May 18, 2026
Add optional :agent-model to entries in :custom-agents. When set, the
runtime tries to use that model for the agent, falling back to the
parent session model if unavailable.

Wire conversion goes through util/clj->wire automatically: :agent-model
becomes :agentModel on the wire, sent on both session.create and
session.resume custom-agents entries — consistent with the existing
:agent-name / :agent-display-name / :agent-skills convention.

Upstream parity: matches the new model?: string field added to
CustomAgentConfig in nodejs/src/types.ts (upstream commit d0eb531e,
PR #1309). No other upstream changes since v1.0.0-beta.4 require porting:

- #1295 (remote_session) was already shipped in CLI 1.0.48 sync (PR #103)
- E2E test stabilization commits affect upstream test fixtures only
- CLI version bumps (1.0.49-*) are prerelease; we stay pinned to 1.0.48

Tests: 3 new integration tests (spec validation, wire payload on
session.create/resume, omission when not set). Full suite: 257 tests,
1203 assertions, 0 failures. bb ci:full passes.

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