[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
Closed
Conversation
…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>
Collaborator
|
superseded by #70 |
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 two upstream changes from
github/copilot-sdkmerged 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 theCOPILOT_CLI_PATHenvironment variable when:cli-pathis not explicitly provided and:cli-urlis not set. Priority order::cli-pathoptionCOPILOT_CLI_PATHfrom user-supplied:envmapCOPILOT_CLI_PATHfrom process environment"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/copilotto 1.0.11 and re-ran code generators, producing:session.custom_agents_updated— emitted when custom agents are loaded/reloaded. Data includesagentsarray,warnings, anderrors. Added to::event-typespec inspecs.clj.subagent.completedandsubagent.failednow carry optionalmodel,totalToolCalls,totalTokens, anddurationMsfields. These are transparently passed through as camelCase→kebab-case converted keys in event data maps.skill.completednow carries an optionaldescriptionfield (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
Session.SetModelAPI fix (Go-specific)CopilotSession.workspace_pathhandling (Python-specific)Files Changed
src/github/copilot_sdk/client.clj— COPILOT_CLI_PATH env var resolutionsrc/github/copilot_sdk/specs.clj— Addsession.custom_agents_updatedto::event-typeCHANGELOG.md— Update[Unreleased]sectionTesting
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_PATHlogic is a simplewhen/cond->conditional that only activates when:cli-pathis absent and the env var is set