mirror of
https://github.com/paperclipai/paperclip
synced 2026-03-25 11:21:48 +00:00
When Paperclip's server is started via `runuser -u node` (common in Docker/Fly.io deployments), the HOME environment variable retains the parent process's value (e.g. /root) instead of the target user's home directory (/home/node). This causes `opencode models` to miss provider auth credentials stored under the actual user's home, resulting in "Configured OpenCode model is unavailable" errors for providers that require API keys (e.g. zai/zhipuai). Fix: use `os.userInfo().homedir` (reads from /etc/passwd, not env) to ensure the child process always sees the correct HOME, regardless of how the server was launched. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>