Skip to content

Commit f4c5c26

Browse files
brunoborgesCopilot
andauthored
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 166a2e1 commit f4c5c26

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

instructions/copilot-sdk-java.instructions.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -743,12 +743,13 @@ var session = client.createSession(new SessionConfig()
743743
.setModel("gpt-5")
744744
.setOnPermissionRequest(PermissionHandler.APPROVE_ALL)
745745
.setHooks(new SessionHooks()
746-
.setOnPreToolUse(hook -> {
747-
System.out.println("About to execute tool: " + hook);
748-
return CompletableFuture.completedFuture(null);
746+
.setOnPreToolUse((input, invocation) -> {
747+
System.out.println("About to execute tool: " + input);
748+
var decision = new PreToolUseHookOutput().setKind("allow");
749+
return CompletableFuture.completedFuture(decision);
749750
})
750-
.setOnPostToolUse(hook -> {
751-
System.out.println("Tool execution complete: " + hook);
751+
.setOnPostToolUse((output, invocation) -> {
752+
System.out.println("Tool execution complete: " + output);
752753
return CompletableFuture.completedFuture(null);
753754
}))
754755
).get();

0 commit comments

Comments
 (0)