Skip to content

Commit a96b59e

Browse files
authored
Merge pull request #34 from copilot-community-sdk/upstream-sync/2026-02-27-94f6be4d64868188
[upstream-sync] Port upstream: match release v0.1.28
2 parents 6f6b0fe + c03bd96 commit a96b59e

4 files changed

Lines changed: 54 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,15 @@ All notable changes to this project will be documented in this file. This change
1313
- `:custom-tool` permission kind — `::permission-kind` spec now includes `:custom-tool`, matching the upstream `PermissionRequest.kind` union type. Permission handlers will receive `{:permission-kind :custom-tool ...}` for SDK-registered custom tool invocations (upstream PR #555).
1414

1515
### Added (upstream PR #544 sync)
16-
- `:copilot/session.task_complete` event type added to `::event-type` spec (from upstream generated session event types).
16+
- `:copilot/session.task_complete` event type added to `::event-type` spec and `event-types` var. Previously it was in the spec but missing from the public `event-types` set (upstream PR #544).
17+
- `:copilot/assistant.streaming_delta` new event type: emitted when the total response size changes during streaming. Data: `{:total-response-size-bytes N}`. Added to `::event-type` spec, `event-types` var, and `assistant-events` var (upstream PR #544).
18+
- `:copilot/session.mode_changed` event type: emitted when the session agent mode changes. Data: `{:previous-mode "...", :new-mode "..."}`. Added to `::event-type` spec, `event-types` var, and `session-events` var.
19+
- `:copilot/session.plan_changed` event type: emitted when the session plan changes. Data: `{:operation "create"|"update"|"delete"}`. Added to `::event-type` spec, `event-types` var, and `session-events` var.
20+
- `:copilot/session.workspace_file_changed` event type: emitted when a workspace file is created or updated. Data: `{:path "...", :operation "create"|"update"}`. Added to `::event-type` spec, `event-types` var, and `session-events` var.
21+
- Data specs for new events: `::session.mode_changed-data`, `::session.plan_changed-data`, `::session.workspace_file_changed-data`, `::session.task_complete-data`, `::assistant.streaming_delta-data`.
22+
23+
### Changed (upstream PR #544 sync)
24+
- `::assistant.message_delta-data` spec: removed `::total-response-size-bytes` from optional keys. The response size is now delivered via the separate `assistant.streaming_delta` event (upstream PR #544).
1725

1826
### Added (documentation)
1927
- Microsoft Foundry Local BYOK provider guide in `doc/auth/byok.md`: quick start example, installation instructions, and connection troubleshooting (upstream PR #461).

doc/reference/API.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -861,6 +861,10 @@ copilot/tool-events
861861
| `:copilot/session.snapshot_rewind` | Session state rolled back |
862862
| `:copilot/session.compaction_start` | Context compaction started (infinite sessions) |
863863
| `:copilot/session.compaction_complete` | Context compaction completed (infinite sessions) |
864+
| `:copilot/session.mode_changed` | Session agent mode changed; data: `{:previous-mode "...", :new-mode "..."}` |
865+
| `:copilot/session.plan_changed` | Session plan created/updated/deleted; data: `{:operation "create"/"update"/"delete"}` |
866+
| `:copilot/session.workspace_file_changed` | Workspace file created or updated; data: `{:path "...", :operation "create"/"update"}` |
867+
| `:copilot/session.task_complete` | Task completed by the session agent; data: `{:summary "..."}` (optional) |
864868
| `:copilot/skill.invoked` | Skill invocation triggered |
865869
| `:copilot/user.message` | User message added |
866870
| `:copilot/pending_messages.modified` | Pending message queue updated |
@@ -870,6 +874,7 @@ copilot/tool-events
870874
| `:copilot/assistant.reasoning_delta` | Streaming reasoning chunk |
871875
| `:copilot/assistant.message` | Complete assistant response |
872876
| `:copilot/assistant.message_delta` | Streaming response chunk |
877+
| `:copilot/assistant.streaming_delta` | Response size update during streaming; data: `{:total-response-size-bytes N}` |
873878
| `:copilot/assistant.turn_end` | Assistant turn completed |
874879
| `:copilot/assistant.usage` | Token usage for this turn |
875880
| `:copilot/abort` | Current message aborted |
@@ -885,7 +890,6 @@ copilot/tool-events
885890
| `:copilot/hook.start` | Hook invocation started |
886891
| `:copilot/hook.end` | Hook invocation finished |
887892
| `:copilot/system.message` | System message emitted |
888-
| `:copilot/session.task_complete` | Task completed by the session agent |
889893

890894
### Example: Handling Events
891895

src/github/copilot_sdk.clj

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@
4747
:copilot/session.context_changed
4848
:copilot/session.title_changed
4949
:copilot/session.warning
50+
:copilot/session.mode_changed
51+
:copilot/session.plan_changed
52+
:copilot/session.workspace_file_changed
53+
:copilot/session.task_complete
5054
:copilot/user.message
5155
:copilot/pending_messages.modified
5256
:copilot/assistant.turn_start
@@ -55,6 +59,7 @@
5559
:copilot/assistant.reasoning_delta
5660
:copilot/assistant.message
5761
:copilot/assistant.message_delta
62+
:copilot/assistant.streaming_delta
5863
:copilot/assistant.turn_end
5964
:copilot/assistant.usage
6065
:copilot/abort
@@ -89,7 +94,11 @@
8994
:copilot/session.shutdown
9095
:copilot/session.context_changed
9196
:copilot/session.title_changed
92-
:copilot/session.warning})
97+
:copilot/session.warning
98+
:copilot/session.mode_changed
99+
:copilot/session.plan_changed
100+
:copilot/session.workspace_file_changed
101+
:copilot/session.task_complete})
93102

94103
(def assistant-events
95104
"Assistant response events."
@@ -99,6 +108,7 @@
99108
:copilot/assistant.reasoning_delta
100109
:copilot/assistant.message
101110
:copilot/assistant.message_delta
111+
:copilot/assistant.streaming_delta
102112
:copilot/assistant.turn_end
103113
:copilot/assistant.usage})
104114

src/github/copilot_sdk/specs.clj

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,10 +356,11 @@
356356
:copilot/session.compaction_start :copilot/session.compaction_complete
357357
:copilot/session.shutdown :copilot/session.task_complete
358358
:copilot/session.title_changed :copilot/session.warning :copilot/session.context_changed
359+
:copilot/session.mode_changed :copilot/session.plan_changed :copilot/session.workspace_file_changed
359360
:copilot/user.message :copilot/pending_messages.modified
360361
:copilot/assistant.turn_start :copilot/assistant.intent :copilot/assistant.reasoning
361362
:copilot/assistant.reasoning_delta :copilot/assistant.message :copilot/assistant.message_delta
362-
:copilot/assistant.turn_end :copilot/assistant.usage
363+
:copilot/assistant.streaming_delta :copilot/assistant.turn_end :copilot/assistant.usage
363364
:copilot/abort
364365
:copilot/tool.user_requested :copilot/tool.execution_start :copilot/tool.execution_partial_result
365366
:copilot/tool.execution_progress :copilot/tool.execution_complete
@@ -389,9 +390,14 @@
389390
(s/keys :req-un [::message-id ::content]
390391
:opt-un [::tool-requests ::parent-tool-call-id]))
391392

393+
(s/def ::total-response-size-bytes nat-int?)
394+
392395
(s/def ::assistant.message_delta-data
393396
(s/keys :req-un [::message-id ::delta-content]
394-
:opt-un [::total-response-size-bytes ::parent-tool-call-id]))
397+
:opt-un [::parent-tool-call-id]))
398+
399+
(s/def ::assistant.streaming_delta-data
400+
(s/keys :req-un [::total-response-size-bytes]))
395401

396402
(s/def ::tool.execution_start-data
397403
(s/keys :req-un [::tool-call-id ::tool-name]
@@ -436,6 +442,27 @@
436442
(s/keys :req-un [::cwd]
437443
:opt-un [::git-root ::repository ::branch]))
438444

445+
;; Session mode changed event
446+
(s/def ::previous-mode string?)
447+
(s/def ::new-mode string?)
448+
(s/def ::session.mode_changed-data
449+
(s/keys :req-un [::previous-mode ::new-mode]))
450+
451+
;; Session plan changed event
452+
(s/def ::operation #{"create" "update" "delete"})
453+
(s/def ::session.plan_changed-data
454+
(s/keys :req-un [::operation]))
455+
456+
;; Session workspace file changed event
457+
;; ::path already defined above; ::operation reused but constrained to create/update
458+
(s/def ::session.workspace_file_changed-data
459+
(s/and (s/keys :req-un [::path ::operation])
460+
#(contains? #{"create" "update"} (:operation %))))
461+
462+
;; Session task complete event
463+
(s/def ::session.task_complete-data
464+
(s/keys :opt-un [::summary]))
465+
439466
;; Skill invoked event
440467
(s/def ::allowed-tools (s/coll-of string?))
441468

0 commit comments

Comments
 (0)