Skip to content

Auto-update: don't restart onto a version that rejects the current config - #87

Merged
JOsacky merged 1 commit into
mainfrom
fix/restart-config-preflight
Nov 13, 2026
Merged

JOsacky merged 1 commit into
mainfrom
fix/restart-config-preflight

Conversation

@JOsacky

@JOsacky JOsacky commented Nov 13, 2026

Copy link
Copy Markdown
Member

Why

On 2026-11-12 at 12:20Z, the main operator daemon (0.15.2) restarted onto the newly installed 0.16.0. 0.16.0 rejects accounts.*.usage_login, which was written for the unmerged #84. launchd restarted it 128 times (Invalid ~/.skillhook/skillhook.json: Unrecognized key "usage_login"), and for 17 min 20 s nothing ran: no jobs, no schedules, no hosted ingress. A person-equivalent fix (removing the keys) brought it back. Tracked as RA-019 in the operator's reliability backlog.

What

  • installedAcceptsConfig(paths) in src/update.ts runs node <installed dist/cli.js> config show --json with SKILLHOOK_HOME set to the server's home. It returns one of three results:
    • ok: true: the new version loaded the config.
    • ok: false with the error: the new version exited non-zero.
    • ok: undefined: the check could not run (spawn error or a 30 s timeout).
  • The restart-on-newer-version interval in serve.ts runs the check before calling control.restart():
  • CHANGELOG has an entry under Unreleased.

Tests

  • src/update.test.ts has unit cases for each outcome: accepted, rejected with message, bare exit code, missing executable, and timeout. They also check that the child gets this home and not the parent's SKILLHOOK_HOME.
  • An integration case runs the real CLI (tsx src/cli.ts) against a valid config and against one with an unknown key.
  • Local results: pnpm test passed 533/533, typecheck passed, build passed, release --check passed.

Reversible: the change only skips a restart. It writes no data, and the protocol is unchanged.

🤖 Generated with Claude Code

…starting onto it

On 2026-11-12, 0.16.0 rejected accounts.*.usage_login keys that 0.15.2 had
accepted. The running server restarted onto it, and launchd then restarted it
128 times: 17 minutes with no jobs, schedules or hosted ingress.

The server now runs the installed version's `config show --json` with its own
home first. If that version rejects the config, the server logs an error, keeps
running and checks again every minute. If the check cannot run (timeout, or
node is missing), it restarts as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JOsacky
JOsacky merged commit d9395bf into main Nov 13, 2026
6 checks passed
@JOsacky
JOsacky deleted the fix/restart-config-preflight branch November 13, 2026 12:40
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