Skip to content

Commit 7a729c9

Browse files
committed
Merge branch 'main' of https://github.com/github/copilot-sdk into add-tool-search-option
2 parents ee90122 + 991f7ab commit 7a729c9

204 files changed

Lines changed: 9463 additions & 1866 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/java-publish-maven.yml

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,34 @@ on:
2222
type: boolean
2323
required: false
2424
default: false
25+
workflow_call:
26+
inputs:
27+
releaseVersion:
28+
description: "Release version (e.g., 1.0.0). If empty, derives from pom.xml by removing -SNAPSHOT"
29+
required: false
30+
type: string
31+
developmentVersion:
32+
description: "Next development version (e.g., 1.0.1-SNAPSHOT). If empty, increments patch version"
33+
required: false
34+
type: string
35+
prerelease:
36+
description: "Is this a prerelease?"
37+
type: boolean
38+
required: false
39+
default: false
40+
secrets:
41+
JAVA_RELEASE_TOKEN:
42+
required: true
43+
JAVA_RELEASE_GITHUB_TOKEN:
44+
required: true
45+
JAVA_MAVEN_CENTRAL_USERNAME:
46+
required: true
47+
JAVA_MAVEN_CENTRAL_PASSWORD:
48+
required: true
49+
JAVA_GPG_SECRET_KEY:
50+
required: true
51+
JAVA_GPG_PASSPHRASE:
52+
required: true
2553

2654
permissions:
2755
contents: write
@@ -144,10 +172,10 @@ jobs:
144172
exit 1
145173
fi
146174
else
147-
# Split version: supports "0.1.32", "0.1.32-java.0", and "0.1.32-java-preview.0" formats
175+
# Split version: supports "0.1.32", "0.1.32-preview.0", "0.1.32-java.0", and "0.1.32-java-preview.0" formats
148176
# Validate RELEASE_VERSION format explicitly to provide clear errors
149-
if ! echo "$RELEASE_VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+(-(beta-)?java(-preview)?\.[0-9]+)?$'; then
150-
echo "Error: RELEASE_VERSION '$RELEASE_VERSION' is invalid. Expected format: M.M.P, M.M.P-java.N, M.M.P-java-preview.N, M.M.P-beta-java.N, or M.M.P-beta-java-preview.N (e.g., 1.2.3, 1.2.3-java.0, 1.2.3-java-preview.0, 1.2.3-beta-java.0, or 1.2.3-beta-java-preview.0)." >&2
177+
if ! echo "$RELEASE_VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+(-(preview|(beta-)?java(-preview)?)\.[0-9]+)?$'; then
178+
echo "Error: RELEASE_VERSION '$RELEASE_VERSION' is invalid. Expected format: M.M.P, M.M.P-preview.N, M.M.P-java.N, M.M.P-java-preview.N, M.M.P-beta-java.N, or M.M.P-beta-java-preview.N (e.g., 1.2.3, 1.2.3-preview.0, 1.2.3-java.0, 1.2.3-java-preview.0, 1.2.3-beta-java.0, or 1.2.3-beta-java-preview.0)." >&2
151179
exit 1
152180
fi
153181
# Extract the base M.M.P portion (before any qualifier)

.github/workflows/nodejs-sdk-tests.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,15 @@ permissions:
3131

3232
jobs:
3333
test:
34-
name: "Node.js SDK Tests"
34+
name: "Node.js SDK Tests (${{ matrix.os }}, ${{ matrix.transport }})"
3535
if: github.event.repository.fork == false
3636
env:
3737
POWERSHELL_UPDATECHECK: Off
3838
strategy:
3939
fail-fast: false
4040
matrix:
4141
os: [ubuntu-latest, macos-latest, windows-latest]
42+
transport: ["default", "inprocess"]
4243
runs-on: ${{ matrix.os }}
4344
defaults:
4445
run:
@@ -75,6 +76,11 @@ jobs:
7576
if: runner.os == 'Windows'
7677
run: pwsh.exe -Command "Write-Host 'PowerShell ready'"
7778

79+
- name: Select inprocess transport
80+
if: matrix.transport == 'inprocess'
81+
run: |
82+
echo "COPILOT_SDK_DEFAULT_CONNECTION=inprocess" >> "$GITHUB_ENV"
83+
7884
- name: Run Node.js SDK tests
7985
env:
8086
COPILOT_HMAC_KEY: ${{ secrets.COPILOT_DEVELOPER_CLI_INTEGRATION_HMAC_KEY }}

.github/workflows/publish.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,28 @@ jobs:
229229
with:
230230
packages-dir: python/dist/
231231

232+
publish-java:
233+
name: Publish Java SDK
234+
if: github.event.inputs.dist-tag != 'unstable' && github.ref == 'refs/heads/main'
235+
needs: version
236+
uses: ./.github/workflows/java-publish-maven.yml
237+
with:
238+
releaseVersion: ${{ needs.version.outputs.version }}
239+
prerelease: ${{ github.event.inputs.dist-tag == 'prerelease' }}
240+
secrets: inherit
241+
232242
github-release:
233243
name: Create GitHub Release
234-
needs: [version, publish-nodejs, publish-dotnet, publish-python, publish-rust]
235-
if: github.ref == 'refs/heads/main' && github.event.inputs.dist-tag != 'unstable'
244+
needs: [version, publish-nodejs, publish-dotnet, publish-python, publish-rust, publish-java]
245+
if: |
246+
always() &&
247+
github.ref == 'refs/heads/main' &&
248+
github.event.inputs.dist-tag != 'unstable' &&
249+
needs.version.result == 'success' &&
250+
needs.publish-nodejs.result == 'success' &&
251+
needs.publish-dotnet.result == 'success' &&
252+
needs.publish-python.result == 'success' &&
253+
needs.publish-rust.result == 'success'
236254
runs-on: ubuntu-latest
237255
steps:
238256
- uses: actions/checkout@v6.0.2

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ docs/.validation/
77
# Visual Studio
88
.vs/
99

10+
# Intellij IDEA
11+
.idea/
12+
1013
# C# Dev Kit
1114
*.csproj.lscache
1215

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,24 @@ All notable changes to the Copilot SDK are documented in this file.
55
This changelog is automatically generated by an AI agent when stable releases are published.
66
See [GitHub Releases](https://github.com/github/copilot-sdk/releases) for the full list.
77

8+
## [java/v1.0.6](https://github.com/github/copilot-sdk/releases/tag/java/v1.0.6) (2026-07-08)
9+
10+
### Feature: inline lambda tool definitions
11+
12+
Developers can now define tools directly at the call site using `ToolDefinition.from(...)` with typed lambda handlers and `Param.of(...)` parameter metadata — no separate annotated class required. Async variants (`fromAsync`) and `ToolInvocation` context injection (`fromWithToolInvocation`) are also available. ([#1895](https://github.com/github/copilot-sdk/pull/1895))
13+
14+
```java
15+
ToolDefinition greet = ToolDefinition.from(
16+
"greet", "Greets a user by name",
17+
Param.of(String.class, "name", "The user's name"),
18+
name -> "Hello, " + name + "!");
19+
```
20+
21+
### Other changes
22+
23+
- bugfix: **[Java]** preserve explicit null map values in JSON-RPC params so user setting clears reach the CLI ([#1906](https://github.com/github/copilot-sdk/pull/1906))
24+
- feature: **[Java]** add experimental `onGitHubTelemetry` callback on `CopilotClientOptions` for receiving forwarded GitHub telemetry events ([#1835](https://github.com/github/copilot-sdk/pull/1835))
25+
826
## [java/v1.0.5-01](https://github.com/github/copilot-sdk/releases/tag/java/v1.0.5-01) (2026-07-01)
927

1028
### Feature: new session options — citations, agent exclusions, and credit limits

docs/auth/byok.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ import { CopilotClient } from "@github/copilot-sdk";
529529

530530
const client = new CopilotClient();
531531
const session = await client.createSession({
532-
model: "gpt-4.1",
532+
model: "gpt-5.4",
533533
provider: {
534534
type: "azure",
535535
baseUrl: "https://my-resource.openai.azure.com",
@@ -560,7 +560,7 @@ import { CopilotClient } from "@github/copilot-sdk";
560560

561561
const client = new CopilotClient();
562562
const session = await client.createSession({
563-
model: "gpt-4.1",
563+
model: "gpt-5.4",
564564
provider: {
565565
type: "openai",
566566
baseUrl: "https://your-resource.openai.azure.com/openai/v1/",

docs/features/custom-agents.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const client = new CopilotClient();
3737
await client.start();
3838

3939
const session = await client.createSession({
40-
model: "gpt-4.1",
40+
model: "gpt-5.4",
4141
customAgents: [
4242
{
4343
name: "researcher",
@@ -71,7 +71,7 @@ await client.start()
7171

7272
session = await client.create_session(
7373
on_permission_request=lambda req, inv: PermissionDecisionApproveOnce(),
74-
model="gpt-4.1",
74+
model="gpt-5.4",
7575
custom_agents=[
7676
{
7777
"name": "researcher",
@@ -112,7 +112,7 @@ func main() {
112112
client.Start(ctx)
113113

114114
session, _ := client.CreateSession(ctx, &copilot.SessionConfig{
115-
Model: "gpt-4.1",
115+
Model: "gpt-5.4",
116116
CustomAgents: []copilot.CustomAgentConfig{
117117
{
118118
Name: "researcher",
@@ -144,7 +144,7 @@ client := copilot.NewClient(nil)
144144
client.Start(ctx)
145145

146146
session, _ := client.CreateSession(ctx, &copilot.SessionConfig{
147-
Model: "gpt-4.1",
147+
Model: "gpt-5.4",
148148
CustomAgents: []copilot.CustomAgentConfig{
149149
{
150150
Name: "researcher",
@@ -179,7 +179,7 @@ using GitHub.Copilot.Rpc;
179179
await using var client = new CopilotClient();
180180
await using var session = await client.CreateSessionAsync(new SessionConfig
181181
{
182-
Model = "gpt-4.1",
182+
Model = "gpt-5.4",
183183
CustomAgents = new List<CustomAgentConfig>
184184
{
185185
new()
@@ -219,7 +219,7 @@ try (var client = new CopilotClient()) {
219219

220220
var session = client.createSession(
221221
new SessionConfig()
222-
.setModel("gpt-4.1")
222+
.setModel("gpt-5.4")
223223
.setCustomAgents(List.of(
224224
new CustomAgentConfig()
225225
.setName("researcher")
@@ -529,7 +529,7 @@ func main() {
529529
client.Start(ctx)
530530

531531
session, _ := client.CreateSession(ctx, &copilot.SessionConfig{
532-
Model: "gpt-4.1",
532+
Model: "gpt-5.4",
533533
OnPermissionRequest: func(req copilot.PermissionRequest, inv copilot.PermissionInvocation) (rpc.PermissionDecision, error) {
534534
return &rpc.PermissionDecisionApproveOnce{}, nil
535535
},

docs/features/fleet-mode.md

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ Fleet mode is useful when the work can be decomposed before execution and each u
88

99
Good fits include:
1010

11-
- Multi-file refactors where each worker owns a file, package, or language SDK.
12-
- Batch reviews where each worker checks a separate diff, module, or alert group.
13-
- Parallel research across independent repositories, services, or feature areas.
14-
- Documentation refreshes where each worker owns a page or topic.
15-
- Migration tasks where each worker can validate its own slice and report back.
11+
* Multi-file refactors where each worker owns a file, package, or language SDK.
12+
* Batch reviews where each worker checks a separate diff, module, or alert group.
13+
* Parallel research across independent repositories, services, or feature areas.
14+
* Documentation refreshes where each worker owns a page or topic.
15+
* Migration tasks where each worker can validate its own slice and report back.
1616

1717
Avoid fleet mode for:
1818

19-
- Sequential tasks where step 2 needs the concrete output from step 1.
20-
- Tightly coupled edits where workers would contend for the same files.
21-
- Small tasks that one synchronous sub-agent or the parent agent can finish quickly.
22-
- Tasks that require continuous shared reasoning rather than clear ownership.
19+
* Sequential tasks where step 2 needs the concrete output from step 1.
20+
* Tightly coupled edits where workers would contend for the same files.
21+
* Small tasks that one synchronous sub-agent or the parent agent can finish quickly.
22+
* Tasks that require continuous shared reasoning rather than clear ownership.
2323

2424
Fleet mode works best when the parent session can create clear units of work, assign one owner per unit, and define what each worker must return.
2525

@@ -321,29 +321,29 @@ Keep plugin-provided sub-agent types narrow and descriptive so the orchestrator
321321

322322
## Best practices
323323

324-
- Decompose the work into independent units before starting fleet mode.
325-
- Minimize dependencies between todos; dependencies reduce parallelism.
326-
- Give each todo a durable ID, a clear title, and a complete description.
327-
- Make each sub-agent own exactly one todo at a time.
328-
- Use background sub-agents for truly parallel work.
329-
- Use synchronous sub-agent calls for serialized steps or validation gates.
330-
- Provide each sub-agent with complete context; sub-agents are stateless across calls.
331-
- Include file paths, commands, expected outputs, and constraints in each worker prompt.
332-
- Do not dispatch a single background sub-agent; prefer a synchronous call or batch multiple workers in parallel.
333-
- Avoid assigning overlapping files to different workers unless the parent agent will reconcile conflicts explicitly.
334-
- Require every worker to report what it changed, how it validated the change, and what remains blocked.
335-
- Have the parent agent verify the combined result after workers finish.
324+
* Decompose the work into independent units before starting fleet mode.
325+
* Minimize dependencies between todos; dependencies reduce parallelism.
326+
* Give each todo a durable ID, a clear title, and a complete description.
327+
* Make each sub-agent own exactly one todo at a time.
328+
* Use background sub-agents for truly parallel work.
329+
* Use synchronous sub-agent calls for serialized steps or validation gates.
330+
* Provide each sub-agent with complete context; sub-agents are stateless across calls.
331+
* Include file paths, commands, expected outputs, and constraints in each worker prompt.
332+
* Do not dispatch a single background sub-agent; prefer a synchronous call or batch multiple workers in parallel.
333+
* Avoid assigning overlapping files to different workers unless the parent agent will reconcile conflicts explicitly.
334+
* Require every worker to report what it changed, how it validated the change, and what remains blocked.
335+
* Have the parent agent verify the combined result after workers finish.
336336

337337
## Limitations and open questions
338338

339-
- Fleet mode is exposed through generated session RPC bindings and is marked experimental in several SDKs.
340-
- The SQL todos pattern is the canonical coordination model in the runtime guidance, but whether it is a stable extensibility contract for SDK consumers is still an open question.
341-
- `subagentStart` and `subagentStop` are runtime hook names; this branch exposes sub-agent lifecycle to SDK consumers through the generic session event stream, not dedicated hook callbacks.
342-
- Plugin sub-agent registration is configured at the runtime layer through `--plugin-dir`; no SDK-level plugin registration helper was verified on this branch.
343-
- Java native typed bindings for `session.fleet.start` were not found in the Java SDK source on this branch.
344-
- Fleet mode does not remove the need for parent-agent review. Parallel workers can produce inconsistent assumptions that the orchestrator must reconcile.
339+
* Fleet mode is exposed through generated session RPC bindings and is marked experimental in several SDKs.
340+
* The SQL todos pattern is the canonical coordination model in the runtime guidance, but whether it is a stable extensibility contract for SDK consumers is still an open question.
341+
* `subagentStart` and `subagentStop` are runtime hook names; this branch exposes sub-agent lifecycle to SDK consumers through the generic session event stream, not dedicated hook callbacks.
342+
* Plugin sub-agent registration is configured at the runtime layer through `--plugin-dir`; no SDK-level plugin registration helper was verified on this branch.
343+
* Java native typed bindings for `session.fleet.start` were not found in the Java SDK source on this branch.
344+
* Fleet mode does not remove the need for parent-agent review. Parallel workers can produce inconsistent assumptions that the orchestrator must reconcile.
345345

346346
## See also
347347

348-
- [Custom agents and sub-agent orchestration](custom-agents.md)
349-
- [Hooks](hooks.md)
348+
* [Custom agents and sub-agent orchestration](custom-agents.md)
349+
* [Hooks](hooks.md)

docs/features/hooks.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,16 +1051,16 @@ const session = await client.createSession({
10511051

10521052
For full type definitions, input/output field tables, and additional examples for every hook, see the API reference:
10531053

1054-
- [Hooks Overview](../hooks/hooks-overview.md)
1055-
- [Pre-Tool Use](../hooks/pre-tool-use.md)
1056-
- [Post-Tool Use](../hooks/post-tool-use.md)
1057-
- [User Prompt Submitted](../hooks/user-prompt-submitted.md)
1058-
- [Session Lifecycle](../hooks/session-lifecycle.md)
1059-
- [Error Handling](../hooks/error-handling.md)
1054+
* [Hooks Overview](../hooks/hooks-overview.md)
1055+
* [Pre-Tool Use](../hooks/pre-tool-use.md)
1056+
* [Post-Tool Use](../hooks/post-tool-use.md)
1057+
* [User Prompt Submitted](../hooks/user-prompt-submitted.md)
1058+
* [Session Lifecycle](../hooks/session-lifecycle.md)
1059+
* [Error Handling](../hooks/error-handling.md)
10601060

10611061
## See also
10621062

1063-
- [Getting Started](../getting-started.md)
1064-
- [Custom Agents & Sub-Agent Orchestration](./custom-agents.md)
1065-
- [Streaming Session Events](./streaming-events.md)
1066-
- [Debugging Guide](../troubleshooting/debugging.md)
1063+
* [Getting Started](../getting-started.md)
1064+
* [Custom Agents & Sub-Agent Orchestration](./custom-agents.md)
1065+
* [Streaming Session Events](./streaming-events.md)
1066+
* [Debugging Guide](../troubleshooting/debugging.md)

0 commit comments

Comments
 (0)