Skip to content

GitHub Copilot SDK for Java 1.0.5

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 30 Jun 08:57
· 228 commits to main since this release

Installation

⚠️ Artifact versioning plan: Releases of this implementation track releases of the reference implementation. For each release of the reference implementation, there may follow a corresponding release of this implementation with the same number as the reference implementation. Release identifiers of the reference implementation are in the form 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: @Param annotation renamed to @CopilotToolParam to free the name for an upcoming tool-as-lambda API variant (#1838)
  • improvement: BYOK bearer-token callback field renamed from getBearerToken to bearerTokenProvider; sessionId is now surfaced in the callback args for per-session token scoping (#1796)

New contributors

  • @pallaviraiturkar0 made their first contribution in #1823
  • @roji made their first contribution in #1827

Generated by Release Changelog Generator · sonnet46 1.2M