Skip to content

feat: sync SDK through CLI schema 1.0.73 - #160

Merged
krukow merged 4 commits into
mainfrom
krukow-upstream-sdk-sync
Jul 29, 2026
Merged

feat: sync SDK through CLI schema 1.0.73#160
krukow merged 4 commits into
mainfrom
krukow-upstream-sdk-sync

Conversation

@krukow

@krukow krukow commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Generated via Copilot on behalf of @krukow

Syncs the Clojure SDK with upstream Copilot SDK changes through CLI schema 1.0.73. It ports typed ExP assignments from github/copilot-sdk#2033, adds the AgentStop lifecycle hook from github/copilot-sdk#2054, refreshes generated event contracts, and makes the repo-local sync workflow portable across linked worktrees.

Implementation notes

  • :exp-assignments uses the official SDK's strict PascalCase string-keyed shape; string keys pass through wire conversion unchanged.
  • hooks.invoke returns the canonical HookInvokeResponse envelope, including nested opaque MCP metadata and RPC errors for unknown sessions.
  • Generated leaf specs remain broad where unqualified property names collide, while each event data spec reapplies its variant-local schema. This preserves both closed enums such as abort.reason and open strings such as assistant.turn_retry.reason without weakening event validation.
  • Four externally visible schema events join the curated public surface. assistant.turn_retry and model.call_start remain generated internal events, and tool_search.activated intentionally remains outside the semantic category subsets.
  • The upstream resolver derives the primary checkout from Git's common directory, so normal checkouts and linked worktrees find the same sibling clone; COPILOT_SDK_UPSTREAM supports nonstandard layouts.
  • CLI-only factory.* RPCs remain unexposed because the official Node.js SDK does not expose them.

krukow added 2 commits July 29, 2026 12:34
Port typed ExP assignments and the AgentStop hook from upstream, regenerate the schema-driven event layer, and preserve variant-local validation when generated leaf names collide.\n\nUpstream: https://github.com/github/copilot-sdk/pull/2033\nUpstream: https://github.com/github/copilot-sdk/pull/2054\n\nCo-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>\nCopilot-Session: fa7764d5-e40a-4595-b64c-a37f00011940
Document typed ExP assignments, AgentStop lifecycle handling, and the newly curated events. Refresh generated API documentation and the executable lifecycle hook example.\n\nCo-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>\nCopilot-Session: fa7764d5-e40a-4595-b64c-a37f00011940
Copilot AI review requested due to automatic review settings July 29, 2026 10:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 Copilot SDK to the upstream CLI schema 1.0.73, porting new upstream runtime contracts while keeping the curated public API/event surface aligned with the official SDK.

Changes:

  • Port typed ExP :exp-assignments (CopilotExpAssignmentResponse) with strict PascalCase, string-keyed validation and passthrough.
  • Add :on-agent-stop lifecycle hook wiring and example/docs coverage.
  • Refresh schema-pinned artifacts: regenerated event contracts/spec emission to preserve variant-local validation for same-named properties.
Show a summary per file
File Description
test/github/copilot_sdk/integration_test.clj Adds integration coverage for new schema events, typed :exp-assignments, and :on-agent-stop hook behavior.
test/github/copilot_sdk/codegen_test.clj Extends codegen fixtures and asserts variant-local type preservation (e.g., abort reason enum vs open string reasons elsewhere).
src/github/copilot_sdk/specs.clj Introduces strict ExP assignment specs, adds :on-agent-stop, and updates curated public event sets.
src/github/copilot_sdk/session.clj Wires "agentStop" hookType to :on-agent-stop.
src/github/copilot_sdk.clj Updates exported curated event sets (event-types/session-events/assistant-events) for schema 1.0.73.
script/codegen/emit_specs.clj Adjusts generator to emit variant-local strict predicates for conflicted data properties across variants.
schemas/session-events.schema.json Bumps pinned session event schema with new events and updated definitions.
schemas/README.md Updates documented pinned schema version to 1.0.73.
schemas/api.schema.json Updates pinned RPC schema, including new internal hook transport definitions and other additions.
resources/github/copilot_sdk/api_surface.edn Updates API surface snapshot to include new spec keys and hook spec.
examples/README.md Documents the additional lifecycle hook (:on-agent-stop) in the hooks example section.
examples/lifecycle_hooks.clj Demonstrates :on-agent-stop usage and recording.
doc/reference/API.md Updates session config docs for typed :exp-assignments, new events, and :on-agent-stop.
doc/api/API.html Regenerates rendered API docs to reflect reference doc changes.
CHANGELOG.md Records the upstream sync additions and the generator validation fix under Unreleased.
.copilot-schema-version Bumps pinned schema version from 1.0.71-2 to 1.0.73.

Review details

  • Files reviewed: 16/17 changed files
  • Comments generated: 1
  • Review effort level: Low

Comment thread src/github/copilot_sdk/session.clj
Return the canonical HookInvokeResponse envelope across handler, nil, error, and unknown-session paths while preserving nested opaque MCP metadata.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: fa7764d5-e40a-4595-b64c-a37f00011940
Copilot AI review requested due to automatic review settings July 29, 2026 10:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review details

  • Files reviewed: 18/19 changed files
  • Comments generated: 0 new
  • Review effort level: Low

Replace the ignored checkout-local update helper with a tracked resolver based on Git's common directory, and keep the sync workflow on the existing worktree branch.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: fa7764d5-e40a-4595-b64c-a37f00011940
Copilot AI review requested due to automatic review settings July 29, 2026 11:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review details

Comments suppressed due to low confidence (1)

.github/skills/update-upstream/scripts/resolve-upstream.sh:44

  • The origin URL whitelist in resolve-upstream.sh is overly strict and will reject common, equivalent upstream remotes (e.g., git@github.com:github/copilot-sdk without .git, ssh://.../copilot-sdk without .git, or HTTPS remotes with a trailing /). This can cause the skill to fail even when the checkout is the correct github/copilot-sdk repo.
case "${origin_url}" in
  git@github.com:github/copilot-sdk.git | \
  ssh://git@github.com/github/copilot-sdk.git | \
  https://github.com/github/copilot-sdk | \
  https://github.com/github/copilot-sdk.git)
    ;;
  *)
    echo "error: expected origin to be github/copilot-sdk, found ${origin_url}" >&2
    echo "set COPILOT_SDK_UPSTREAM to a checkout with the canonical origin remote" >&2
    exit 1
    ;;
esac
  • Files reviewed: 22/23 changed files
  • Comments generated: 0 new
  • Review effort level: Low

@krukow
krukow marked this pull request as ready for review July 29, 2026 11:48
@krukow
krukow merged commit a8b7669 into main Jul 29, 2026
3 checks passed
@krukow
krukow deleted the krukow-upstream-sdk-sync branch July 29, 2026 11:48
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