This question originally came up in our Slack community and the thread has been consolidated here for long-term reference.
When I run my agent with uv run agent.py dev, I get a 401 error:
WSServerHandshakeError: 401, message='Invalid response status', url='ws://127.0.0.1:7880/agent'
After 16 retries, it fails completely. What’s causing this?
A 401 error usually points to an authentication/trust issue.
Double-check your API key and secret in your .env file. Make sure you don’t have a mismatch between what the server expects and what the agent is using.
If you’re following the Run Local guide, ensure the credentials in your .env match exactly what you configured when starting the server with --dev.