Skip to content

[upstream-sync] Port changes from copilot-sdk: COPILOT_CLI_PATH support and new session event type#68

Closed
github-actions[bot] wants to merge 1 commit intomainfrom
upstream-sync/2026-03-25-41b8ce2c2145b58c
Closed

[upstream-sync] Port changes from copilot-sdk: COPILOT_CLI_PATH support and new session event type#68
github-actions[bot] wants to merge 1 commit intomainfrom
upstream-sync/2026-03-25-41b8ce2c2145b58c

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Summary

Ports two upstream changes from github/copilot-sdk merged on 2026-03-24/25.


Upstream PRs Ported

PR #925 — COPILOT_CLI_PATH env var support (link)

The Node.js SDK (client.ts) now consults the COPILOT_CLI_PATH environment variable when :cli-path is not explicitly provided and :cli-url is not set. Priority order:

  1. Explicit :cli-path option
  2. COPILOT_CLI_PATH from user-supplied :env map
  3. COPILOT_CLI_PATH from process environment
  4. Default "copilot" (resolved from PATH)

This matches the Node.js SDK behavior exactly. Change in client.clj.

PR #916 — New event type and extended event data (link)

Upstream updated @github/copilot to 1.0.11 and re-ran code generators, producing:

  • New event type session.custom_agents_updated — emitted when custom agents are loaded/reloaded. Data includes agents array, warnings, and errors. Added to ::event-type spec in specs.clj.
  • Extended sub-agent event datasubagent.completed and subagent.failed now carry optional model, totalToolCalls, totalTokens, and durationMs fields. These are transparently passed through as camelCase→kebab-case converted keys in event data maps.
  • Extended skill event dataskill.completed now carries an optional description field (also passed through transparently).

The new data fields don't require explicit spec changes since session event data is validated as open maps.


Changes Skipped

  • PR #919 — E2E test infrastructure fix (Node.js-specific test harness), no SDK API changes
  • PR #918 — Python-specific test fix
  • PR #905 — Go RPC API refactoring (Go-specific)
  • PR #904 — Go Session.SetModel API fix (Go-specific)
  • PR #901 — Python CopilotSession.workspace_path handling (Python-specific)

Files Changed

  • src/github/copilot_sdk/client.clj — COPILOT_CLI_PATH env var resolution
  • src/github/copilot_sdk/specs.clj — Add session.custom_agents_updated to ::event-type
  • CHANGELOG.md — Update [Unreleased] section

Testing

Note: Tests could not be run in this environment due to a Maven artifact resolution failure in the sandbox (empty local Maven cache + blocked network access to Maven Central — pre-existing environment limitation). The changes are small and targeted:

  • COPILOT_CLI_PATH logic is a simple when/cond-> conditional that only activates when :cli-path is absent and the env var is set
  • Adding a keyword to a set spec is non-breaking

Generated by Upstream Sync Agent ·

  • expires on Apr 1, 2026, 2:24 PM UTC

…ents_updated event

- Add COPILOT_CLI_PATH env var support to client creation (upstream PR #925):
  When :cli-path is not explicitly provided, the SDK now checks the
  COPILOT_CLI_PATH env var (user :env map first, then process env).
  Explicit :cli-path still takes precedence. Aligns with Node.js SDK behavior.

- Add session.custom_agents_updated event type to ::event-type spec (upstream PR #916):
  New event emitted when custom agents are loaded/reloaded, carrying
  agents array, warnings, and errors fields.

- Document extended sub-agent and skill event data fields from upstream PR #916
  (optional model, total-tool-calls, total-tokens, duration-ms on subagent events;
  description on skill.completed events -- passed through transparently in event maps).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@krukow
Copy link
Copy Markdown
Collaborator

krukow commented Mar 26, 2026

superseded by #70

@krukow krukow closed this Mar 26, 2026
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