Skip to content

fix: address code review comments on Java doc snippets#1025

Merged
patniko merged 3 commits intogithub:mainfrom
brunoborges:docs/fix-java-review-comments
Apr 7, 2026
Merged

fix: address code review comments on Java doc snippets#1025
patniko merged 3 commits intogithub:mainfrom
brunoborges:docs/fix-java-review-comments

Conversation

@brunoborges
Copy link
Copy Markdown
Contributor

Summary

Follow-up to #1021 — addresses Copilot code review comments that were filed after the PR was squash-merged.

Fixes (12 files)

  • Missing imports: java.util.List, java.util.Map, java.util.Set, java.util.concurrent.CompletableFuture across multiple Java snippets
  • Missing setOnPermissionRequest(PermissionHandler.APPROVE_ALL): getting-started (×2), bundled-cli, github-oauth, hooks/index
  • Undefined variables: userId and message now declared in github-oauth and backend-services snippets
  • Hook Signature section: error-handling.md Java block no longer references an undefined session variable — shows a comment-only note pointing to the full example below
  • Consistent permission handler: backend-services uses PermissionHandler.APPROVE_ALL instead of request -> request.allow()

Files changed

File Fix
docs/auth/byok.md Add java.util.List import
docs/features/custom-agents.md Add java.util.List import (2 blocks)
docs/features/hooks.md Add CompletableFuture + Set imports
docs/features/image-input.md Add java.util.List import (2 blocks)
docs/features/skills.md Add java.util.List import (2 blocks)
docs/getting-started.md Add setOnPermissionRequest (2 blocks)
docs/hooks/error-handling.md Fix undefined session in Hook Signature
docs/hooks/index.md Add setOnPermissionRequest
docs/integrations/microsoft-agent-framework.md Add List + Map imports
docs/setup/backend-services.md Add userId/message vars, fix permission handler
docs/setup/bundled-cli.md Add setOnPermissionRequest
docs/setup/github-oauth.md Add userId var, add setOnPermissionRequest

- 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>
@brunoborges brunoborges requested a review from a team as a code owner April 6, 2026 21:03
Copilot AI review requested due to automatic review settings April 6, 2026 21:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 session in 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

Comment thread docs/features/custom-agents.md Outdated
Comment thread docs/features/hooks.md
brunoborges and others added 2 commits April 6, 2026 17:09
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@patniko patniko added this pull request to the merge queue Apr 7, 2026
Merged via the queue into github:main with commit c3fa6cb Apr 7, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants