Skip to content

Merge upstream 20260204#11

Merged
brunoborges merged 15 commits intomainfrom
merge-upstream-20260204
Feb 5, 2026
Merged

Merge upstream 20260204#11
brunoborges merged 15 commits intomainfrom
merge-upstream-20260204

Conversation

@brunoborges
Copy link
Member

No description provided.

Copy link
Contributor

Copilot AI left a 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 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: SessionShutdownEvent for tracking session termination metrics and SkillInvokedEvent for 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.

- 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
@brunoborges brunoborges merged commit f4047e5 into main Feb 5, 2026
1 of 2 checks passed
@brunoborges brunoborges deleted the merge-upstream-20260204 branch February 16, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants