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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ All notable changes to this project will be documented in this file. This change

## [Unreleased]

### Changed (v0.1.32 sync)
- `:cli-path` is now silently ignored when `:cli-url` is provided, instead of throwing an error. Providing both is no longer an error — the remote CLI URL takes precedence and the local path is unused (upstream PR #787).

## [0.1.32.0] - 2026-03-10
### Added (v0.1.32 sync)
- `:agent` optional string parameter in `create-session` and `resume-session` configs — pre-selects a custom agent by name when the session starts. Must match a name in `:custom-agents`. Equivalent to calling `agent.select` after creation (upstream PR #722).
Expand Down
2 changes: 1 addition & 1 deletion doc/reference/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Explicitly shutdown the shared client. Safe to call multiple times.

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| `:cli-path` | string | `"copilot"` | Path to CLI executable |
| `:cli-path` | string | `"copilot"` | Path to CLI executable. Ignored when `:cli-url` is provided |
| `:cli-args` | vector | `[]` | Extra arguments prepended before SDK-managed flags |
| `:cli-url` | string | nil | URL of existing CLI server (e.g., `"localhost:8080"`). When provided, no CLI process is spawned |
| `:port` | number | `0` | Server port (0 = random) |
Expand Down
4 changes: 1 addition & 3 deletions src/github/copilot_sdk/client.clj
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
"Create a new CopilotClient.

Options:
- :cli-path - Path to CLI executable (default: \"copilot\")
- :cli-path - Path to CLI executable (default: \"copilot\"). Ignored when :cli-url is provided
- :cli-args - Extra arguments for CLI
- :cli-url - URL of existing server (e.g., \"localhost:8080\")
- :cwd - Working directory for CLI process
Expand All @@ -127,8 +127,6 @@
([opts]
(when (and (:cli-url opts) (= true (:use-stdio? opts)))
(throw (ex-info "cli-url is mutually exclusive with use-stdio?" opts)))
(when (and (:cli-url opts) (:cli-path opts))
(throw (ex-info "cli-url is mutually exclusive with cli-path" opts)))
;; Validation: github-token and use-logged-in-user? cannot be used with cli-url
(when (and (:cli-url opts) (or (:github-token opts) (some? (:use-logged-in-user? opts))))
(throw (ex-info "github-token and use-logged-in-user? cannot be used with cli-url (external server manages its own auth)"
Expand Down
7 changes: 4 additions & 3 deletions test/github/copilot_sdk_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@
(is (thrown? Exception
(copilot/client {:cli-url "localhost:8080" :use-stdio? true}))))

(testing "cli-url mutual exclusion with cli-path"
(is (thrown? Exception
(copilot/client {:cli-url "localhost:8080" :cli-path "/path/to/cli"}))))
(testing "cli-url with cli-path: cli-path is silently ignored"
(let [c (copilot/client {:cli-url "localhost:8080" :cli-path "/path/to/cli" :auto-start? false})]
(is (some? c))
(is (true? (:external-server? c)))))

(testing "is-child-process? mutual exclusion with cli-url"
(is (thrown-with-msg? Exception #"is-child-process\? is mutually exclusive with cli-url"
Expand Down