feat: sync SDK through CLI schema 1.0.73 - #160
Merged
Merged
Conversation
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
Contributor
There was a problem hiding this comment.
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-stoplifecycle 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
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
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
Contributor
There was a problem hiding this comment.
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-sdkwithout.git,ssh://.../copilot-sdkwithout.git, or HTTPS remotes with a trailing/). This can cause the skill to fail even when the checkout is the correctgithub/copilot-sdkrepo.
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
marked this pull request as ready for review
July 29, 2026 11:48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-assignmentsuses the official SDK's strict PascalCase string-keyed shape; string keys pass through wire conversion unchanged.hooks.invokereturns the canonicalHookInvokeResponseenvelope, including nested opaque MCP metadata and RPC errors for unknown sessions.abort.reasonand open strings such asassistant.turn_retry.reasonwithout weakening event validation.assistant.turn_retryandmodel.call_startremain generated internal events, andtool_search.activatedintentionally remains outside the semantic category subsets.COPILOT_SDK_UPSTREAMsupports nonstandard layouts.factory.*RPCs remain unexposed because the official Node.js SDK does not expose them.