onWatch icon indicating copy to clipboard operation
onWatch copied to clipboard

"failed to load config

Open ohcedar opened this issue 8 months ago • 3 comments

Installed with homebrew. Wen through the setup. No joy.

There is some kind of error in the process.

% onwatch setup

  onWatch Setup
  https://github.com/onllm-dev/onwatch

  info  Existing .env found -- configured: Z.ai, Anthropic, Codex, Antigravity

  Add Synthetic provider? (y/N): n
% onwatch      
Error: failed to load config: at least one provider must be configured: set SYNTHETIC_API_KEY, ZAI_API_KEY, ANTHROPIC_TOKEN, COPILOT_TOKEN, CODEX_TOKEN, or ANTIGRAVITY_ENABLED=true

ohcedar avatar Mar 08 '26 05:03 ohcedar

Thanks for reporting this. Will look into the config loading issue and get a fix out.

In the meantime, could you try installing via the install script instead of homebrew and see if that resolves it?

curl -fsSL https://raw.githubusercontent.com/onllm-dev/onwatch/main/install.sh | bash

Also, which provider(s) are you trying to track? That will help me reproduce the issue on my end.

prakersh avatar Mar 08 '26 06:03 prakersh

Getting the same thing for Codex. The .env has a CODEX_TOKEN after running setup (in which it found my Codex token) but it is saying

Error: failed to load config: at least one provider must be configured: set SYNTHETIC_API_KEY, ZAI_API_KEY, ANTHROPIC_TOKEN, COPILOT_TOKEN, CODEX_TOKEN, or ANTIGRAVITY_ENABLED=true

epaga avatar Mar 08 '26 07:03 epaga

Fixed in v2.11.14.

Root cause: The setup wizard correctly saved configuration to ~/.onwatch/.env, but the config loader was only looking for .env in the current working directory. When running onwatch from any directory other than ~/.onwatch/, the config file wasn't found.

Fix: Config loader now:

  1. Looks for ~/.onwatch/.env first (standard install location)
  2. Falls back to local .env only if it contains onwatch-specific keys

To update:

brew update && brew upgrade onwatch

Or

curl -fsSL https://raw.githubusercontent.com/onllm-dev/onwatch/main/install.sh | bash

Let us know if this resolves it for you. If onWatch has been helpful, consider giving us a ⭐ - it helps others discover the project.

prakersh avatar Mar 08 '26 07:03 prakersh