Files
plugins/packages/autoclaw/package.json
T
EuraxluoandHuHong_Tao f6adc99a9c autoclaw 0.2.1: CN managed gateway, request shaping on both paths, OAuth guide opened by the host (#197)
Brings together #191 (CN managed gateway), #196 (request shaping and identity lines) and the #183 sign-in fix.

- autoclaw-cn chat goes to AutoClaw 2.1.0's managed gateway (autoglm-acceleration-api.zhipuai.cn/autoclaw-proxy/proxy/autoclaw/chat/completions, on Zhipu's domain) with 2.1.0's headers and its four-model catalog. A 401/403 there marks the sign-in expired.
- Both providers get the same request shaping:
  - the official one-sentence system prefix, merged into the caller's system message (string or array);
  - max_tokens and max_completion_tokens dropped;
  - other agents' identity lines in system/developer messages rewritten (FLAGGED/unflag, from #196);
  - no X-Harness-Type.
- On the overseas path, a 406 explains itself and keeps the sign-in. Overseas chat now sends AutoClaw's own User-Agent instead of the host's. Its catalog drops zai_glm-5-turbo and the tdpsk models (400 upstream) and keeps the old limits.
- Overseas OAuth: authorize returns the loopback guide URL once the listener is up, and the host opens it, so there is no shell spawn any more. Navigating to the authorization page no longer aborts the session.
- autoclaw 0.2.0 -> 0.2.1.

What was run at 1fe91be (reviewer):
- bun test packages/autoclaw: 21 pass, 0 fail. bun scripts/check.mjs autoclaw: ok. git diff --check: clean. Merges cleanly onto main.
- magpie plugin host (magpie main cb05dc2d1), sandbox HOME, with a copy whose three hosts point at a local fake:
  - overseas: authorize gave http://127.0.0.1:18432/, the guide returned 200, and /open-auth plus /auth/callback-google finished the sign-in;
  - CN: SMS sign-in worked;
  - streamed chat on both providers returned 200;
  - the fake received the prefix with "You are Claude Code" rewritten and no max_tokens on both paths; User-Agent AutoClaw/2.1.0 on CN and AutoClaw/1.18.1 overseas; no X-Harness-Type.
- Not tried: real accounts or the live gateways (no credentials used).

Co-authored-by: HuHong_Tao <3596843010@qq.com>
2026-10-17 16:59:42 +08:00

35 lines
1.0 KiB
JSON

{
"name": "@magpie-community/opencode-autoclaw-auth",
"version": "0.2.1",
"description": "OpenCode provider plugin for AutoClaw (Zhipu OpenClaw): oversea web sign-in (Google/z.ai) and CN phone SMS, multi-account pool, credit balance and daily check-in",
"type": "module",
"main": "./index.mjs",
"exports": "./index.mjs",
"files": [
"index.mjs",
"README.md"
],
"keywords": [
"opencode",
"opencode-plugin",
"magpie",
"autoclaw",
"zhipu",
"glm"
],
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/magpie-community/plugins.git",
"directory": "packages/autoclaw"
},
"magpie": {
"icon": "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Ccircle cx='32' cy='32' r='30' fill='%234f6ef7'/%3E%3Ctext x='32' y='42' font-size='28' text-anchor='middle' fill='white' font-family='sans-serif'%3E%E8%9F%B9%3C/text%3E%3C/svg%3E",
"options": {
"signin": true,
"signinHour": null,
"signinOnUsage": false
}
}
}