Reference implementation sync: 41 new commits (2026-04-20)#87
Conversation
…ilitiesOverride, agent skills, per-request headers Agent-Logs-Url: https://github.com/github/copilot-sdk-java/sessions/514da8aa-3336-46ca-b39a-48faabcbb354 Co-authored-by: edburns <75821+edburns@users.noreply.github.com>
edburns
left a comment
There was a problem hiding this comment.
I am concerned that some of the new classes might better be made to come from the java.ts code generator.
Please know that all classes that can be generated from the Zod schemas, as shown in the update-copilot-dependency workflow, should be generated there, rather than hand authored.
Please double check that none of these classes in the json package are better suited for java.ts code gen.
|
@brunoborges do you want to review the first Agentic Sync since the code gen is introduced? |
There was a problem hiding this comment.
Pull request overview
Ports upstream github/copilot-sdk changes into the Java SDK, expanding session configuration and request capabilities (typed MCP servers, model capability overrides, per-turn/provider headers, and agent skill preloading) to stay API-parity with the reference implementation.
Changes:
- Add typed MCP server configuration (
McpServerConfig+ stdio/http subclasses) and update*Config/request DTOs to useMap<String, McpServerConfig>. - Add session/resume options for config discovery + sub-agent streaming event inclusion + model capability overrides, and wire them into request building.
- Add agent
skillspreloading and per-turn/provider request headers support; update/extend tests accordingly.
Show a summary per file
Copilot's findings
- Files reviewed: 19/19 changed files
- Comments generated: 2
Agent-Logs-Url: https://github.com/github/copilot-sdk-java/sessions/c48ff7e5-7e42-43e6-a3df-42fe0004aa91 Co-authored-by: edburns <75821+edburns@users.noreply.github.com>

Ports 41 new commits from the official
github/copilot-sdkreference implementation into the Java SDK, updating the API to match the latest feature set.Before the change?
SessionConfig/ResumeSessionConfighad no way to override model capabilities, control sub-agent streaming events, or enable config discoveryMcpServerstyped asMap— no type safetyCustomAgentConfighad noskillsfield for per-agent skill preloadingProviderConfighad noheadersfield;MessageOptionshad norequestHeadersfor per-turn headersCopilotSession.setModel()had no overload accepting capability overrides.lastmergepointed toc3fa6cbfb83d4a20b7912b1a17013d48f5a277a1After the change?
New types (hand-authored in
jsonpackage — not candidates forjava.tscodegen):McpServerConfig— abstract base with typed subclassesMcpStdioServerConfig(local/stdio) andMcpHttpServerConfig(remote HTTP/SSE);McpServersis nowMap. ThemcpServersfield is absent fromapi.schema.json, so these cannot be generated.ModelCapabilitiesOverride— per-property overrides for model capabilities (vision, reasoning effort, token limits). WhilemodelCapabilitiesappears inapi.schema.jsonundersession.model.switchTo.params, the codegen already generates it as the verbose inner recordSessionModelSwitchToParamsModelCapabilities. A hand-authored class is required becausesession.createandsession.resumeare not in the schema, and the codegen has no mechanism to emit standalone named types shared across hand-authored request classes.API additions on
SessionConfig/ResumeSessionConfig:setModelCapabilities(ModelCapabilitiesOverride)— deep-merged over runtime defaultssetIncludeSubAgentStreamingEvents(Boolean)— suppress/expose streaming deltas from sub-agentssetEnableConfigDiscovery(Boolean)— auto-discover MCP configs and skill dirs from working dirOther additions:
CustomAgentConfig.setSkills(List)— preload named skill content into the agent's contextProviderConfig.setHeaders(Map)— custom headers on outbound provider requests; imports reordered to placejava.*beforecom.*per codebase conventionMessageOptions.setRequestHeaders(Map)— per-turn headers on model requestsCopilotSession.setModel(String, String, ModelCapabilitiesOverride)— new overload; now correctly maps bothsupportsandlimitsfromModelCapabilitiesOverrideinto the generated params (includingInteger→Doubleconversion for limit fields), so token limit overrides are properly honored when switching modelsExample — disable vision for a session then re-enable on model switch:
Example — per-agent skills with typed MCP server:
Test updates:
McpAndAgentsTestmigrated to typedMcpStdioServerConfigAPISkillsTest— added tests for per-agent skill injection (skillsfield)setModel("fake-test-model")fromCopilotSessionTest/ClosedSessionGuardTest— the new CLI validates model availability against the/modelslist.lastmergeupdated to922959f4a7b83509c3620d4881733c6c5677f00cPull request checklist
mvn spotless:applyhas been run to format the codemvn clean verifypasses locallyDoes this introduce a breaking change?