Troubleshooting
1. Error: PATBA_API_KEY environment variable is not set.
- Cause: The CLI could not find
PATBA_API_KEYin the environment or in a.envfile in the directory where the command was executed. - Solution: Ensure your
.envfile is in the current working directory (process.cwd()) from which you run the command, or export the variable directly. See Configuration.
2. Failed to initialize remote thread
- Error message:
❌ Failed to initialize remote thread: {"error":"401 Unauthorized"}(or another network error). - Cause: Usually a network connection failure to
d33ib4uu7f4xpi.cloudfront.net, or an invalid/expired/incorrect API key. - Solution:
- Verify your internet connection.
- Check that
PATBA_API_KEYis correct, valid, and active. - Test connectivity manually:
curl -X POST -H "X-API-Key: YOUR_API_KEY" https://d33ib4uu7f4xpi.cloudfront.net/threads
3. Zed fails to load the custom agent server
- Cause: Zed cannot find the
nodeexecutable, or the path toindex.jsin yoursettings.jsonis incorrect. - Solution:
- Confirm you've compiled the source with
npm run build. - Verify the path to
dist/index.jsis absolute and uses forward slashes/. - If using a global install, confirm
patb-cliis on yourPATHby runningpatb-cli -hin a new terminal. - Check Zed's logs (
zed: open login the command palette) for the exact error.
- Confirm you've compiled the source with
4. import / module resolution errors when running node dist/index.js
- Cause: Running files without building first, or a Node version mismatch.
- Solution: Update Node.js to v20+, and always run
npm run buildafter editing TypeScript source.