Yes, I know it's not perfect but when the secret key is unknown to gpg-agent then it shouldn't attempt to use it.
Apr 27 2017
Mar 31 2016
Mar 13 2016
Updated patch to check that the requested key usage is SIG before checking for a
Feb 24 2016
Attached a patch to call agent_probe_secret_key() during finish_lookup().
This partially solves the problem by not trying to use subkeys that have no
secret key present. This does not unexpectedly change the existing behaviour
because GnuPG will currently return an error if the automatically selected
secret key is not present.
It does not solve the issue of having multiple potential signing subkeys on
different smartcards, because these are always considered to be present (if the
subkey has been associated with a smartcard).