Skip to content

config: install varlock as agent user, not root#33

Merged
benvinegar merged 2 commits into
mainfrom
benvinegar/fix-varlock-install
Feb 17, 2026
Merged

config: install varlock as agent user, not root#33
benvinegar merged 2 commits into
mainfrom
benvinegar/fix-varlock-install

Conversation

@benvinegar
Copy link
Copy Markdown
Member

Problem

setup.sh runs curl | sh as root to install varlock. This installs varlock to root's home directory (e.g. /root/.varlock/bin/varlock). But start.sh runs as baudbot_agent and expects varlock at ~/.varlock/bin/varlock under the agent's home. Result: varlock: command not found and the agent crash-loops.

Fix

Run the varlock installer as baudbot_agent via sudo -u, so it installs to /home/baudbot_agent/.varlock/bin/varlock.

# Before (installs to root's home)
curl -sSfL https://varlock.dev/install.sh | sh -s

# After (installs to agent's home)
sudo -u baudbot_agent bash -c 'curl -sSfL https://varlock.dev/install.sh | sh -s'

Also checks $BAUDBOT_HOME/.varlock/bin/varlock before installing (idempotent).

setup.sh was running 'curl | sh' as root, which installed varlock to
root's home. start.sh expects it at ~/.varlock/bin/varlock under the
agent user. Now runs the installer as baudbot_agent via sudo -u so
it lands in the right place.
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Feb 17, 2026

Greptile Summary

Fixed varlock installation to run as the baudbot_agent user instead of root, resolving a crash-loop where start.sh couldn't find varlock in the agent's home directory.

  • Changed varlock installer to run via sudo -u baudbot_agent so it installs to /home/baudbot_agent/.varlock/bin/varlock
  • Improved idempotency check from command -v varlock to explicit path check $BAUDBOT_HOME/.varlock/bin/varlock
  • Added explanatory comment about why varlock must be installed as the agent user

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The fix correctly addresses the crash-loop issue by installing varlock as the agent user. The change is straightforward, follows existing patterns in the codebase (similar to SSH key and Node.js installation), and improves the idempotency check. No security implications or potential side effects.
  • No files require special attention

Important Files Changed

Filename Overview
setup.sh Fixed varlock installation to run as baudbot_agent user instead of root, resolving crash-loop issue. Improved idempotency check.

Last reviewed commit: 29e106a

CI never actually ran start.sh or tested that varlock was installed
for the agent user. This is why the varlock install bug (installed
as root instead of baudbot_agent) wasn't caught.

Now verifies:
- varlock binary exists at /home/baudbot_agent/.varlock/bin/varlock
- varlock load succeeds as the agent user (validates schema + .env)
@benvinegar benvinegar merged commit 990e2a7 into main Feb 17, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant