Installation
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.4</version>
</dependency>Gradle (Kotlin DSL)
implementation("com.github:copilot-sdk-java:1.0.4")Gradle (Groovy DSL)
implementation 'com.github:copilot-sdk-java:1.0.4'Feature: HTTP request callback support
Register a CopilotRequestHandler on the client to intercept every outbound LLM inference HTTP or WebSocket request — for both BYOK and CAPI — and mutate, replace, or fully forward it. Useful for logging, header injection, model substitution, or custom routing. (#1689, #1775, #1784)
final class MyHandler extends CopilotRequestHandler {
`@Override`
protected HttpResponse<InputStream> sendRequest(HttpRequest request, CopilotRequestContext ctx) throws Exception {
HttpRequest mutated = HttpRequest.newBuilder(request, (n, v) -> true)
.header("X-Debug-Session", ctx.sessionId() == null ? "none" : ctx.sessionId())
.build();
return super.sendRequest(mutated, ctx);
}
}
CopilotClient client = new CopilotClient(
new CopilotClientOptions().setRequestHandler(new MyHandler()));Feature: getBearerToken callback for BYOK providers (Managed Identity)
BYOK provider configs now accept a getBearerToken callback so the SDK consumer can resolve bearer tokens (e.g. Azure Managed Identity) on demand. The SDK takes zero Azure SDK dependency — the consumer supplies the callback using any identity library. (#1748)
var provider = new ProviderConfig()
.setType("openai")
.setBaseUrl(baseUrl)
.setGetBearerToken(args -> cred.getToken(ctx).map(AccessToken::getToken).toFuture());Feature: experimental multi-provider BYOK registry
Register multiple named providers and models on a single session via NamedProviderConfig and ProviderModelConfig. Custom agents can reference provider-qualified model IDs such as "alpha/sonnet". This feature is experimental. (#1718)
Feature: preamble system message section and preserve action
Two new customization options for system message sections. SystemMessageSections.PREAMBLE targets only the identity preamble without affecting its sibling sub-sections (identity and tool_instructions are now documented as section groups). The new preserve action protects an individually-addressable section from a group-level remove. (#1713)
Other changes
- feature: add optional
memoryconfiguration (MemoryConfiguration) to session create and resume (#1617) - feature:
deferparameter on tool definitions controls eager vs. lazy tool loading ("auto"or"never") (#1632) - feature:
otlpProtocoltelemetry option for configuring OTLP export transport ("http/json"or"http/protobuf") (#1648) - feature:
ModelBilling.tokenPricessurfaced on public SDK types, exposing per-tier pricing and context window limits (#1633) - feature:
CapiSessionOptions.enableWebSocketResponsesandProviderConfig.transportfor WebSocket transport control on session create/resume (#1711) - improvement: call
runtime.shutdownduring client stop for deterministic OTEL telemetry flush before process cleanup (#1667) - improvement: rename
SystemPromptSections→SystemMessageSectionsfor cross-SDK consistency; old class deprecated withforRemoval=true(#1683)
New contributors
@almaleksiamade their first contribution in #1632@dereklegenzoffmade their first contribution in #1711@ellismgmade their first contribution in #1750
Generated by Release Changelog Generator · sonnet46 2M