Skip to content
Closed
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
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
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]
### Changed (v0.2.0 sync)
- **`COPILOT_CLI_PATH` env var support** — when `:cli-path` is not explicitly provided to `client`, the
SDK now checks the `COPILOT_CLI_PATH` environment variable (from the user-supplied `:env` map first,
then the process environment). This aligns with the Node.js SDK behavior. Explicit `:cli-path` takes
precedence; falls back to `"copilot"` from PATH when the env var is not set (upstream PR #925).
- **New `session.custom_agents_updated` event type** — added to `::event-type` spec. Emitted when custom
agents are loaded or reloaded; data includes `agents`, `warnings`, and `errors` fields (upstream PR #916).
- **Extended sub-agent event data** — `subagent.completed` and `subagent.failed` events now carry optional
fields `model`, `total-tool-calls`, `total-tokens`, and `duration-ms`. `skill.completed` events now
carry an optional `description` field. These are passed through as-is in event data maps (upstream PR #916).

## [0.2.0.0] - 2026-03-23
### Added (v0.2.0 sync)
Expand Down
9 changes: 8 additions & 1 deletion src/github/copilot_sdk/client.clj
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
"Create a new CopilotClient.

Options:
- :cli-path - Path to CLI executable (default: \"copilot\")
- :cli-path - Path to CLI executable (default: COPILOT_CLI_PATH env var, or \"copilot\" from PATH)
- :cli-args - Extra arguments for CLI
- :cli-url - URL of existing server (e.g., \"localhost:8080\")
- :cwd - Working directory for CLI process
Expand Down Expand Up @@ -183,6 +183,13 @@
opts-with-defaults (cond-> opts
(and (:github-token opts) (nil? (:use-logged-in-user? opts)))
(assoc :use-logged-in-user? false))
;; Resolve COPILOT_CLI_PATH: check user :env map first, then system env.
;; Applied only when :cli-path is not explicitly set and :cli-url is not set.
env-cli-path (when (and (nil? (:cli-path opts)) (nil? (:cli-url opts)))
(or (get (:env opts) "COPILOT_CLI_PATH")
(System/getenv "COPILOT_CLI_PATH")))
opts-with-defaults (cond-> opts-with-defaults
env-cli-path (assoc :cli-path env-cli-path))
merged (merge (default-options) opts-with-defaults)
child-process? (:is-child-process? opts)
cli-url? (boolean (:cli-url opts))
Expand Down
3 changes: 2 additions & 1 deletion src/github/copilot_sdk/specs.clj
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,8 @@
;; Session status events
:copilot/session.tools_updated :copilot/session.background_tasks_changed
:copilot/session.skills_loaded :copilot/session.mcp_servers_loaded
:copilot/session.mcp_server_status_changed :copilot/session.extensions_loaded})
:copilot/session.mcp_server_status_changed :copilot/session.extensions_loaded
:copilot/session.custom_agents_updated})

;; Session events
(s/def ::already-in-use? boolean?)
Expand Down