Skip to content

fix(server): startup robustness — watchdog false-kill + anonymous collection fetch#139

Merged
Clydingus merged 5 commits into
mainfrom
startup-issues-fixes
Jun 17, 2026
Merged

fix(server): startup robustness — watchdog false-kill + anonymous collection fetch#139
Clydingus merged 5 commits into
mainfrom
startup-issues-fixes

Conversation

@Clydingus

@Clydingus Clydingus commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Two startup-path fixes, split out from the macOS work for an isolated review. Fixes #138 indirectly.

1. Parent watchdog false-kills the server on launch

The parent-death watchdog compared the launcher-supplied --parent-start-time (Electron's Date.now()/1000 - process.uptime()) against psutil's create_time() with a 1s tolerance. On a heavy Electron process, uptime() only starts counting after Chromium/V8 boot, so that estimate lands ~1–3s after the kernel's real create_time — past the tolerance. The server decided its (alive) parent was gone and os._exit(1)'d at startup ("Parent process is already gone, shutting down").

Fix: capture the recycling baseline from psutil at construction, so the startup check and every poll use one source. The launcher value is still accepted but no longer used for the comparison. PID-recycling protection is preserved — a recycled PID has a different create_time.

2. Model picker degrades when a restricted HF token is cached

The curated Overworld/waypoint collection is public, but the listing inherited the host's cached HF token. A fine-grained / upload-scoped token authenticates yet lacks "read collections", so it 403s and the picker silently falls back to the default model alone.

Fix: fetch the collection with token=False (forced anonymous) — public curated metadata shouldn't depend on ambient credentials.

Clydingus and others added 2 commits June 9, 2026 11:41
The curated `Overworld/waypoint` collection is public metadata, but the listing inherited the host's cached HF token. A fine-grained/upload-scoped token authenticates yet lacks "read collections", so it 403s and the picker silently falls back to the default model alone. Force `token=False` so listing never depends on ambient credentials — anonymous access succeeds for every user.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The parent-death watchdog compared the launcher-supplied --parent-start-time (Electron's `Date.now()/1000 - process.uptime()`) against psutil's create_time() with a 1s tolerance. On a heavy Electron process, uptime only starts counting after Chromium/V8 boot, so that estimate lands 1-3s after the kernel's real create_time and blew past the tolerance — the server decided its (alive) parent was gone and os._exit(1)'d at startup. Capture the recycling baseline from psutil at construction instead, so the startup check and every poll use one source; the launcher value is still accepted but no longer used for the comparison.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Clydingus Clydingus requested a review from philpax June 9, 2026 15:47
@Clydingus Clydingus force-pushed the startup-issues-fixes branch from 47936ce to 04e07d9 Compare June 9, 2026 16:00

@philpax philpax left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Okay to merge once we've confirmed that, across Windows and a Unix-like (macOS or Linux are both fine):

  • the server will not randomly kill itself during startup or gameplay (a few minutes is fine)
  • the server will shut down when Biome is shut down
  • the server will shut down when Biome is terminated externally

@philpax philpax left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ready to merge once CI is fixed

@Clydingus Clydingus merged commit b152b5c into main Jun 17, 2026
17 of 18 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.

[Auto Bug Report] Server error: {"version": "3.12.13 (main, Mar 3 2026, 15:35:03) [Clang 21.1

2 participants