Files
plugins/packages/kimi-work/tests/fixtures
yetone df552949e1 kimi-work 0.1.9: the menu is asked with the desktop's headers, so K3.1 Pro (k3d1-agent) is listed
泠夜Soul (Discord) has a Kimi Work membership whose desktop picks
K3.1 Pro, model id k3d1-agent, and magpie's Kimi Work list leaves it
out, on 0.1.7/0.1.8 too, which read DescribeKimiWorkConfig for this.

Cause, seen on the live endpoint (it answers without a sign-in):
DescribeKimiWorkConfig chooses the menu by the caller's x-msh-* headers.
Asked with none, as the plugin asked it (only User-Agent kimi-code-cli),
it answers with the web menu: k3-agent, k3-agent-swarm, k2d8-preview.
Asked as the desktop asks it (x-msh-platform mac or windows, as Kimi's
Connect interceptor sends from the desktop, with x-msh-version), it
answers k3d1-agent "K3.1 Pro", k2d8-preview, k3-agent. Five tries each,
stable. So the menu code was right and its reply was the web's.

What changed:
- www.kimi.com/apiv2 calls (the menu and GetSubscriptionStats, as the
  desktop's interceptor puts them on every apiv2 call) carry
  x-msh-platform (mac on macOS, windows on Windows, web elsewhere, as the
  desktop's own rule), x-msh-version 3.2.20 (the desktop build 0.1.8's
  headers came from) and R-Timezone. agent-gw's headers are unchanged.
- A menu row's reply limit is its requestParams.maxTokens (32768 for
  every model listed today, the value that was hard-coded).
- tests/fixtures/work-config.mac.json and work-config.web.json are the
  two literal replies, captured signed out on 10-24. The new tests have a
  fake that answers as the server does (desktop menu only for mac or
  windows) and check that k3d1-agent is listed as "K3.1 Pro" with
  low/high/max, 262144 context and 32768 output, on darwin and win32.

Run at this tree (origin/main 79e383c + this change), macOS, bun 1.4.2:
- bun test packages/kimi-work: 50 pass, 0 fail. With webHeaders(platform)
  put back to {'User-Agent':UA} by hand: 49 pass, 1 fail (the new menu
  test), so it fails without the fix.
- Live: createPlugin's own provider.models against the real
  DescribeKimiWorkConfig (Authorization taken out, no account here):
  darwin, win32 and linux list k3d1-agent, k2d8-preview, k3-agent. The
  same script on origin/main's index.mjs lists k3-agent, k3-agent-swarm,
  k2d8-preview on all three.
- HOME=$(mktemp -d) bun test: 2446 pass, 1 fail; the fail is layerfs's
  afterAll cleanup timing out at 5s at load ~500 (2 of 3 red alone,
  layerfs untouched), filed as #362.
- bun scripts/check.mjs: every plugin ok. git diff --check clean.

Not tried: a signed-in Work account (none on this machine), so neither
the signed-in menu nor a chat request with k3d1-agent through agent-gw
has been seen; the signed-out menu already lists k3d1-agent, so whether
a tier without it is refused is up to agent-gw. Not changed: the
User-Agent on www.kimi.com is still Kimi Code's, not the desktop
renderer's, which hasn't been captured (#363).
2026-10-24 19:14:00 +08:00
..