unifilitence (plugins#443, Windows 11 x64, qoder.com) captured a chat
going out with the account's machine UUID as Cosy-ClientIp,
Cosy-MachineId and Cosy-MachineToken alike, Cosy-MachineType 5 and
Cosy-MachineOS x86_64_win32, and asked for each to be what Qoder's own
client sends.
Checked against Qoder.app 0.4.3: its worker runtime
(qoder-agent-sdk/dist/_worker) and the auth wasm it embeds, run here
with its own inputs:
- Cosy-MachineOS is `${x64->x86_64, arm64->aarch64, else arch}_${platform}`,
so x86_64_win32 is Qoder's own value. Only ia32 differed: the plugin
sent x86_win32, Qoder sends ia32_win32. Fixed.
- Its non-chat calls (prepareRequest) do send ClientIp, MachineId and
MachineToken all as the machine id, MachineType 5. The listing, usage
and queue status keep that set.
- A chat (prepareInferRequest, then its header pass) differs: no
Cosy-ClientIp; MachineToken and MachineType are the native device
identity's (umid runtime-info) or absent when there is none; and a
Cosy-MachineHostname, os.hostname() made safe as its zei does
(punycode, else "-" runs plus a sha256 mark, 96 chars at most). A chat
now goes so. The identity is one the check-in already read in this
process (renewed behind the chat after an hour); a chat never runs the
helper itself, so with no check-in yet it goes without, as Qoder does
when it has no identity.
- The signed payload's requestId is a dashed UUID in Qoder's signer; the
plugin sent it undashed. ideVersion "" is Qoder's own.
Left as it was: Accept-Encoding identity on a chat (Qoder sets none;
its fetch's default differs from Bun's anyway).
Run: packages/qoder `bun test` (276 pass, new headers.test.mjs and one
check-in test); `bun scripts/check.mjs` all green. Real qoder.com
account from bun in a sandbox HOME (token not renewed, no auth.set):
qfmodel answered "pong" with the new chat headers, dfmodel queued
(10605, as before), the model list 200.
Broken by hand: index.mjs at HEAD with the new tests: 6 of 7 in
headers.test.mjs and the check-in chat test red.
Not tried: Windows (the hostname and OS values are unit-tested for
it); a chat carrying a real device identity against the live service.