[upstream-sync] Port upstream PR #787: ignore :cli-path when :cli-url is set#51
Closed
github-actions[bot] wants to merge 1 commit intomainfrom
Closed
[upstream-sync] Port upstream PR #787: ignore :cli-path when :cli-url is set#51github-actions[bot] wants to merge 1 commit intomainfrom
github-actions[bot] wants to merge 1 commit intomainfrom
Conversation
When :cli-url is provided, :cli-path is now silently ignored instead of throwing a mutual exclusion error. This matches the upstream Node.js SDK behavior introduced in PR #787. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ports upstream PR #787:
[nodejs] Ignore cliPath if cliUrl is set.Upstream Change
When
cliUrlis provided toCopilotClient, the Node.js SDK now silently ignorescliPathinstead of using it. Previously, the SDK would still resolve a default bundled CLI path (getBundledCliPath()) even when connecting to an external server — this caused spurious path-resolution work. PR #787 fixes this by settingcliPath = undefinedwhencliUrlis set, and adding a guard that throws a clear error ifcliPathis needed but missing.Clojure Adaptation
The Clojure SDK had a stricter validation: providing both
:cli-urland:cli-paththrew a"cli-url is mutually exclusive with cli-path"error. Upstream now accepts both —:cli-pathis silently ignored when:cli-urlis present.Changes:
src/github/copilot_sdk/client.clj: Removed the mutual exclusion validation that threw when both:cli-urland:cli-pathwere provided. Updated docstring.doc/reference/API.md: Updated:cli-pathdescription to note it is ignored when:cli-urlis provided.test/github/copilot_sdk_test.clj: Updated test to verify providing both:cli-urland:cli-pathnow succeeds (no exception), and the client is correctly marked as an external server.CHANGELOG.md: Added entry under[Unreleased].Note: The Node.js guard for missing
cliPath(throw ifcliPathis nil at spawn time) is not needed in Clojure because::cli-pathalways defaults to"copilot"— it can never be nil at spawn time:cli-urlis set, the CLI is never spawned (spawn-cliis skipped)Changes Skipped
[DebuggerDisplay]attribute — C#-specificTesting
Tests could not be run due to network firewall restrictions (Maven dependencies unavailable). The change is a targeted removal of 2 lines of validation logic plus a test update. The logic is straightforward: when
:cli-urlis set, the spawn path is already skipped via(:external-server? client), so:cli-pathwas already effectively ignored — the only change is removing the early error.