browser-use--browser-harness
2366c226e9
Connection management (addresses "shit ton of daemons" problem): - Socket is the lock. Daemon refuses to start if another is already listening (5-line check). - PID file at /tmp/harnesless.pid written on start, removed on exit. - ensure_daemon() / kill_daemon() / daemon_alive() helpers. - run.py auto-calls ensure_daemon() before exec — users never manage the daemon manually. - kill_daemon uses PID file (robust) instead of pkill pattern matching (was silently missing because the process command line didn't contain the "harnesless/" prefix). Post-task ritual added to SKILL.md: after every browser task, extract ONE generalizable friction point and make the simplest possible improvement (2-line helper, one-line gotcha, recipe correction). This is how the harness sharpens itself over time. Verified end-to-end: kill_daemon → 0 processes + files cleaned → next run.py → auto-starts exactly one daemon. Second `uv run daemon.py` exits with "daemon already running" message instead of racing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 行
72 B
Python
5 行
72 B
Python
import sys
|
|
from helpers import *
|
|
ensure_daemon()
|
|
exec(sys.stdin.read())
|