Reference implementation sync: 41 new commits (2026-04-20)#87
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.
Good question — I investigated thoroughly. None of the four new classes are candidates for the codegen:
The hand-authored |
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<String, Object>— 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<String, McpServerConfig>. 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<String>)— preload named skill content into the agent's contextProviderConfig.setHeaders(Map<String, String>)— custom headers on outbound provider requestsMessageOptions.setRequestHeaders(Map<String, String>)— per-turn headers on model requestsCopilotSession.setModel(String, String, ModelCapabilitiesOverride)— new overloadExample — 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?