File tree Expand file tree Collapse file tree
tests/__snapshots__/bridges Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,6 +9,17 @@ WorkingDirectory=/var/www/site
99Environment=HOME=/home/chubes
1010Environment=PATH=/usr/bin:/usr/local/bin:/bin
1111Environment=KIMAKI_DATA_DIR=/home/chubes/.kimaki
12+ # Reap stray opencode-serve children left behind by the previous kimaki
13+ # process before starting a fresh one. Each kimaki session spawns its own
14+ # opencode-serve worker; if kimaki exits uncleanly (crash, OOM, manual
15+ # kill) those workers are reparented to PID 1 and keep running. They all
16+ # share $HOME/.local/share/opencode/auth.json, so concurrent OAuth
17+ # refreshes race each other — Anthropic rotates the refresh token on every
18+ # use, and the loser of the race gets HTTP 400 invalid_grant on its next
19+ # request. `pkill -u chubes` scopes the kill to this service's
20+ # user so multi-tenant hosts aren't sniped. The `-` prefix makes systemd
21+ # tolerate exit code 1 (no matches found, the happy path on a clean box).
22+ ExecStartPre=-/usr/bin/pkill -TERM -u chubes -f "opencode-ai/bin/.*serve"
1223ExecStartPre=/opt/kimaki-config/post-upgrade.sh
1324ExecStart=/usr/bin/kimaki --data-dir /home/chubes/.kimaki --auto-restart --no-critique
1425Restart=always
You can’t perform that action at this time.
0 commit comments