Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request merges upstream changes from the .NET Copilot SDK repository (dated February 4, 2026), adding new event types and lifecycle management features to the Java SDK.
Changes:
- Added new event types:
SessionShutdownEventfor tracking session termination metrics andSkillInvokedEventfor skill invocation notifications - Introduced session lifecycle event system with
onLifecycle()API for monitoring session state changes (created, deleted, updated, foreground/background) - Added foreground session control APIs (
getForegroundSessionId(),setForegroundSessionId()) for TUI+server mode integration - Extended existing event data models with additional fields for enhanced telemetry and functionality
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/com/github/copilot/sdk/events/SessionShutdownEvent.java | New event class for session shutdown with metrics (shutdown type, API usage, code changes) |
| src/main/java/com/github/copilot/sdk/events/SkillInvokedEvent.java | New event class for skill invocation notifications |
| src/main/java/com/github/copilot/sdk/events/SessionEventParser.java | Registered new event types in parser mapping |
| src/main/java/com/github/copilot/sdk/events/AbstractSessionEvent.java | Updated sealed class to permit new event types |
| src/main/java/com/github/copilot/sdk/events/SessionErrorEvent.java | Added statusCode and providerCallId fields to error data |
| src/main/java/com/github/copilot/sdk/events/SessionCompactionCompleteEvent.java | Added checkpointNumber and checkpointPath fields |
| src/main/java/com/github/copilot/sdk/events/AssistantUsageEvent.java | Added parentToolCallId field |
| src/main/java/com/github/copilot/sdk/events/AssistantMessageEvent.java | Added reasoningOpaque, reasoningText, and encryptedContent fields |
| src/main/java/com/github/copilot/sdk/json/SessionLifecycleEvent.java | New DTO for lifecycle event notifications |
| src/main/java/com/github/copilot/sdk/json/SessionLifecycleEventMetadata.java | New DTO for lifecycle event metadata |
| src/main/java/com/github/copilot/sdk/json/SessionLifecycleHandler.java | New functional interface for lifecycle event callbacks |
| src/main/java/com/github/copilot/sdk/json/SessionLifecycleEventTypes.java | Constants for lifecycle event types |
| src/main/java/com/github/copilot/sdk/json/GetForegroundSessionResponse.java | New DTO for foreground session query response |
| src/main/java/com/github/copilot/sdk/json/SetForegroundSessionResponse.java | New DTO for foreground session update response |
| src/main/java/com/github/copilot/sdk/CopilotClient.java | Implemented lifecycle event subscription APIs and foreground session control methods |
| src/test/java/com/github/copilot/sdk/SessionEventParserTest.java | Added unit tests for SessionShutdownEvent and SkillInvokedEvent parsing |
| src/test/java/com/github/copilot/sdk/ErrorHandlingTest.java | New E2E test suite for error handling scenarios (tool errors, permission handler errors) |
| src/site/markdown/advanced.md | Documented lifecycle event subscription and foreground session control features |
| .github/copilot-instructions.md | New comprehensive guide for contributors covering architecture, conventions, and testing |
| README.md | Updated minimum CLI version requirement from 0.0.401 to 0.0.402 |
| .lastmerge | Updated upstream merge tracking hash |
Comments suppressed due to low confidence (1)
src/test/java/com/github/copilot/sdk/ErrorHandlingTest.java:158
- The contents of this container are never accessed.
List<SessionErrorEvent> errorEvents = new ArrayList<>();
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…sessionStart, and sessionEnd hooks
- Remove 3 hook tests not in upstream SDK (userPromptSubmitted, sessionStart, sessionEnd) - Add testListSessions and testDeleteSession to match upstream snapshots - Update HooksTest documentation to explain scope Test coverage: 135 tests, 55 of 56 upstream E2E tests covered
…e multiple sessions
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.
No description provided.