modelstat 0.8.1 → 0.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "modelstat",
3
- "version": "0.8.1",
3
+ "version": "0.8.3",
4
4
  "description": "modelstat daemon — reads local AI-tool usage and ships tokenised events to modelstat.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -29,8 +29,8 @@
29
29
  "tsx": "^4.19.2",
30
30
  "typescript": "^5.7.3",
31
31
  "@modelstat/daemon-core": "0.0.0",
32
- "@modelstat/parsers": "0.0.0",
33
- "@modelstat/core": "0.0.0"
32
+ "@modelstat/core": "0.0.0",
33
+ "@modelstat/parsers": "0.0.0"
34
34
  },
35
35
  "engines": {
36
36
  "node": ">=20.18.0"
@@ -208,12 +208,19 @@ async function rebootServiceIfInstalled() {
208
208
  );
209
209
  }
210
210
 
211
- // Start back up. `modelstat start` re-runs preflight (incl. the
212
- // processing-version reconcile that wipes cursors when we ship a
213
- // new pipeline), so the upgrade picks up the new behaviour
214
- // immediately. Detached so the daemon survives this script.
211
+ // Start back up. `--force` is REQUIRED, not optional: the stop +
212
+ // killStaleDaemon above happen BEFORE the (slow, up-to-300 s) native
213
+ // `_setup-runtime` restage, and a launchd/systemd KeepAlive can respawn
214
+ // the OLD daemon during that window. A plain `start` would then see a live
215
+ // owner and no-op ("already running — to force-replace it: start --force"),
216
+ // leaving the service stuck on the previous build even though the global
217
+ // package upgraded. `--force` evicts whatever survived and guarantees the
218
+ // freshly-staged bundle is the one running. `start` re-runs preflight (incl.
219
+ // the processing-version reconcile that wipes cursors when we ship a new
220
+ // pipeline), so the upgrade picks up the new behaviour immediately. Detached
221
+ // so the daemon survives this script.
215
222
  const { spawn } = await import("node:child_process");
216
- const child = spawn(process.execPath, [freshBundle, "start"], {
223
+ const child = spawn(process.execPath, [freshBundle, "start", "--force"], {
217
224
  detached: true,
218
225
  stdio: "ignore",
219
226
  });