fix: address code review comments on Java doc snippets#1025
Merged
patniko merged 3 commits intogithub:mainfrom Apr 7, 2026
Merged
fix: address code review comments on Java doc snippets#1025patniko merged 3 commits intogithub:mainfrom
patniko merged 3 commits intogithub:mainfrom
Conversation
- Add missing java.util.List imports (custom-agents, image-input, skills, microsoft-agent-framework, byok) - Add missing java.util.Map import (microsoft-agent-framework) - Add missing java.util.Set import (features/hooks) - Add missing java.util.concurrent.CompletableFuture import (features/hooks) - Add missing setOnPermissionRequest(PermissionHandler.APPROVE_ALL) calls (getting-started ×2, bundled-cli, github-oauth, hooks/index) - Add missing userId/message variable declarations (github-oauth, backend-services) - Fix error-handling Hook Signature: show Java-specific note as comments instead of using undefined session variable - Standardize on PermissionHandler.APPROVE_ALL (backend-services) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Follow-up documentation fix-up PR that makes the newly-added Java snippets across the docs compile and behave consistently (imports, permission handler wiring, and undefined variables).
Changes:
- Adds missing Java standard-library imports (
List,Map,Set,CompletableFuture) across multiple docs snippets. - Ensures Java snippets consistently set
setOnPermissionRequest(PermissionHandler.APPROVE_ALL)in key getting-started/setup examples. - Fixes snippet correctness issues (e.g., undefined variables; avoids referencing an undefined
sessionin the error-handling “Hook Signature” section).
Show a summary per file
| File | Description |
|---|---|
| docs/auth/byok.md | Adds java.util.List import for List.of(...) usage in Java BYOK snippet. |
| docs/features/custom-agents.md | Adds java.util.List import; but introduces malformed Java code fencing in one block (see comments). |
| docs/features/hooks.md | Adds missing CompletableFuture / Set imports for Java hook examples (one snippet still needs SDK imports to be self-contained). |
| docs/features/image-input.md | Adds java.util.List imports in Java image input snippets. |
| docs/features/skills.md | Adds java.util.List imports for Java skills examples (including a short config-focused snippet). |
| docs/getting-started.md | Adds setOnPermissionRequest(PermissionHandler.APPROVE_ALL) to Java getting-started snippets. |
| docs/hooks/error-handling.md | Reworks the Java “Hook Signature” snippet to avoid referencing an undefined session and points to a full example below. |
| docs/hooks/index.md | Adds setOnPermissionRequest(PermissionHandler.APPROVE_ALL) to the Java hooks quick start snippet. |
| docs/integrations/microsoft-agent-framework.md | Adds missing List/Map imports to Java tool example. |
| docs/setup/backend-services.md | Defines userId/message and switches to PermissionHandler.APPROVE_ALL for consistency. |
| docs/setup/bundled-cli.md | Adds setOnPermissionRequest(PermissionHandler.APPROVE_ALL) to Java setup snippet. |
| docs/setup/github-oauth.md | Declares userId and adds setOnPermissionRequest(PermissionHandler.APPROVE_ALL) in the Java OAuth usage snippet. |
Copilot's findings
- Files reviewed: 12/12 changed files
- Comments generated: 2
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
patniko
approved these changes
Apr 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #1021 — addresses Copilot code review comments that were filed after the PR was squash-merged.
Fixes (12 files)
java.util.List,java.util.Map,java.util.Set,java.util.concurrent.CompletableFutureacross multiple Java snippetssetOnPermissionRequest(PermissionHandler.APPROVE_ALL): getting-started (×2), bundled-cli, github-oauth, hooks/indexuserIdandmessagenow declared in github-oauth and backend-services snippetssessionvariable — shows a comment-only note pointing to the full example belowPermissionHandler.APPROVE_ALLinstead ofrequest -> request.allow()Files changed
docs/auth/byok.mdjava.util.Listimportdocs/features/custom-agents.mdjava.util.Listimport (2 blocks)docs/features/hooks.mdCompletableFuture+Setimportsdocs/features/image-input.mdjava.util.Listimport (2 blocks)docs/features/skills.mdjava.util.Listimport (2 blocks)docs/getting-started.mdsetOnPermissionRequest(2 blocks)docs/hooks/error-handling.mdsessionin Hook Signaturedocs/hooks/index.mdsetOnPermissionRequestdocs/integrations/microsoft-agent-framework.mdList+Mapimportsdocs/setup/backend-services.mduserId/messagevars, fix permission handlerdocs/setup/bundled-cli.mdsetOnPermissionRequestdocs/setup/github-oauth.mduserIdvar, addsetOnPermissionRequest