zcode: Start Plan requests go as ZCode's own, with its headers and system prompt (0.1.7) (#5)

ARNO on Discord: the plugin's Start Plan requests were answered 405 / 3012
"blocked due to unusual activity" while his own plugin (Freeflow, provider
zcode-start) worked from the same machine. zcode.z.ai serves the plan only
to what looks like ZCode's own request: a Start Plan request now carries
ZCode's headers and its body is dressed as ZCode's (three cached system
blocks, the environment section, the date reminder as the first turn, one
cache mark on the last block, metadata.user_id naming the sign-in's
device). The prompt texts are magpie's (901fd87e), each matching ARNO's
plugin's hash. Coding Plan and team requests are unchanged. The Start Plan
is advertised again.
This commit is contained in:
yetone
2026-10-02 19:28:42 +08:00
committed by GitHub
parent 8c7e31911e
commit cc57432d16
7 changed files with 455 additions and 29 deletions
+9 -9
View File
@@ -16,17 +16,17 @@ over Anthropic's Messages API. Provider id: `zcode`.
`open.bigmodel.cn/api/anthropic`.
- If the account has no plan of its own, it looks for a seat on a team's
plan and uses that team project's `zcode-team-api-key`.
- Failing both, it tries ZCode's free **Start Plan**, served by zcode.z.ai
with ZCode's session token and ZCode's own headers.
- Failing both, it uses ZCode's free **Start Plan**, served by zcode.z.ai
with ZCode's session token.
- zcode.z.ai serves the Start Plan only to requests that look like the
ZCode client's own, and refuses others with HTTP 405 "request has been
blocked due to unusual activity". So a Start Plan request goes as
ZCode's does: ZCode's headers, ZCode's system prompt ahead of the
agent's, the day in a `<system-reminder>` turn before the agent's
turns, and the sign-in's device id in `metadata.user_id`. GLM Coding
Plan and team requests go as the agent sent them.
- The Start Plan's token can't be refreshed. When it runs out, sign in
again.
> **ZCode's free Start Plan (and its trial) can't be used through this
> plugin.** zcode.z.ai only serves that plan to requests carrying the
> official ZCode client's own system prompt, and refuses others with
> HTTP 405 "request has been blocked due to unusual activity". The plugin
> (like magpie) never rewrites prompts or poses as the official client, so
> a GLM Coding Plan — your own or a team seat — is needed.
- **ZCode app's sign-in**
- Uses the account the ZCode app on this computer is signed in to. For
every request it reads ZCode's own credentials (`~/.zcode/v2`), so it