OK, the query is now whatever finds only the notes you need check and the action is now this:
linkToOriginal(find($Tags(that).contains($Name)));
If you were to do the same in a stamp or edict, the code would be:
linkTo(find($Tags(that).contains($Name)));
The difference is because in an agent you are processing an alias yet the aim is to link with the original of the note thus the newer actions linkToOriginal()
and linkFromOriginal()
specifically address this issue of linking from within an agent.