Skip to content

Commit c03bd96

Browse files
krukowCopilot
andcommitted
fix: tighten workspace_file_changed operation spec and fix doc escaping
Address PR review feedback: - Constrain workspace_file_changed operation to only accept "create"|"update" (not "delete") using s/and, while keeping the correct :operation wire key name - Remove backslash-escaped pipes in API.md table backtick content (GFM renders them literally) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 4fcdb26 commit c03bd96

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

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: `{:operation "create"\|"update"\|"delete"}` |
866-
| `:copilot/session.workspace_file_changed` | Workspace file created or updated; data: `{:path "...", :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: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,9 +454,10 @@
454454
(s/keys :req-un [::operation]))
455455

456456
;; Session workspace file changed event
457-
;; ::path already defined above; ::operation reused (superset covers both events)
457+
;; ::path already defined above; ::operation reused but constrained to create/update
458458
(s/def ::session.workspace_file_changed-data
459-
(s/keys :req-un [::path ::operation]))
459+
(s/and (s/keys :req-un [::path ::operation])
460+
#(contains? #{"create" "update"} (:operation %))))
460461

461462
;; Session task complete event
462463
(s/def ::session.task_complete-data

0 commit comments

Comments
 (0)