Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ All notable changes to this project will be documented in this file. This change

## [Unreleased]

### Added (v0.1.33 sync)
- New event data fields from upstream codegen update (upstream PR #796):
- `session.start` event: `:reasoning-effort`, `:already-in-use?`, `:host-type`, `:head-commit`, `:base-commit` optional fields now in spec
- `session.resume` event: new `::session.resume-data` spec with `:event-count`, `:selected-model`, `:reasoning-effort`, `:already-in-use?`, `:host-type`, `:head-commit`, `:base-commit`
- `session.model_change` event: new `::session.model_change-data` spec with `:new-model`, `:previous-model`, `:reasoning-effort`, `:previous-reasoning-effort`
- `user.message` event: new `:blob` attachment type with `:data` (base64), `:mime-type`, optional `:display-name`

## [0.1.32.0] - 2026-03-12
### Added (upstream sync)
- Session pre-registration: sessions are now created and registered in client state **before** the RPC call, preventing early events (e.g. `session.start`) from being dropped. Session IDs are generated client-side via `java.util.UUID/randomUUID` when not explicitly provided. On RPC failure, sessions are automatically cleaned up (upstream PR #664).
Expand Down
35 changes: 32 additions & 3 deletions src/github/copilot_sdk/specs.clj
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@
;; -----------------------------------------------------------------------------

(s/def ::prompt ::non-blank-string)
(s/def ::attachment-type #{:file :directory :selection :github-reference})
(s/def ::attachment-type #{:file :directory :selection :github-reference :blob})
(s/def ::type ::attachment-type)
(s/def ::path ::non-blank-string)
(s/def ::file-path ::non-blank-string)
Expand Down Expand Up @@ -305,10 +305,19 @@
#(string? (:state %))
#(string? (:url %))))

;; Blob attachment (base64-encoded inline data, received in user.message events)
(s/def ::mime-type string?)
(s/def ::blob-attachment
(s/and map?
#(= :blob (:type %))
#(string? (:data %))
#(string? (:mime-type %))))

(s/def ::attachment
(s/or :file-or-directory ::file-or-directory-attachment
:selection ::selection-attachment
:github-reference ::github-reference-attachment))
:github-reference ::github-reference-attachment
:blob ::blob-attachment))

(s/def ::attachments (s/coll-of ::attachment))
(s/def ::mode #{:enqueue :immediate})
Expand Down Expand Up @@ -414,9 +423,21 @@
:copilot/external_tool.requested})

;; Session events
(s/def ::already-in-use? boolean?)
(s/def ::host-type string?)
(s/def ::head-commit string?)
(s/def ::base-commit string?)

(s/def ::session.start-data
(s/keys :req-un [::session-id]
:opt-un [::version ::producer ::copilot-version ::start-time ::selected-model]))
:opt-un [::version ::producer ::copilot-version ::start-time ::selected-model
::reasoning-effort ::already-in-use? ::host-type ::head-commit ::base-commit]))

(s/def ::event-count nat-int?)
(s/def ::session.resume-data
(s/keys :req-un [::event-count]
:opt-un [::selected-model ::reasoning-effort ::already-in-use?
::host-type ::head-commit ::base-commit]))

(s/def ::session.error-data
(s/keys :req-un [::error-type ::message]
Expand Down Expand Up @@ -493,6 +514,14 @@
(s/keys :req-un [::cwd]
:opt-un [::git-root ::repository ::branch]))

;; Session model change event
(s/def ::previous-model (s/nilable string?))
(s/def ::new-model string?)
(s/def ::previous-reasoning-effort string?)
(s/def ::session.model_change-data
(s/keys :req-un [::new-model]
:opt-un [::previous-model ::previous-reasoning-effort ::reasoning-effort]))

;; Session mode changed event
(s/def ::previous-mode string?)
(s/def ::new-mode string?)
Expand Down