window-warmup 0.1.2 (@magpie-community/page-window-warmup).
- Candidates are now the model cache, /v1/models and the chosen list together
(deduplicated by full id), so a cache that stores effort variants
(antigravity's gemini-3.8-flash-high/-low/-tiered) no longer leaves an
account with no models; layer 3 still keeps only public ids.
- A "Report a problem" link at the foot of the page: GET /api/diagnostics
(read-only, no model request, works for fatal and read-only instances)
builds an anonymized report (accounts and keys as acct-N / key-N, task and
card names left out, free text scrubbed of emails, key-shaped strings,
Bearer tokens, URL secrets and home user names, saveError included), and a
two-step copy puts an issue link and the report on the clipboard inside
magpie's sandboxed frame.
Reviewed at head bf66c2b7302c66395833bb3e93054a55901d77c1, with main 9bba5fed
merged in locally, on a Mac mini (macOS, Bun 1.4.2):
- bun test in packages/window-warmup: 259 pass, 1 skip (browser smoke without
Playwright), 0 fail; the diagnostics file runs in milliseconds now, with no
wait on a connect timeout.
- tests/browser.test.ts with Playwright 1.62.0: 4 pass in Chromium and
WebKit, the sandboxed two-step copy included.
- tsc --noEmit ok; dist/ rebuilt with scripts/build.ts is byte-identical to
the committed one; bun scripts/check.mjs ok for every package.
- Broken by hand, one at a time: exporting saveError without scrub turns the
new EACCES /home/alice case red; baseView passing every host turns the
baseView test red; an unsettled /v1/models fetch turns the unreachable
gateway test red; dropping the home-directory rule turns both privacy
tests red.
- Left as is: the header comment in src/diagnostics.ts still says 几十 KB,
and the unreachable-gateway test connects to a port it has just freed,
which another listener could take in between.
A model a routing group keeps out of /v1/models (Group.Unlists, which magpie
still serves) was taken for gone: the page's model list was disabled and
tasks failed with "模型 X 已不在 Magpie 的模型列表里" without sending.
window-warmup now also reads each provider's chosen models (providers.json
"models") and counts a model as present when it is in /v1/models or chosen:
in the catalog (fetchCatalog/accountsOf), the auto-model pick and a fixed
model's send check. A model known only from chosen has no effort metadata, so
it goes without reasoning_effort. A model in neither is still refused.
Two gateway-unreachable tests now check the error is passed through rather
than its exact wording, which varies with Bun's socket timing.
Review: window-warmup lives in this repo since #661
(packages/window-warmup) and is published to the dist branch, not npm. 0.1.1
is free (main and dist have 0.1.0). Not mover-backed. No new host,
credential, dependency or workflow change; providers.json was already read
and only its "models" list is added (no key text). magpie's Group.Unlists
doc confirms "a request naming one is still served". dist/plugin.js matches
a rebuild of src (dist.test.ts, run on Bun 1.4.2).
Run at 8f10bc07 on mote (Bun 1.4.2, HOME a temp dir as CI): bun test
packages/window-warmup 246 pass 1 skip (browser smoke) 0 fail;
bun scripts/check.mjs exit 0. PR CI green.
Broken by hand: layer 3 without chosen, candidates without chosen, the fixed
model check without chosen, the auto pick needing /v1/models, and entryOf
dropping "models" each turn their new test red. fetchCatalog not passing
chosen is caught only by the dist byte check, not by a behaviour test.
Not tried: a real magpie with an unlisting group (the author ran it on a
Docker magpie with zcode GLM-5.3). A switched-off provider's chosen models
also count as present now, so its old tasks send and get the gateway's
error instead of the local one.
Adds packages/window-warmup (@magpie-community/page-window-warmup 0.1.0), by YangHonghang:
a page plugin whose host part runs a service on 127.0.0.1:3492 and, on a schedule
(after a quota window resets, daily at a set time, or every N hours), sends "hi"
with max_tokens 16 through magpie's gateway to a provider/account/model the user picks.
The registry entry moves from the author's own npm package magpie-window-warmup to this one.
The package README opens with the zh/en warning that sends spend real quota and that some
vendors (Claude subscriptions especially) may treat scheduled requests as unusual use.
Reviewed at 07a0b217adb2a111f839c984cbc955c5bb45b68d:
- Outside packages/window-warmup only README.md and registry.json change; no workflow and no other package.
- The service binds 127.0.0.1, checks Host (DNS rebinding) and Origin (null or itself),
needs a per-process 32-byte token on /api/*, and serves the index with a nonce CSP.
- It reaches only MAGPIE_ADDR (default 127.0.0.1:3425). providers.json is read for sha256
key fingerprints only; no spawn, eval or outside hosts.
- A window task sends at most once per resetsAt (or once per hour when idle); daily/every
tasks catch up only the latest missed point, once.
Run on mote (bun 1.4.2):
- HOME=$(mktemp -d) bun test at the repo root: 5142 pass, 15 skip, 0 fail.
- scripts/check.mjs ok.
- packages/window-warmup bun test: 242 pass (dist.test rebuilds dist byte for byte).
- browser.test.ts with Playwright 1.62.0: chromium and webkit pass. Bun ignores NODE_PATH,
so it needs node_modules/playwright linked and PLAYWRIGHT_BROWSERS_PATH set under a temp HOME;
without them it skips.
Not tried: a real send through a live magpie gateway, and tsc --noEmit (no typescript on mote).