Skip to content

[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
upstream-sync/2026-03-11-eaabbce7aff04900
Closed

[upstream-sync] Port upstream PR #787: ignore :cli-path when :cli-url is set#51
github-actions[bot] wants to merge 1 commit intomainfrom
upstream-sync/2026-03-11-eaabbce7aff04900

Conversation

@github-actions
Copy link
Contributor

Summary

Ports upstream PR #787: [nodejs] Ignore cliPath if cliUrl is set.

Upstream Change

When cliUrl is provided to CopilotClient, the Node.js SDK now silently ignores cliPath instead 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 setting cliPath = undefined when cliUrl is set, and adding a guard that throws a clear error if cliPath is needed but missing.

Clojure Adaptation

The Clojure SDK had a stricter validation: providing both :cli-url and :cli-path threw a "cli-url is mutually exclusive with cli-path" error. Upstream now accepts both — :cli-path is silently ignored when :cli-url is present.

Changes:

  • src/github/copilot_sdk/client.clj: Removed the mutual exclusion validation that threw when both :cli-url and :cli-path were provided. Updated docstring.
  • doc/reference/API.md: Updated :cli-path description to note it is ignored when :cli-url is provided.
  • test/github/copilot_sdk_test.clj: Updated test to verify providing both :cli-url and :cli-path now 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 if cliPath is nil at spawn time) is not needed in Clojure because:

  1. :cli-path always defaults to "copilot" — it can never be nil at spawn time
  2. When :cli-url is set, the CLI is never spawned (spawn-cli is skipped)

Changes Skipped

PR Reason
#780 CI workflow change (cross-repo issue analysis) — not relevant
#774 Docs fix — not relevant
#740 Docs (language-specific links) — not relevant
#726 C# [DebuggerDisplay] attribute — C#-specific
#725 C# lazy property initialization — C#-specific
#724 C# XML doc comments from schema — C#-specific
#688 .NET NuGet icon — .NET-specific

Testing

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-url is set, the spawn path is already skipped via (:external-server? client), so :cli-path was already effectively ignored — the only change is removing the early error.

Generated by Upstream Sync Agent ·

  • expires on Mar 18, 2026, 2:06 PM UTC

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant