Add E2E test for session.providerEndpoint.get#1621
Conversation
This comment has been minimized.
This comment has been minimized.
9d87a1e to
d0916b9
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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>
75820af to
c21c135
Compare
This comment has been minimized.
This comment has been minimized.
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() { |
This comment has been minimized.
This comment has been minimized.
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.
Cross-SDK Consistency ReviewThe PR does a great job of adding 🔴 Java generated code not regeneratedAll other SDKs had their generated type files updated:
Fix: run Everything else looks consistent across SDKs — the
|
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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 -PcodegenThis 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.
Adds a Node E2E test for the new
session.providerEndpoint.getshared 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
nodejs/src/generated/rpc.tsandsession-events.tsagainst the runtime schema that addsproviderEndpoint.nodejs/test/e2e/provider_endpoint.e2e.test.tscovering:protocol,baseUrl,apiKey,headersfrom the configured provider.CapiProxyso no real network calls).Validating
Built the runtime branch locally and pointed the harness at it:
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.