Skip to content

Merge reference implementation SDK changes (2026-05-06)#166

Open
Copilot wants to merge 5 commits intomainfrom
copilot/reference-implementation-sync-14-new-commits
Open

Merge reference implementation SDK changes (2026-05-06)#166
Copilot wants to merge 5 commits intomainfrom
copilot/reference-implementation-sync-14-new-commits

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 6, 2026

Resolves #271


Before the change?

  • Java SDK was synced to reference implementation commit c063458
  • No remote session (Mission Control) support
  • ProviderConfig lacked model resolution and token limit overrides
  • Client startup could leak a CLI process if connection setup failed after process spawn
  • E2E test harness did not support CONNECT proxy metadata for offline GitHub proxy
  • sync-codegen-version.sh used npm install which normalized semver ranges, causing version drift between pom.xml and scripts/codegen/package.json (e.g. ^1.0.43-0^1.0.43)

After the change?

  • Synced to reference implementation commit 06bfc5d (14 commits analyzed, 4 ported)
  • Remote sessions: CopilotClientOptions.setRemote(true) passes --remote to CLI, enabling GitHub web/mobile access via Mission Control
  • Provider model overrides: ProviderConfig gains modelId, wireModel, maxPromptTokens, maxOutputTokens
  • Startup cleanup race fix: Process is properly killed if connection/protocol-verification fails after CLI spawn
  • Test harness: CapiProxy parses CONNECT proxy metadata; E2ETestContext sets proxy env vars for HTTPS interception
  • Version sync fix: sync-codegen-version.sh now writes the version directly into package.json (matching how sync-cli-version-from-reference-impl.sh updates pom.xml), then runs npm install only for the lock file, preventing npm from normalizing the semver range
  • CapiProxy consistency fix: proxyUrl is only assigned after metadata parsing succeeds, preventing inconsistent state if parsing fails
// Remote sessions
var client = new CopilotClient(new CopilotClientOptions().setRemote(true));

// Provider model overrides
new ProviderConfig()
    .setModelId("gpt-4o")           // runtime config lookup
    .setWireModel("my-finetune-v3") // sent on the wire
    .setMaxPromptTokens(100_000)
    .setMaxOutputTokens(4096);

Not ported (intentionally): Generated code changes (need update-copilot-dependency workflow), Rust SDK, .NET-specific process fixes, CI-only harness hardening, disabled_mcp_servers removal (Java never had it).

Pull request checklist

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • mvn spotless:apply has been run to format the code
  • mvn clean verify passes locally

Does this introduce a breaking change?

  • Yes
  • No

Copilot AI and others added 2 commits May 6, 2026 23:25
…l overrides, startup cleanup race fix

- Add Remote option to CopilotClientOptions with --remote CLI flag
- Add modelId, wireModel, maxPromptTokens, maxOutputTokens to ProviderConfig
- Fix client startup cleanup race condition (process cleanup on failure)
- Update E2E test harness for CONNECT proxy metadata
- Add unit tests for new provider config fields and clone
- Add E2E tests for provider wire model feature
- Document remote sessions and model overrides in advanced.md

Co-authored-by: edburns <75821+edburns@users.noreply.github.com>
…om.xml CLI version, and update scripts/codegen @github/copilot version

Co-authored-by: edburns <75821+edburns@users.noreply.github.com>
Copilot AI changed the title [WIP] Sync reference implementation with 14 new commits Merge reference implementation SDK changes (2026-05-06) May 6, 2026
Copilot finished work on behalf of edburns May 6, 2026 23:30
Copilot AI requested a review from edburns May 6, 2026 23:30
Auto-committed by codegen-check workflow.
@edburns edburns marked this pull request as ready for review May 7, 2026 17:51
Copilot AI review requested due to automatic review settings May 7, 2026 17:51
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Ports recent reference implementation updates into the Java SDK, adding remote session (Mission Control) enablement, provider model/token overrides, a CLI-process cleanup fix on failed startup, and E2E harness improvements for CONNECT proxy metadata.

Changes:

  • Add CopilotClientOptions.setRemote(true) and forward --remote when spawning the CLI.
  • Extend ProviderConfig with model/wire-model and token limit overrides, with added unit/E2E coverage.
  • Enhance E2E harness (CapiProxy/E2ETestContext) to support CONNECT proxy metadata and env var setup; bump codegen @github/copilot and generated types accordingly.
Show a summary per file
File Description
src/test/java/com/github/copilot/sdk/SessionConfigE2ETest.java Adds E2E coverage asserting provider wire-model forwarding behavior.
src/test/java/com/github/copilot/sdk/ProviderConfigTest.java Adds serialization/round-trip tests for new ProviderConfig fields.
src/test/java/com/github/copilot/sdk/E2ETestContext.java Sets GH config dir and configures proxy/CA env vars for HTTPS interception.
src/test/java/com/github/copilot/sdk/ConfigCloneTest.java Ensures CopilotClientOptions.clone() includes new options.
src/test/java/com/github/copilot/sdk/CapiProxy.java Parses optional CONNECT proxy metadata from harness startup output.
src/site/markdown/advanced.md Documents provider model overrides and remote sessions.
src/main/java/com/github/copilot/sdk/json/ProviderConfig.java Adds modelId, wireModel, and token limit override fields with Javadoc.
src/main/java/com/github/copilot/sdk/json/CopilotClientOptions.java Adds remote option, accessors, and clone support.
src/main/java/com/github/copilot/sdk/CopilotClient.java Ensures spawned CLI process is cleaned up if connection/protocol verification fails after spawn.
src/main/java/com/github/copilot/sdk/CliServerManager.java Forwards --remote to the CLI when the option is enabled.
src/generated/java/com/github/copilot/sdk/generated/SessionScheduleCreatedEvent.java Adds generated event type for schedule creation.
src/generated/java/com/github/copilot/sdk/generated/SessionScheduleCancelledEvent.java Adds generated event type for schedule cancellation.
src/generated/java/com/github/copilot/sdk/generated/SessionEvent.java Registers new schedule event subtypes in the generated event union.
src/generated/java/com/github/copilot/sdk/generated/rpc/SessionRpc.java Adds generated remote namespace API surface to session RPC.
src/generated/java/com/github/copilot/sdk/generated/rpc/SessionRemoteEnableResult.java Adds generated result type for remote enable RPC.
src/generated/java/com/github/copilot/sdk/generated/rpc/SessionRemoteEnableParams.java Adds generated params type for remote enable RPC.
src/generated/java/com/github/copilot/sdk/generated/rpc/SessionRemoteDisableParams.java Adds generated params type for remote disable RPC.
src/generated/java/com/github/copilot/sdk/generated/rpc/SessionRemoteApi.java Adds generated RPC client methods for enabling/disabling remote.
src/generated/java/com/github/copilot/sdk/generated/CustomAgentsUpdatedAgent.java Updates generated field documentation for tools.
src/generated/java/com/github/copilot/sdk/generated/AssistantMessageToolRequest.java Adds generated mcpToolName field.
scripts/codegen/package.json Bumps @github/copilot dependency for schema/codegen input.
scripts/codegen/package-lock.json Lockfile updates for the bumped @github/copilot version.
pom.xml Updates pinned @github/copilot version property used by CI CLI installs.
.lastmerge Advances reference implementation sync marker to the new commit.

Copilot's findings

Files not reviewed (1)
  • scripts/codegen/package-lock.json: Language not supported
  • Files reviewed: 13/24 changed files
  • Comments generated: 3

Comment on lines +148 to +152
Map<String, String> meta = MAPPER.readValue(metadata, new TypeReference<Map<String, String>>() {
});
connectProxyUrl = meta.get("connectProxyUrl");
caFilePath = meta.get("caFilePath");
} catch (Exception e) {
Comment thread pom.xml
Comment thread scripts/codegen/package.json Outdated
},
"dependencies": {
"@github/copilot": "^1.0.41-0",
"@github/copilot": "^1.0.43",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot The way it's supposed to work is that the value in the POM is a copy of this one, and this one is a copy of the one in the reference implementation. Please investigate why this did not happen when the reference-impl-sync executed and make fixes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The root cause: sync-codegen-version.sh used npm install "@github/copilot@^1.0.43-0" which lets npm normalize the semver range, stripping the prerelease suffix to ^1.0.43. Fixed in 162030b by writing the version directly into package.json (matching how sync-cli-version-from-reference-impl.sh updates pom.xml via sed), then running npm install only to regenerate the lock file. Both now correctly have ^1.0.43-0.

The sync-codegen-version.sh script used `npm install` which normalizes
semver ranges, stripping prerelease suffixes (e.g. ^1.0.43-0 → ^1.0.43).
Fix by writing the version directly into package.json before running
npm install, matching how sync-cli-version-from-reference-impl.sh
updates pom.xml.

Also fix CapiProxy inconsistent state: defer proxyUrl assignment until
after metadata parsing succeeds.

Agent-Logs-Url: https://github.com/github/copilot-sdk-java/sessions/243ea08c-366e-4ac4-bdb6-939a59a1e755

Co-authored-by: edburns <75821+edburns@users.noreply.github.com>
Copilot finished work on behalf of edburns May 7, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[reference-impl-sync] Reference Implementation sync: 14 new commits (2026-05-06)

3 participants