-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Use new Copilot CLI SDK #1761
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Use new Copilot CLI SDK #1761
Conversation
8fcd079 to
dff109d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR upgrades the Copilot CLI SDK from version 0.0.343 to 0.0.354-29 and adapts the codebase to work with breaking API changes in the new SDK version. The SDK has moved from an Agent-based architecture to a Session-based architecture with significant interface changes.
Key Changes:
- Updated SDK integration to use new Session-based APIs instead of Agent APIs
- Refactored permission handling to use a handler pattern instead of callbacks
- Changed model provider representations from complex objects to simple string IDs
- Replaced node-pty ESM shim with direct binary file copying approach
- Added comprehensive unit tests for CopilotCLI session management and tool formatting
Reviewed Changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
package.json & package-lock.json |
Updated @github/copilot dependency from 0.0.343 to 0.0.354-29 |
copilotcliSession.ts |
Refactored to use Session.send() instead of Agent.query(), moved to event-based SDK API with on() listeners |
copilotcliSessionService.ts |
Updated session creation/retrieval to pass SessionOptions, added auto-disposal timeout mechanism |
copilotCli.ts |
Added CopilotCLISessionOptionsService and CopilotCLIPermissionsHandler classes, simplified model provider to string |
nodePtyShim.ts |
Replaced ESM shim creation with direct binary file copying from VS Code installation |
permissionHelpers.ts |
Changed from AgentOptions to SessionOptions, added typed return types for tool parameters |
copilotcliToolInvocationFormatter.ts |
Added Edit and Create tool formatters, changed "Viewed" to "Read" for consistency |
copilotCLIChatSessionsContribution.ts |
Updated to pass workingDirectory and use new session service signatures |
chatSessions.ts |
Registered ICopilotCLISessionOptionsService in service collection |
| Test files | Added comprehensive unit tests for session lifecycle, tool formatting, and permission handling |
No description provided.