Skip to content

Add E2E test for session.providerEndpoint.get#1621

Draft
SteveSandersonMS wants to merge 10 commits into
mainfrom
stevesandersonms/provider-endpoint-e2e
Draft

Add E2E test for session.providerEndpoint.get#1621
SteveSandersonMS wants to merge 10 commits into
mainfrom
stevesandersonms/provider-endpoint-e2e

Conversation

@SteveSandersonMS

@SteveSandersonMS SteveSandersonMS commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Adds a Node E2E test for the new session.providerEndpoint.get shared API (not yet shipped).

The new RPC returns the provider endpoint + credentials for a session — the BYOK config if one is set, otherwise the resolved CAPI endpoint — so SDK consumers can call the LLM backend directly with their own OpenAI/Anthropic client.

Changes

  • Regenerated nodejs/src/generated/rpc.ts and session-events.ts against the runtime schema that adds providerEndpoint.
  • New nodejs/test/e2e/provider_endpoint.e2e.test.ts covering:
    • BYOK: returns protocol, baseUrl, apiKey, headers from the configured provider.
    • CAPI: returns the resolved CAPI base URL (using the harness CapiProxy so no real network calls).

Validating

Built the runtime branch locally and pointed the harness at it:

COPILOT_CLI_PATH=<runtime>\dist-cli\index.js npm run test:e2e -- provider_endpoint

Both tests pass.

Draft because this depends on the runtime PR landing + a release that includes the new schema before it can run in CI.

@github-actions

This comment has been minimized.

@SteveSandersonMS SteveSandersonMS force-pushed the stevesandersonms/provider-endpoint-e2e branch 3 times, most recently from 9d87a1e to d0916b9 Compare June 10, 2026 14:36
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

SteveSandersonMS and others added 6 commits June 12, 2026 11:59
Validates the new shared API exposed by copilot-agent-runtime (see
github/copilot-sdk-internal#133) end-to-end from the Node SDK. Covers
both BYOK (returns provider config + headers) and CAPI (returns the
resolved CAPI base URL).

Regenerates rpc.ts and session-events.ts against the runtime schema that
adds the providerEndpoint RPC.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Runtime renamed session.providerEndpoint.get -> session.provider.getEndpoint
and split the wire protocol into separate type+wireApi fields. Regenerated
rpc.ts/session-events.ts against the runtime schema and updated the test
assertions to match. Both BYOK and CAPI cases pass against the real harness
CapiProxy.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The API is gated by env var, so set it on the harness env object (which is
the same one passed to the CLI subprocess) instead of requiring callers to
export it in their own environment.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The runtime now surfaces Authorization in the headers map (consistent
with BYOK pass-through) rather than stripping it. Update the e2e to
assert the new contract and regen the RPC bindings.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Mirrors the existing nodejs e2e test pair:
- BYOK provider returns the configured endpoint and headers verbatim
- CAPI/OAuth session returns the proxied baseUrl, bearer apiKey,
  required CAPI headers, and (when present) a Copilot-Session-Token

Regenerates dotnet bindings (Rpc.cs, SessionEvents.cs) from the runtime
schema to pick up ProviderApi/ProviderEndpoint/ProviderSessionToken.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@SteveSandersonMS SteveSandersonMS force-pushed the stevesandersonms/provider-endpoint-e2e branch from 75820af to c21c135 Compare June 12, 2026 11:02
@github-actions

This comment has been minimized.

SteveSandersonMS and others added 2 commits June 12, 2026 12:22
Picks up the new ProviderEndpoint type and session.provider.getEndpoint RPC from the runtime schema. Generated by scripts/codegen/{go,python,rust}.ts against the runtime worktree exposing the API.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Mirrors the existing nodejs provider_endpoint.e2e.test.ts in the three remaining language SDKs, covering both the BYOK and CAPI branches. Also drops a speculative phrase from the existing .NET test's XML doc.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
!session_token.token.is_empty(),
"session token must be non-empty",
);
if let Some(expires_at) = session_token.expires_at.as_deref() {
@github-actions

This comment has been minimized.

SteveSandersonMS and others added 2 commits June 12, 2026 12:39
Adds the generated bindings for the new session.provider.getEndpoint RPC (spliced into the bundled api.schema.json so unrelated regen drift is excluded) and mirrors the existing nodejs/.NET/Go/Python/Rust provider endpoint E2E tests in Java, covering both the BYOK and CAPI branches.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Auto-committed by java-codegen-check workflow.
@github-actions github-actions Bot added the dependencies Pull requests that update a dependency file label Jun 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Cross-SDK Consistency Review

The PR does a great job of adding session.provider.getEndpoint E2E tests across all six SDKs, and regenerating the generated types for five of them. One gap:

🔴 Java generated code not regenerated

All other SDKs had their generated type files updated:

SDK Generated file updated
Node.js nodejs/src/generated/rpc.ts
Python python/copilot/generated/rpc.py
Go go/rpc/zrpc.go
.NET dotnet/src/Generated/Rpc.cs
Rust rust/src/generated/api_types.rs + rpc.rs
Java java/src/generated/java/not updated

ProviderEndpointE2ETest.java imports four types from com.github.copilot.generated.rpc that don't exist yet (ProviderEndpointType, ProviderEndpointWireApi, ProviderSessionToken, SessionProviderGetEndpointResult), and accesses session.getRpc().provider.getEndpoint() — but SessionRpc.java has no provider field. The Java build will fail to compile.

Fix: run cd java && mvn generate-sources -Pcodegen before this PR is merged (or when the schema is available in CI).


Everything else looks consistent across SDKs — the ProviderConfig BYOK setup, the COPILOT_ALLOW_GET_PROVIDER_ENDPOINT env-var opt-in pattern, and the two test scenarios (BYOK and CAPI OAuth) are all present and structurally parallel in all six test files.

Generated by SDK Consistency Review Agent for issue #1621 · sonnet46 2.8M ·

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Generated by SDK Consistency Review Agent for issue #1621 · sonnet46 2.8M

import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;

import com.github.copilot.generated.rpc.ProviderEndpointType;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Missing Java generated code — these four types (ProviderEndpointType, ProviderEndpointWireApi, ProviderSessionToken, SessionProviderGetEndpointResult) don't exist in java/src/generated/java/com/github/copilot/generated/rpc/. Importing them will cause a compile error.

The other five SDKs all had their generated files updated in this PR (Node.js rpc.ts, Python rpc.py, Go zrpc.go, .NET Rpc.cs, Rust api_types.rs) to include the new provider namespace and its associated types, but the Java codegen step was skipped.

The session.getRpc().provider.getEndpoint() calls later in the test will also fail because SessionRpc.java has no provider field.

To fix, run the Java codegen:

cd java && mvn generate-sources -Pcodegen

This regenerates java/src/generated/java/ from the updated schema, adding SessionProviderApi.java, SessionProviderGetEndpointResult.java, the new enum types, and the public final SessionProviderApi provider field in SessionRpc.java.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants