fix(server): startup robustness — watchdog false-kill + anonymous collection fetch#139
Open
Clydingus wants to merge 3 commits into
Open
fix(server): startup robustness — watchdog false-kill + anonymous collection fetch#139Clydingus wants to merge 3 commits into
Clydingus wants to merge 3 commits into
Conversation
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>
47936ce to
04e07d9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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'sDate.now()/1000 - process.uptime()) against psutil'screate_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 realcreate_time— past the tolerance. The server decided its (alive) parent was gone andos._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/waypointcollection 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.