[upstream-sync] Port 28 upstream commits from github/copilot-sdk (f0909a7→b9f746a)#157
Merged
brunoborges merged 7 commits intomainfrom Mar 3, 2026
Merged
Conversation
…paction APIs Co-authored-by: brunoborges <129743+brunoborges@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Sync 28 new commits from upstream repository
[upstream-sync] Port 28 upstream commits from github/copilot-sdk (f0909a7→b9f746a)
Mar 2, 2026
Member
|
@edburns can you please review? |
Co-authored-by: brunoborges <129743+brunoborges@users.noreply.github.com>
edburns
approved these changes
Mar 3, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…-actions-workflow Fix CompactionTest timeout caused by prompt mismatch with snapshot
Contributor
There was a problem hiding this comment.
Pull request overview
Ports 28 upstream commits from github/copilot-sdk into the Java SDK, including a breaking permission-handler requirement, new session APIs (agent selection + compaction), and expanded event surface area.
Changes:
- Breaking: require
onPermissionRequestforcreateSession(SessionConfig)andresumeSession(String, ResumeSessionConfig); remove no-arg overloads and update E2E tests accordingly. - Add agent selection + session compaction APIs (
listAgents/getCurrentAgent/selectAgent/deselectAgent/compact) and newAgentInfoJSON type. - Add new event types and extend existing event payloads (e.g.,
interactionId,copilotUsage, streaming delta metrics), plus update docs/changelog.
Reviewed changes
Copilot reviewed 31 out of 31 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/test/java/com/github/copilot/sdk/ToolsTest.java | Updates sessions to provide permission handler; adds E2E tests for custom-tool permission approval/denial flow. |
| src/test/java/com/github/copilot/sdk/SkillsTest.java | Adds PermissionHandler.APPROVE_ALL to skill E2E tests to satisfy new session contract. |
| src/test/java/com/github/copilot/sdk/SessionEventsE2ETest.java | Updates E2E session creation to include required permission handler. |
| src/test/java/com/github/copilot/sdk/SessionEventParserTest.java | Adjusts parser assertions for AssistantMessageDeltaEvent after field move. |
| src/test/java/com/github/copilot/sdk/SessionEventHandlingTest.java | Updates test helper construction for new AssistantMessageEvent data shape. |
| src/test/java/com/github/copilot/sdk/PermissionsTest.java | Renames tests/snapshots to match new permission-handler contract and explicit-deny behavior. |
| src/test/java/com/github/copilot/sdk/McpAndAgentsTest.java | Updates MCP/custom-agent E2E tests to pass required permission handler on create/resume. |
| src/test/java/com/github/copilot/sdk/ErrorHandlingTest.java | Ensures tool error-handling E2E tests set a permission handler. |
| src/test/java/com/github/copilot/sdk/E2ETestContext.java | Updates Javadoc example to show required permission handler usage. |
| src/test/java/com/github/copilot/sdk/CopilotSessionTest.java | Updates many E2E session create/resume sites to provide permission handler; adjusts resume calls to new overload. |
| src/test/java/com/github/copilot/sdk/CopilotClientTest.java | Updates client tests to create sessions with required permission handler. |
| src/test/java/com/github/copilot/sdk/CompactionTest.java | Ensures compaction tests create sessions with a permission handler; adjusts prompt text. |
| src/test/java/com/github/copilot/sdk/ClosedSessionGuardTest.java | Updates session creation to provide required permission handler. |
| src/test/java/com/github/copilot/sdk/AskUserTest.java | Adds permission handler to ask-user tool tests to satisfy session creation contract. |
| src/site/markdown/documentation.md | Documents additional event types (session.task_complete, assistant.streaming_delta, subagent.deselected). |
| src/main/java/com/github/copilot/sdk/json/AgentInfo.java | Adds new JSON DTO for custom agent metadata. |
| src/main/java/com/github/copilot/sdk/events/ToolExecutionCompleteEvent.java | Adds model and interactionId to tool execution completion payload. |
| src/main/java/com/github/copilot/sdk/events/SubagentDeselectedEvent.java | Adds new subagent.deselected event type. |
| src/main/java/com/github/copilot/sdk/events/SkillInvokedEvent.java | Adds pluginName and pluginVersion to skill invocation payload. |
| src/main/java/com/github/copilot/sdk/events/SessionTaskCompleteEvent.java | Adds new session.task_complete event type with summary. |
| src/main/java/com/github/copilot/sdk/events/SessionEventParser.java | Registers new event type mappings for parser dispatch. |
| src/main/java/com/github/copilot/sdk/events/AssistantUsageEvent.java | Adds copilotUsage (token details + nano-AIU totals) to usage payload. |
| src/main/java/com/github/copilot/sdk/events/AssistantTurnStartEvent.java | Adds interactionId to assistant turn start payload. |
| src/main/java/com/github/copilot/sdk/events/AssistantStreamingDeltaEvent.java | Adds new streaming progress event carrying totalResponseSizeBytes. |
| src/main/java/com/github/copilot/sdk/events/AssistantMessageEvent.java | Adds interactionId to assistant message payload. |
| src/main/java/com/github/copilot/sdk/events/AssistantMessageDeltaEvent.java | Removes totalResponseSizeBytes from message delta payload. |
| src/main/java/com/github/copilot/sdk/events/AbstractSessionEvent.java | Extends sealed permits list to include newly added event types. |
| src/main/java/com/github/copilot/sdk/CopilotSession.java | Adds agent selection APIs and compact(); adds internal response DTOs for agent RPCs. |
| src/main/java/com/github/copilot/sdk/CopilotClient.java | Enforces required permission handler for create/resume; removes no-arg overloads; updates Javadoc/examples. |
| CHANGELOG.md | Updates Unreleased notes for upstream sync b9f746a and documents breaking + new APIs/events. |
| .lastmerge | Bumps tracked upstream commit to b9f746ab1b9c5f31af03a6f8a6cf4e680b3fd6b8. |
…see refs Co-authored-by: brunoborges <129743+brunoborges@users.noreply.github.com>
Contributor
Author
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
brunoborges
approved these changes
Mar 3, 2026
edburns
approved these changes
Mar 3, 2026
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.
279f6c4: Require permission handler oncreateSession/resumeSession; no-arg overloads removedPermissionHandler.APPROVE_ALL279f6c4: Rename/update permission tests9d998fb: Add agent selection APIs (listAgents,getCurrentAgent,selectAgent,deselectAgent) andcompact()AgentInfoJSON typeSessionTaskCompleteEvent,AssistantStreamingDeltaEvent,SubagentDeselectedEventAbstractSessionEventandSessionEventParserfor new typesinteractionId,model,copilotUsage,pluginName/pluginVersion)388f2f3: Add E2E tests for custom tool permission flowsToolsTest.testInvokesCustomToolWithPermissionHandler: usePermissionHandler.APPROVE_ALL.handle()instead of hard-coded"approved"kind; fix JavadocCopilotClient.java: update@seeJavadoc references from removedresumeSession(String)toresumeSession(String, ResumeSessionConfig)SessionEventParserTestcoverage for all new/updated event fields:AssistantStreamingDeltaEvent,interactionIdonAssistantMessageEvent/AssistantTurnStartEvent/ToolExecutionCompleteEvent,copilotUsageonAssistantUsageEvent,modelonToolExecutionCompleteEvent.lastmergetob9f746ab1b9c5f31af03a6f8a6cf4e680b3fd6b8Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.