Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Why is the `OnPermissionRequest` event triggered twice for the same `PermissionRequestKindWrite` request?

Open
#2,060 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Quiet
Tech stack
go

Research direction

Start by reproducing the duplicate callbacks with the shown permissionHandler and logging request.Kind(), request, invocation.SessionID, and requestID for PermissionRequestKindWrite. Trace where the OnPermissionRequest event is dispatched and compare both invocations, then verify that one logical write request produces one callback while preserving the existing permission decision flow.

Written by the indexing model from the issue text.

Description

question

Except for the requestID, the request and invocation in both calls are identical.

permissionHandler := func(request copilot.PermissionRequest, invocation copilot.PermissionInvocation) (copilotrpc.PermissionDecision, error) {
		requiresWriteConfirm := requiresWriteApproval(request)
		requestID := uuid.NewString()
		if request.Kind() == copilotrpc.PermissionRequestKindWrite {
			fmt.Printf("[Permission Check] invocation: %s, Kind: %v, Request: %+v\n", invocation.SessionID, request.Kind(), request)
		}
		h.pushBridgeEvent(session.userID, session.sessionID, "permission.request", gin.H{
			"request_id":             requestID,
			"kind":                   string(request.Kind()),
			"request":                request,
			"copilot_session_id":     fmt.Sprintf("%v", invocation.SessionID),
			"requires_write_confirm": requiresWriteConfirm,
			"session_id":             strconv.FormatInt(session.sessionID, 10),
		})

		if !requiresWriteConfirm {
			decision := copilotrpc.PermissionDecisionApproveOnce{}
			h.pushBridgeEvent(session.userID, session.sessionID, "permission.decision", gin.H{
				"request_id": requestID,
				"kind":       string(request.Kind()),
				"approved":   true,
			})
			return decision, nil
		}

		....
	}
Image Image
Dominant language
Java
Stars
10.5k
Forks
1.5k
Avg merge
1d 9h
Merged PRs (30d)
130

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from github/copilot-sdk

All issues in github/copilot-sdk

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.