Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions pkg/github/repository_resource_completions.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ func RepositoryResourceCompletionHandler(getClient GetClientFn) func(ctx context

argName := req.Params.Argument.Name
argValue := req.Params.Argument.Value
resolved := req.Params.Context.Arguments
if resolved == nil {
var resolved map[string]string
if req.Params.Context != nil && req.Params.Context.Arguments != nil {
resolved = req.Params.Context.Arguments
} else {
resolved = map[string]string{}
}
Comment on lines +36 to 41
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix for the nil pointer dereference is correct and handles both nil Context and nil Arguments. However, the test TestRepositoryResourceCompletionHandler_NilContext mentioned in the PR description doesn't actually test the case where Context is nil. It sets Context: &mcp.CompleteContext{Arguments: map[string]string{}} on line 360 of the test file, which is still a non-nil Context object. Consider adding a test case that explicitly sets Context: nil to ensure this fix is properly covered.

Copilot uses AI. Check for mistakes.

Expand Down