sdk-java-e2e-test
Skill11k starsChanged 3 months agoMITView on GitHub
Use this skill when creating a Java SDK surface-area E2E integration test backed by a replay proxy YAML snapshot
Trending
Steady talk.about the whole repository
Who's talking about github/copilot-sdk
- @kaylacinnamon.bsky.social“I built a web app with the GitHub Copilot SDK to make analyzing log files easier. It'll summarize them, …”Bluesky · Jan 22, 2026 · 66 likes
- @cassidoo.co“The @github.com Copilot SDK is live and it's really awesome! Learn more about it and try it out: …”Bluesky · Jan 22, 2026 · 63 likes
- @github.com“The GitHub Copilot SDK is here 🙌 You can take the same Copilot agentic core that powers GitHub Copilot CLI …”Bluesky · Jan 22, 2026 · 30 likes
- openclaw/openclaw“[Feature]: Copilot-sdk instead of proxy”GitHub · Jan 24, 2026 · 13 reactions
- KeygraphHQ/shannon“[FEATURE]: Add GitHub Copilot SDK as an AI provider option”GitHub · Mar 4, 2026 · 8 reactions
The biggest 5 of 25 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 25
Talked about on GitHub, Bluesky and Hacker News (25 times).
On GitHub · 13
- Jan 24, 2026[Feature]: Copilot-sdk instead of proxy — openclaw/openclaw13 reactions · 4 comments
- Mar 4, 2026[FEATURE]: Add GitHub Copilot SDK as an AI provider option — KeygraphHQ/shannon8 reactions · 1 comment
- Aug 20, 2026Allow Canvas extensions to open or focus an existing local session — github/app3 reactions
- Mar 10, 2026Make RequestIdSTJsonConverter public for AOT/trimming compatibility — microsoft/vs-streamjsonrpc3 reactions
- Jan 22, 2026.NET: Add AIAgent implementation for Github Copilot SDK — microsoft/agent-framework3 reactions · 3 comments
8 more on GitHub
- Aug 1, 2026BYOK Responses streaming drops apply_patch input before execution — github/copilot-cli2 reactions · 1 comment
- Jan 21, 2026Bump github-copilot-sdk from 0.1.13 to 0.1.14 in the uv-all group — Ven0m0/gemini-web-wrapper2 reactions · 1 comment
- Oct 1, 2026Add support for gpt-6.1-sol — github/gh-aw1 reaction
- Sep 24, 2026build(deps): bump github.com/github/copilot-sdk/go from 0.1.25 to 1.0.14 — orka-agents/orka1 reaction · 1 comment
- May 27, 2026Rust SDK? — openai/codex1 reaction · 3 comments
- May 5, 2026Provider Request: GitHub SDK / with github.com + company.ghe.com support — vectorize-io/hindsight1 reaction · 1 comment
- Feb 11, 2026CI Failure DoctorBuild failure after copilot-sdk upgrade to v0.1.21 — devantler-tech/ksail1 reaction · 2 comments
- Jan 27, 20260xsarawut.base.eth — base/docs1 reaction
On Bluesky · 11
- Jan 22, 2026I built a web app with the GitHub Copilot SDK to make analyzing log files easier. It'll summarize them, provide a root cause analysis, and… — @kaylacinnamon.bsky.social66 likes and reposts · 3 replies
- Jan 22, 2026The @github.com Copilot SDK is live and it's really awesome! Learn more about it and try it out: github.com/github/copil... — @cassidoo.co63 likes and reposts · 5 replies
- Jan 22, 2026The GitHub Copilot SDK is here 🙌 You can take the same Copilot agentic core that powers GitHub Copilot CLI and embed it in any… — @github.com30 likes and reposts · 4 replies
- Jan 28, 2026Now you can integrate #Microsoft #Copilot #CodingAgent via SDK into your app. Java, .NET/C#, Python, TypeScript, Go bindings MIT license… — @qdrddr.bsky.social3 likes and reposts
- Jan 27, 2026GitHub ha soltado hace unos días una bomba para devs 🚀 Con el GitHub Copilot SDK ahora puedes meter un agente de IA real (planifica,… — @mouredev.com3 likes and reposts
6 more on Bluesky
- Apr 4, 2026📦 github / copilot-sdk ⭐ 8,195 (+40) 🗒 TypeScript Multi-platform SDK for integrating GitHub Copilot Agent into apps and services — @github-trending-js.bsky.social2 likes and reposts
- Feb 9, 2026Have you used the GitHub Copilot SDK yet? If not… you probably should 👀 Repo 👉 github.com/github/copil... Tonight I had a bit of fun… — @thomast1906.bsky.social1 likes and repost
- Jan 26, 2026@github.com announced Copilot SDK, bringing the power of Copilot CLI to your apps. I built Flight School, an app that gives learning… — @chrisreddington.com1 likes and repost
- Jan 20, 2026GitHub Copilot CLI SDKs (github/copilot-sdk): Multi-platform SDK for integrating GitHub Copilot Agent into apps and services… — @aaronw.dev1 likes and repost
- Jan 29, 2026But ‘til then, check out some of the Copilot SDK projects we’re loving right now. If you haven’t given it a go, sharing some inspo in the… — @kdaigle.xmirror.bot0 likes and reposts · 1 reply
- Jan 23, 2026𝗚𝗶𝘁𝗛𝘂𝗯 𝗼𝗽𝗲𝗻𝘀 𝗶𝘁𝘀 𝗖𝗼𝗽𝗶𝗹𝗼𝘁 𝗖𝗟𝗜 𝗮𝘀 𝗮 𝗽𝗿𝗼𝗴𝗿𝗮𝗺𝗺𝗮𝗯𝗹𝗲 𝗦𝗗𝗞 💯 🚀 Now in technical preview, the GitHub… — @inakibes.bsky.social0 likes and reposts · 1 reply
On Hacker News · 1
- Jan 22, 2026GitHub Copilot CLI SDKs3 points
In this repository6 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/AGENTS.mdAGENTS.md
- dotnet/test/E2E/AGENTS.mdAGENTS.md
- java/AGENTS.mdAGENTS.md
- rust/AGENTS.mdAGENTS.md
- agentic-workflowsSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
Use this skill only when the new E2E tests Java SDK surface area.
- Very specific: line 49
Every request's system message is replaced with ${system} before matching, so system content is never compared, and an assertion on the …
- Very specific: line 65
Place it in java/sdk/src/test/java/com/github/copilot/ with an IT suffix (e.g., MyFeatureIT.java).
- Very specific: line 181
When the snapshot has the model call a built-in tool such as view, the CLI really executes it in the test's workDir, and the next request …
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Creating a New Java E2E Test with a Replay Proxy YAML Snapshot
Repository layout
These instructions work in both the runtime monorepo and the standalone public
SDK repository. From the repository root, use src/sdk as the SDK root when
that directory exists; otherwise use the repository root itself. All paths below
are relative to that SDK root.
Use this skill only when the new E2E tests Java SDK surface area; shared
runtime functionality available entirely through the SDK belongs in the
TypeScript SDK suite (nodejs/test/e2e/).
Overview
The Java E2E tests use a replay proxy (test/harness/replayingCapiProxy.ts)
that intercepts HTTP calls to the Copilot API and returns pre-recorded responses
from YAML snapshot files. This avoids needing real authentication in CI.
Key constraint: Java's CapiProxy.start() always sets GITHUB_ACTIONS=true,
which forces the replay proxy into read-only mode: a Java test cannot record a
snapshot, and every request must match an existing one.
Step-by-Step Workflow
Step 1: Choose a snapshot category and snapshot base name
- Category = a directory under
test/snapshots/(e.g.,system_message_sections) - Snapshot base name = the exact filename stem, already lowercase snake_case,
e.g.,
should_use_replaced_identity_section_in_response. Pass it verbatim toconfigureForTest: it lowercases and replaces non-alphanumerics with_but does not split camelCase, somyTestMethodwould look formytestmethod.yaml. - Resulting file:
test/snapshots/<category>/<snapshot_base_name>.yaml
Step 2: Use a recorded snapshot
The SDK guide forbids hand-authored model responses (CONTRIBUTING.md,
"Recording and replaying SDK tests"). Reuse a capture that another SDK suite
recorded for the same conversation, as most Java ITs do; if none exists, record
one through the TypeScript SDK suite with the same snapshot name and prompt,
following that guide.
Replay rules:
- Every request's system message is replaced with
${system}before matching, so system content is never compared, and an assertion on the reply cannot prove that a system-message setting reached the model. - User content must exactly match the snapshot's (after normalization), so copy the prompt from the YAML.
${workdir}stands for the test's temp workDir in tool arguments and results.- A request matches when its messages equal a conversation up to an assistant message; the proxy replies with that assistant message and any assistant messages directly after it.
- A request that matches nothing fails. The proxy's stderr, echoed as
[CapiProxy stderr], reports "No cached response found" with the first mismatching message per conversation, andconfigureForTestlogs the prompts the snapshot expects.
Step 3: Create the Java IT test class
Place it in java/sdk/src/test/java/com/github/copilot/ with an IT suffix
(e.g., MyFeatureIT.java). The failsafe plugin picks up *IT.java files.
Template:
package com.github.copilot;
import static org.junit.jupiter.api.Assertions.*;
import java.util.concurrent.TimeUnit;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import com.github.copilot.generated.AssistantMessageEvent;
import com.github.copilot.rpc.MessageOptions;
import com.github.copilot.rpc.PermissionHandler;
import com.github.copilot.rpc.SessionConfig;
// ... other imports as needed
class MyFeatureIT {
private static E2ETestContext ctx;
@BeforeAll
static void setUp() throws Exception {
ctx = E2ETestContext.create();
}
@AfterAll
static void tearDown() throws Exception {
if (ctx != null) {
ctx.close();
}
}
@Test
void myTestMethod() throws Exception {
// 1. Configure the proxy to use your snapshot
ctx.configureForTest("my_category", "my_test_method");
// 2. Create a client (uses fake token + proxy automatically)
try (CopilotClient client = ctx.createClient()) {
// 3. Create a session with desired config
CopilotSession session = client.createSession(new SessionConfig()
.setOnPermissionRequest(PermissionHandler.APPROVE_ALL))
.get(30, TimeUnit.SECONDS);
try {
// 4. Send the prompt (must match YAML exactly)
AssistantMessageEvent response = session
.sendAndWait(new MessageOptions().setPrompt("Your prompt here"), 60_000)
.get(90, TimeUnit.SECONDS);
// 5. Assert on the response
assertNotNull(response);
String content = response.getData().content();
assertTrue(content.contains("expected text"));
} finally {
session.close();
}
}
}
}Step 4: Verify
In the runtime repository, prepare the checked-out Java projection and CLI from the runtime root:
pnpm run generate:sdk:java
pnpm run build:clipnpm run test:sdk:java runs the whole suite and takes no test filter. For a
focused Maven run, pass the same-checkout wrapper explicitly (without
copilot.cli.path the tests use the release pinned by nodejs/package.json),
then use the verify lifecycle so test-resource setup and failsafe:verify
both run:
cd src/sdk/java
./mvnw -pl sdk spotless:apply
COPILOT_CLI_PATH=<runtime-root>/dist-cli/prebuilds/<target>/copilot-runtime
./mvnw -pl sdk verify -Dit.test="MyFeatureIT#myTestMethod" -Dcopilot.cli.path="$COPILOT_CLI_PATH"<target> is Node's <process.platform>-<process.arch> (for example
linux-x64, darwin-arm64, win32-x64); use copilot-runtime.exe for the
wrapper name on Windows.
In the standalone SDK repository, start at java/ and use the pinned runtime:
./mvnw -pl sdk spotless:apply
./mvnw -pl sdk verify -Dit.test="MyFeatureIT#myTestMethod"Key Classes and Files
| What | Where |
| Test context (manages proxy, workDir, CLI) | java/sdk/src/test/java/com/github/copilot/E2ETestContext.java |
| Java proxy wrapper | java/sdk/src/test/java/com/github/copilot/CapiProxy.java |
| Replay proxy (TypeScript) | test/harness/replayingCapiProxy.ts |
| Proxy server entry point | test/harness/server.ts |
| Snapshot files | test/snapshots/<category>/<name>.yaml |
| Existing IT tests for reference | java/sdk/src/test/java/com/github/copilot/**/*IT.java; SystemMessageSectionsIT reuses Node.js suite captures, including a view tool call |
Tests that call built-in tools
When the snapshot has the model call a built-in tool such as view, the CLI
really executes it in the test's workDir, and the next request carries its
result, which must match the snapshot's. Create any file the tool reads before
sending the prompt, with exactly the content the snapshot's tool result shows:
Files.writeString(ctx.getWorkDir().resolve("test.txt"), "Hello transform!");Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

