Skip to content

Commit 4fcdb26

Browse files
krukowCopilot
andcommitted
fix: correct field names in plan_changed and workspace_file_changed specs
The specs used invented prefixed field names (plan-operation, workspace-file-path, workspace-file-operation) that don't match the upstream wire format. After the protocol layer's camelCase→kebab-case conversion, upstream sends :operation and :path — not the prefixed variants. Updated specs, docs, and changelog to match. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent ab277a3 commit 4fcdb26

3 files changed

Lines changed: 8 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ All notable changes to this project will be documented in this file. This change
1616
- `: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).
1717
- `: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).
1818
- `: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: `{:plan-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: `{:workspace-file-path "...", :workspace-file-operation "create"|"update"}`. 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.
2121
- 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`.
2222

2323
### Changed (upstream PR #544 sync)

doc/reference/API.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -862,8 +862,8 @@ copilot/tool-events
862862
| `:copilot/session.compaction_start` | Context compaction started (infinite sessions) |
863863
| `:copilot/session.compaction_complete` | Context compaction completed (infinite sessions) |
864864
| `:copilot/session.mode_changed` | Session agent mode changed; data: `{:previous-mode "...", :new-mode "..."}` |
865-
| `:copilot/session.plan_changed` | Session plan created/updated/deleted; data: `{:plan-operation "create"\|"update"\|"delete"}` |
866-
| `:copilot/session.workspace_file_changed` | Workspace file created or updated; data: `{:workspace-file-path "...", :workspace-file-operation "create"\|"update"}` |
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"}` |
867867
| `:copilot/session.task_complete` | Task completed by the session agent; data: `{:summary "..."}` (optional) |
868868
| `:copilot/skill.invoked` | Skill invocation triggered |
869869
| `:copilot/user.message` | User message added |

src/github/copilot_sdk/specs.clj

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -449,15 +449,14 @@
449449
(s/keys :req-un [::previous-mode ::new-mode]))
450450

451451
;; Session plan changed event
452-
(s/def ::plan-operation #{"create" "update" "delete"})
452+
(s/def ::operation #{"create" "update" "delete"})
453453
(s/def ::session.plan_changed-data
454-
(s/keys :req-un [::plan-operation]))
454+
(s/keys :req-un [::operation]))
455455

456456
;; Session workspace file changed event
457-
(s/def ::workspace-file-path string?)
458-
(s/def ::workspace-file-operation #{"create" "update"})
457+
;; ::path already defined above; ::operation reused (superset covers both events)
459458
(s/def ::session.workspace_file_changed-data
460-
(s/keys :req-un [::workspace-file-path ::workspace-file-operation]))
459+
(s/keys :req-un [::path ::operation]))
461460

462461
;; Session task complete event
463462
(s/def ::session.task_complete-data

0 commit comments

Comments
 (0)