Looks like the Environment variables are likely the problem. When Xcode runs the Executable, it may not have all the environment setup that it needs.
I created a wrapper script with execute bits set that sets up the environment and then just calls copilot and that seems to work. Set the Xcode Agent config to path to the script.
It would probably also work to add Environment Variables to the Xcode Agent setup as well.
~/bin/xcode-copilot-agent:
#!/bin/zsh -i
copilot --acp
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: