Skip to content

Commit 94c5f50

Browse files
qmuntalCopilot
andauthored
Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 4dd00fa commit 94c5f50

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

go/client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ func (c *Client) ResumeSessionWithOptions(ctx context.Context, sessionID string,
546546
if config.OnPermissionRequest != nil {
547547
req.RequestPermission = Bool(true)
548548
}
549-
if config.OnPermissionRequest != nil {
549+
if config.OnUserInputRequest != nil {
550550
req.RequestUserInput = Bool(true)
551551
}
552552
if config.Hooks != nil && (config.Hooks.OnPreToolUse != nil ||
@@ -817,7 +817,7 @@ func (c *Client) OnEventType(eventType SessionLifecycleEventType, handler Sessio
817817
}
818818
}
819819

820-
// dispatchLifecycleEvent dispatches a lifecycle event to all registered handlers
820+
// handleLifecycleEvent dispatches a lifecycle event to all registered handlers
821821
func (c *Client) handleLifecycleEvent(event SessionLifecycleEvent) {
822822
c.lifecycleHandlersMux.Lock()
823823
// Copy handlers to avoid holding lock during callbacks

go/internal/jsonrpc2/jsonrpc2.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ func NotificationHandlerFor[In any](handler func(params In)) RequestHandler {
9898
var in In
9999
// If In is a pointer type, allocate the underlying value and unmarshal into it directly
100100
var target any = &in
101-
if t := reflect.TypeOf(in); t != nil && t.Kind() == reflect.Pointer {
101+
if t := reflect.TypeFor[In](); t.Kind() == reflect.Pointer {
102102
in = reflect.New(t.Elem()).Interface().(In)
103103
target = in
104104
}

0 commit comments

Comments
 (0)