First of all, thank you for your work! I've been using this tool for quite some time. :)
Now, after OpenSSH's commit openssh/openssh-portable@80162f9, the agent listener sockets were moved from /tmp to ~/.ssh/agent. Their reasoning is the following:
This ensures processes (such as Firefox) that have restricted filesystem access that includes /tmp (via unveil(3)) do not have the ability to use keys in an agent.
Fortunately, the -T flag on the ssh-agent command will return to placing the agent socket into the /tmp directory.
# ~/.bashrc or ~/.zshrc
ssh-add -l >&/dev/null || ssh-find-agent -a || eval $(ssh-agent -T) > /dev/null
Is updating this tool to consider the ~/.ssh/agent directory a good idea? Unfortunately, the name of the socket file does not appear to have the PID of the SSH agent in it anymore. It only appears to have a randomized string. E.g.:
$ eval $(ssh-agent)
Agent pid 11434
$ echo "$SSH_AUTH_SOCK"
/home/<user>/.ssh/agent/s.<hash_of_hostname>.agent.AzSubDP0S1