Files
plugins/packages/catpaw/package.json
T
yetone 8db0a0576a catpaw 0.1.1: round and turn send source CatX / mode CATX_APP; the gateway turned CatPawCLI off (#605)
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.
2026-11-02 00:10:44 +08:00

27 lines
712 B
JSON

{
"name": "@magpie-community/opencode-catpaw-auth",
"version": "0.1.1",
"description": "OpenCode & Magpie provider plugin for Meituan's 妙手 CatPaw (ai.catpaw.meituan.com): web sign-in or the desktop client's saved credentials, chat through the round/event/turn protocol, models and credit balance",
"type": "module",
"main": "./index.mjs",
"exports": "./index.mjs",
"files": [
"index.mjs",
"README.md"
],
"keywords": [
"opencode",
"opencode-plugin",
"magpie",
"catpaw",
"meituan",
"妙手"
],
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/magpie-community/plugins.git",
"directory": "packages/catpaw"
}
}