Skip to content

Commit 5a8a2b4

Browse files
Copilotbrunoborges
andauthored
Improve Javadoc for findSessionWithHooks and findSessionWithPermissionHandler
Agent-Logs-Url: https://github.com/github/copilot-sdk-java/sessions/868c6fed-c57d-4d9f-806c-eca509096672 Co-authored-by: brunoborges <129743+brunoborges@users.noreply.github.com>
1 parent b1efa7b commit 5a8a2b4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/main/java/com/github/copilot/sdk/RpcHandlerDispatcher.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,10 @@ private void handleHooksInvoke(JsonRpcClient rpc, String requestId, JsonNode par
337337
* When the CLI creates sub-agent sessions internally, their session IDs are not
338338
* in the SDK's session map. This method searches all registered sessions to
339339
* find one with hooks, enabling hook handlers to fire for sub-agent tool calls.
340+
* <p>
341+
* If multiple sessions have hooks registered, the first one found is returned.
342+
* In practice, SDK users typically register hooks on a single session that
343+
* covers all sub-agent activity.
340344
*
341345
* @return a session with hooks, or {@code null} if none found
342346
*/
@@ -354,6 +358,10 @@ private CopilotSession findSessionWithHooks() {
354358
* <p>
355359
* Similar to {@link #findSessionWithHooks()}, this enables permission handlers
356360
* to fire for sub-agent sessions whose IDs are not tracked by the SDK.
361+
* <p>
362+
* If multiple sessions have permission handlers, the first one found is
363+
* returned. In practice, SDK users typically register a single permission
364+
* handler that covers all sub-agent activity.
357365
*
358366
* @return a session with a permission handler, or {@code null} if none found
359367
*/

0 commit comments

Comments
 (0)