GitHub Copilot SDK for Java 1.0.5
Pre-releaseInstallation
vMaj.Min.Micro. For example v0.1.32. The corresponding maven version for the release will be Maj.Min.Micro-java.N, where Maj, Min and Micro are the corresponding numbers for the reference implementation release, and N is a monotonically increasing sequence number starting with 0 for each release. See the corresponding architectural decision record for more information in the docs/adr directory of the source code.
📦 [View on Maven Central]((central.sonatype.com/redacted)
📖 [Documentation]((github.github.io/redacted) · [Javadoc]((github.github.io/redacted)
Maven
<dependency>
<groupId>com.github</groupId>
<artifactId>copilot-sdk-java</artifactId>
<version>1.0.5</version>
</dependency>Gradle (Kotlin DSL)
implementation("com.github:copilot-sdk-java:1.0.5")Gradle (Groovy DSL)
implementation 'com.github:copilot-sdk-java:1.0.5'Feature: annotation-based tool API (@CopilotTool)
The Java SDK now includes a high-level, annotation-driven tool API. Annotate methods with @CopilotTool and parameters with @CopilotToolParam to define tools — a JSR-269 annotation processor generates metadata at compile time with no runtime reflection. Use ToolDefinition.fromObject() to register tools with minimal boilerplate. (#1792)
public class WeatherTools {
`@CopilotTool`("Get the current weather for a given city")
public String getWeather(
`@CopilotToolParam`(value = "The city to get weather for", required = true) String city,
`@CopilotToolParam`(value = "Temperature unit: celsius or fahrenheit", defaultValue = "celsius") String unit) {
// implementation
}
}
List<ToolDefinition> tools = ToolDefinition.fromObject(new WeatherTools());
SessionConfig config = new SessionConfig().setTools(tools);Feature: ToolInvocation injection in @CopilotTool methods
@CopilotTool methods can now declare a ToolInvocation parameter to receive runtime context such as the session ID, without it appearing in the LLM-visible JSON schema. The annotation processor injects it automatically. (#1832)
`@CopilotTool`("Reports progress for the current tool call")
public String reportProgress(
`@CopilotToolParam`("Current phase") String phase,
ToolInvocation invocation) {
return "phase=" + phase + ", session=" + invocation.getSessionId();
}Feature: MCP OAuth host token handlers
Applications can now register a callback to service MCP OAuth token requests, enabling SDK-managed authentication flows when connecting to OAuth-protected MCP servers. (#1669)
Other changes
- improvement:
@Paramannotation renamed to@CopilotToolParamto free the name for an upcoming tool-as-lambda API variant (#1838) - improvement: BYOK bearer-token callback field renamed from
getBearerTokentobearerTokenProvider;sessionIdis now surfaced in the callback args for per-session token scoping (#1796)
New contributors
@pallaviraiturkar0made their first contribution in #1823@rojimade their first contribution in #1827
Generated by Release Changelog Generator · sonnet46 1.2M