Files
plugins/packages/zcode/package.json
T
yetone 44036e2fcc zcode 0.1.21: a Start Plan request sends the agent's system prompt at the end of ZCode's third system block, not as a fourth (#343)
fordlyn's report: on a Start Plan account zcode.z.ai now answers every
request whose system has more than three blocks with 405
{"code":3012,"msg":"request has been blocked due to unusual activity."}.
dress() put ZCode's three cached blocks first and then the agent's own
system texts as blocks 4, 5, ..., so every agent (all of them send a
system prompt) was turned away; only a system-less request passed.

What ZCode does, read from ZCode.app 3.14.3's glm/zcode.cjs
(ContextBuilder.assembleSystemMessages): it sends at most three system
messages, the cli_prefix section, the stable sections, and every dynamic
system section joined with "\n\n" into a third block that starts with
"\n\n". A section added to the builder (addSection) is dynamic by
default, so ZCode's own extra system text lands in the third block.
dress() now does the same: the agent's non-blank text blocks are joined
with "\n\n" after afterEnvironment in the third block, which keeps its
cache mark. The first two blocks stay byte for byte ZCode's, as the
issue's bisect requires. GLM Coding Plan and team requests are not
dressed and are unchanged.

Run: TMPDIR=<scratch> HOME=<scratch>/home bun test (2341 pass, 0 fail);
bun scripts/check.mjs (all ok). The new #343 test in start.test.mjs and
four updated layout tests are red on the old index.mjs (5 of 12 fail).
Not tried against the real API: no Start Plan account at hand. The
reporter's own harness got 200 for this shape (system "x", system plus
tools, 32 KB system, multi-turn).
2026-10-23 23:22:58 +08:00

17 lines
636 B
JSON

{
"name": "@magpie-community/opencode-zcode-auth",
"version": "0.1.21",
"description": "OpenCode provider plugin: signs in to Z.ai's or BigModel's (智谱) GLM Coding Plan as ZCode does, including team seats and ZCode's Start Plan",
"type": "module",
"main": "./index.mjs",
"exports": "./index.mjs",
"files": ["index.mjs", "prompt.mjs", "README.md"],
"keywords": ["opencode", "opencode-plugin", "magpie", "zcode", "z.ai", "bigmodel", "glm", "coding-plan"],
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/magpie-community/plugins.git",
"directory": "packages/zcode"
}
}