StockRabbit (#615): with the WorkBuddy account 北冥 picked, every sample
failed with "Header 'X-Magpie-Account' has invalid value", since fetch
refuses a header value that isn't ASCII. The saved job also didn't say
which account it ran on.
- gateway.ts: accountHeader() sends printable ASCII as it is and any other
name percent-encoded; magpie v0.1.2658 (ad53a23dc) decodes it. The
account list now names an account by its alias or user, not by the
provider's display name.
- detector.ts: a target's account resolves to the account's id (by id or
a unique name for that model's provider), and the job keeps
config.account / config.accountName and results[].target.account /
accountName. Jobs written before 0.2.2 have neither and load unchanged.
- web: the result card names the account.
- integration.md: the header's encoding and a Job files section.
Run (mote, sandbox HOME): bun install --frozen-lockfile, bun run
typecheck, bun test (36 pass, 0 fail), bun run build, bun scripts/check.mjs
(exit 0). tests/account.test.ts runs the server against a fake gateway
whose quotas list 北冥: an 0.2.1 job loads unchanged, a run pinned to 北冥
reaches the gateway as %E5%8C%97%E5%86%A5 on every request, and the job
file names 北冥. The page on mote in Chromium and WebKit at 420px against
the same fake gateway: the picker shows "北冥 · workbuddy", 12 requests
carry the encoded header, the card says 北冥.
Broken by hand: accountHeader returning the raw name turns account.test
red (no request reaches the gateway pinned).
Not tried: a real WorkBuddy account, Windows, the page in a language other
than English.