Reported by 1007cordon-ux in #605: every chat with 0.1.0 failed at the
round step with "妙手 round 失败:HTTP 200 code=400 msg=source 不存在或未启用:
CatPawCLI". The 10-09 capture the package was built from was the CatPaw
CLI's (source CatPawCLI, mode CLI, m-appkey com.sankuai.mcopilot.cli); the
gateway no longer serves that source. The reporter changed both bodies to
source CatX / mode CATX_APP, kept the headers, and got a normal completion
from catpaw/glm-5.3-flashx through a real gateway request. That is the
combination the package README documented from the start, and the same
author's magpie-catpaw-auth 0.2.3 on npm sends it with these same headers.
- index.mjs: one frozen BODY_IDENTITY ({source: "CatX", mode: "CATX_APP"})
spread into both the round and the turn body, so they can't differ.
Headers unchanged (m-appkey com.sankuai.mcopilot.cli, x-agent-version
1.2.0-beta.6, axios UA).
- fake.mjs: answers a disabled source (CatPawCLI) with HTTP 200
{code: 400, msg: "source 不存在或未启用: <source>"}, the body behind the
report, and refuses a turn whose source/mode differ from its round's.
- testdata/issue-605.json holds the reporter's line verbatim; a test checks
that the fake's refusal, put through the plugin's round error format, is
that line byte for byte.
- README: the protocol note says why the body isn't the capture's.
Not confirmed: whether the official CatX desktop app sends a different
m-appkey or x-agent-version. No official client is on npm, and the
CatPaw sites offer no download without signing in, so the headers stay the
captured CLI's (the reporter's verified combination).
Run on mote at this tree (mote-run -C the worktree):
- bun test packages/catpaw: 28 pass, 0 fail
- HOME=$(mktemp -d) bun test (root): 4550 pass, 9 skip, 0 fail, 352 files
- bun scripts/check.mjs: exit 0 (catpaw ✓)
Broken by hand, then restored:
- BODY_IDENTITY back to CatPawCLI/CLI: 9 fail, each chat error the
reporter's exact text ("妙手 round 失败:HTTP 200 code=400
msg=source 不存在或未启用: CatPawCLI").
- only the turn body back to CatPawCLI/CLI: 5 fail.
Not tried: a real CatPaw account (none available); the fix rests on the
reporter's real request.
Adds packages/catpaw (Meituan CatPaw): sign-in, paste-token sign-in, models, chat and usage. Hosts: ai.catpaw.meituan.com and catx.nocode.cn only; no dependencies or scripts; captures redacted.
Answers the 10-17 review: the request body's source/mode is CatPawCLI/CLI, matching the captured CLI round (testdata/captured-round.json, captured-turn.json) and enforced by the fake; the non-stream usage block that wasn't in the capture is gone; a no-credit error keeps the sign-in; the paste method returns a callback as the host calls it.
Run at 475979a (PR head 71f36ce with origin/main merged, loomy #175 included; registry.json conflict resolved keeping both entries), on mote with a sandbox HOME:
- bun test packages/catpaw: 24 pass, 0 fail
- bun scripts/check.mjs: exit 0 (catpaw ✓); bun test scripts: 3 pass, 0 fail
- Broken by hand, then restored: identity reverted to CatX/CATX_APP (8 fail), paste callback reverted (1 fail). The no-credit signIn:"kept" has no test (removing it stays green).
Not tried: a real CatPaw account. Not on npm yet: served from the dist branch until the first version is published by hand.