File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff 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();
You can’t perform that action at this time.
0 commit comments