Repository navigation
Bring Java SDK cookbook to .NET parity - #5085
brunoborges wants to merge 7 commits into
Conversation
Use the official SDK monorepo and released Java 1.0.21 APIs. Add the in-process runtime recipe, message provenance, deferred tool search, typed MCP configuration, and platform-aware safety and setup guidance. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3fdaadb1-b7cb-4313-8291-1bcc522981d7
🚦 Submission status: 👀 Ready for reviewRisk tier: Why this tier
Automated checks
Review
Commands
Updated for |
|
🟡 Contributor Reputation Check: MEDIUM risk
Maintainers: please review this contributor before merging. |
There was a problem hiding this comment.
🟢 Approval recommended
The examples align with the released SDK APIs, include appropriate safety guidance, and have credible validation evidence.
0 open findings
What changed in this PR
Updates the Java SDK cookbook to match current .NET coverage and the official SDK monorepo.
Changes:
- Migrates Java examples to SDK 1.0.21 APIs.
- Adds in-process runtime documentation and example.
- Adds tool search, message provenance, prerequisites, and safety guidance.
| File | Description |
|---|---|
cookbook/copilot-sdk/README.md |
Updates links, Java setup, and recipe counts. |
cookbook/copilot-sdk/java/README.md |
Documents SDK migration and new recipe. |
cookbook/copilot-sdk/java/accessibility-report.md |
Uses typed MCP configuration. |
cookbook/copilot-sdk/java/error-handling.md |
Adds provenance and shutdown guidance. |
cookbook/copilot-sdk/java/in-process-runtime.md |
Documents native in-process transport. |
cookbook/copilot-sdk/java/managing-local-files.md |
Migrates example imports. |
cookbook/copilot-sdk/java/multiple-sessions.md |
Migrates example imports. |
cookbook/copilot-sdk/java/persisting-sessions.md |
Migrates persistence examples. |
cookbook/copilot-sdk/java/pr-visualization.md |
Adds per-session tool search. |
cookbook/copilot-sdk/java/ralph-loop.md |
Migrates loop examples. |
cookbook/copilot-sdk/java/recipe/README.md |
Adds prerequisites and safety instructions. |
cookbook/copilot-sdk/java/recipe/AccessibilityReport.java |
Uses SDK 1.0.21 typed MCP APIs. |
cookbook/copilot-sdk/java/recipe/ErrorHandling.java |
Migrates SDK packages. |
cookbook/copilot-sdk/java/recipe/InProcessRuntime.java |
Adds runnable native-runtime example. |
cookbook/copilot-sdk/java/recipe/ManagingLocalFiles.java |
Migrates SDK packages. |
cookbook/copilot-sdk/java/recipe/MultipleSessions.java |
Migrates SDK packages. |
cookbook/copilot-sdk/java/recipe/PRVisualization.java |
Enables tool-search deferral. |
cookbook/copilot-sdk/java/recipe/PersistingSessions.java |
Migrates SDK packages. |
cookbook/copilot-sdk/java/recipe/RalphLoop.java |
Migrates SDK packages. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Replace the Java-only Running Examples note with shared links to all five language-specific prerequisite sections. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3fdaadb1-b7cb-4313-8291-1bcc522981d7
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3fdaadb1-b7cb-4313-8291-1bcc522981d7
|
WIP reviewing: 1. In-process transport claims1.1 Default and in-process transport behaviorPR claim
Proposed usage var options = new CopilotClientOptions()
.setConnection(RuntimeConnection.forInProcess());
try (var client = new CopilotClient(options)) {
client.start().get(30, TimeUnit.SECONDS);
// Create and use sessions normally.
}SME review
edburns> Yes. And I suggest "spawns a child process" is more accurate.
edburns> Yes.
edburns> Change the wording to
edburns> Say this instead:
1.2 Native runtime dependencies and classifiersPR claim
The proposed dependencies are: <dependency>
<groupId>com.github</groupId>
<artifactId>copilot-sdk-java</artifactId>
<version>1.0.21</version>
</dependency>
<dependency>
<groupId>com.github</groupId>
<artifactId>copilot-sdk-java-runtime</artifactId>
<version>1.0.21</version>
<classifier>linux-x64</classifier>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>5.19.1</version>
</dependency>PR claim: published classifier mapping
SME review
edburns> Yes. Manually checked.
edburns> Yes. Manually checked.
edburns> Yes.
edburns> It is more accurate to say the system is tested with JNA 5.19.1.
edburns> Applications must declare it explicitly.
edburns> Yes, there are. I suggest this statement:
edburns> JDK 25 is required for the native classifier in process work. |
Use the bare copilot command so the SDK can resolve native executables or CMD shims instead of passing a copilot.ps1 path to ProcessBuilder. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3fdaadb1-b7cb-4313-8291-1bcc522981d7
|
@edburns @jdubois, the requested corrections and recommended clarifications are now pushed. This includes message-source semantics, demo-only permission warnings throughout the Java cookbook, tool-search behavior and version-qualified defaults, and native transport/JDK/dependency/lifecycle guidance. The Windows CLI setup finding is also fixed, and the inline review thread is resolved. Could you please take another look? All eight runnable recipes and documentation snippets compile, and the native ping path was exercised on Java 17 and 25 on macOS arm64. Model-backed/MCP/browser end-to-end runs and Windows execution remain untested; the documentation now states those boundaries and does not claim to prove native teardown success. |
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved defects were identified; version-pinned references and reported validation support the examples, with native testing limitations clearly documented.
0 open findings
1 resolved since last review
🧠 Review effort: Balanced
|
Starting re-review as of 36b1a80 . @brunoborges |
edburns
left a comment
There was a problem hiding this comment.
Review Follow-up Grade for #5085
Overall grade: A
The author addressed the review comprehensively in commits af16dbe and
bef4b86. Both required corrections were fully applied:
- Message-source semantics — A: The revised text removes the
“provenance only” claim, explains the behavioral and indirect permission
effects, and clearly distinguishesMessageSource.SYSTEMfrom a model
system-role message. PermissionHandler.APPROVE_ALLsafety — A: Standalone recipes now contain
local demonstration-only warnings, and the Ralph Loop and PR Visualization
guidance recommends restrictive handlers for untrusted use.
The five recommended areas were also substantively addressed:
- Tool-search behavior — A: The text now describes category/policy-based
deferral, the strict threshold comparison, effective-catalog counting,
exemptions, session scope, runtime gating, and the version-qualified default. - JDK/native access — A: Java 17 remains the minimum, JDK 25 is recommended
rather than required, JDK 17-25 behavior is qualified, andcom.sun.jnais
named for module-path use. - Runtime/dependency terminology — A: The classifier JAR, subprocess wrapper,
runtime.node, JNA, external CLI, and logical runtime are now distinguished. - Transport selection — A: The cookbook centers the explicit API, removes
the environment-variable precedence discussion from the recipe, and separates
transport choice from executable selection. - Lifecycle/support/validation claims — A: The documentation distinguishes
published artifacts from tested coverage, explains shared-library versus
per-client hosts, qualifies feature parity, and no longer claims that ping or
stop()proves successful native teardown.
Validation breadth — B: The author compiled all eight recipes and exercised
native ping on Java 17 and 25 on macOS arm64, but did not add model-backed,
MCP/browser, Windows, or cross-platform execution coverage. This is acceptable
for the review because those boundaries are now stated explicitly rather than
hidden or overstated.

Pull Request Checklist
npm startand verified thatREADME.mdis up to date.mainbranch for this pull request.Description
The Java cookbook still referenced the archived standalone SDK and lacked recent .NET cookbook coverage. This brings Java to all eight .NET recipe topics while linking SDK documentation and source examples to the official
github/copilot-sdkmonorepo.--pingcheck, platform classifiers, JNA setup, and lifecycle limitations.Type of Contribution
Additional Notes
The resource-addition and resource-testing checklist items are N/A: this changes cookbook examples, not instructions, prompts, agents, skills, workflows, or extensions.
Validation:
npm start: passed; generated documentation and marketplace output remained unchanged.for file in cookbook/copilot-sdk/java/recipe/*.java; do jbang build --quiet "$file" || exit; done: passed for all eight recipes.jbang --deps com.github:copilot-sdk-java-runtime:1.0.21:darwin-arm64 cookbook/copilot-sdk/java/recipe/InProcessRuntime.java --ping: passed native startup, ping, and shutdown on Apple Silicon.python3 "$COPILOT_SESSION_ARTIFACTS/validate-cookbook.py": passed using a session-local validation harness (not committed). Compiled 16 standalone documentation classes, 20 contextual snippets, and eight recipes withjavac --release 17; verified eight-topic parity, 133 local links, 13 official SDK links, the experimental-API anchor, and all eight published native classifiers.bash eng/fix-line-endings.sh: passed with a macOS-compatible sed shim.git --no-pager diff --check: passed.Java requires an explicit platform runtime artifact and JNA for native transport, plus Java's experimental annotation opt-in instead of .NET's diagnostic suppression. Native execution was tested only on macOS arm64; other platforms and model-backed/MCP/browser end-to-end runs were not executed.
By submitting this pull request, I confirm that my contribution abides by the Code of Conduct and will be licensed under the MIT License.