From d11255a74cd4d0a9916a77ab34b58f20462ec1af Mon Sep 17 00:00:00 2001 From: Copilot <223556219+Copilot@users.noreply.github.com> Date: Mon, 23 Mar 2026 14:17:09 +0000 Subject: [PATCH] feat: add ::session.handoff-data spec with :host field (upstream PR #900) - Add ::remote-session-id spec (string) - Add ::session.handoff-data spec documenting optional :remote-session-id and :host fields (GitHub host URL for source session) - Update API.md to document session.handoff event data fields - Update CHANGELOG.md under [Unreleased] The :host field passes through automatically from wire format since util/wire->clj translates JSON keys to Clojure keywords. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- CHANGELOG.md | 2 ++ doc/reference/API.md | 2 +- src/github/copilot_sdk/specs.clj | 5 +++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a056149..312be4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ All notable changes to this project will be documented in this file. This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/). ## [Unreleased] +### Added (v0.2.0 sync) +- **`:host` field on `session.handoff` events** — `session.handoff` event data now includes an optional `:host` field with the GitHub host URL for the source session (e.g., `"https://github.com"` or `"https://tenant.ghe.com"`). New `::session.handoff-data` spec documents the shape: `{:remote-session-id "..." :host "..."}` (both optional) (upstream PR #900). ## [0.2.0.0] - 2026-03-23 ### Added (v0.2.0 sync) diff --git a/doc/reference/API.md b/doc/reference/API.md index bc5ae16..6c0d148 100644 --- a/doc/reference/API.md +++ b/doc/reference/API.md @@ -993,7 +993,7 @@ Convert an unqualified event keyword to a namespace-qualified `:copilot/` keywor | `:copilot/session.idle` | Session finished processing | | `:copilot/session.info` | Informational session update | | `:copilot/session.model_change` | Session model changed | -| `:copilot/session.handoff` | Session handed off to another agent | +| `:copilot/session.handoff` | Session handed off to another agent; data: `{:remote-session-id "..." :host "https://github.com"}` (both optional) | | `:copilot/session.usage_info` | Token usage information | | `:copilot/session.context_changed` | Session context (cwd, repo, branch) changed | | `:copilot/session.title_changed` | Session title updated | diff --git a/src/github/copilot_sdk/specs.clj b/src/github/copilot_sdk/specs.clj index c6fdb09..de3bd33 100644 --- a/src/github/copilot_sdk/specs.clj +++ b/src/github/copilot_sdk/specs.clj @@ -540,6 +540,11 @@ (s/def ::session.idle-data map?) +(s/def ::remote-session-id string?) + +(s/def ::session.handoff-data + (s/keys :opt-un [::remote-session-id ::host])) + (s/def ::agent-mode #{:interactive :plan :autopilot :shell}) (s/def ::interaction-id string?)