autoclaw-cn's managed gateway (autoglm-acceleration-api.zhipuai.cn) answers
406 when the system text carries an agent identity line FLAGGED doesn't
cover. Two more entries, in the table's own style:
- "You are ZCode" (any case, anywhere; #245's probes) -> "You are the ZCode
agent". #245 found "You are an interactive ZCode agent ..." answered 200,
so the gateway reads the literal run, which the rewrite breaks.
- "operating inside pi, a coding agent harness" -> "operating inside the pi
coding agent harness" (#236). pi's line wasn't probed, so the rewrite
breaks both "inside pi" and "pi, a coding agent harness" and keeps pi's
name for the model.
Both rewrites are fixed strings, so the same prompt always leaves the same
way and a cached prefix stays put. Only system and developer messages are
rewritten, as before. Claude Code's entry is unchanged. REFUSED_HINT names
ZCode and pi.
No general fallback: agents such as opencode put the user's own AGENTS.md
into the system text, so a pattern like "You are X, a ... agent" would
rewrite the user's words, and nothing shows the gateway matches that shape.
Tests use each reporter's literal line: unflagged, unflag's role scoping
(ZCode in a system part rewritten, the same line in a user message and pi's
in a tool message untouched), and the CN managed path end to end.
Run (worktree at origin/main 47fbf63):
- bun test packages/autoclaw/: 23 pass, 0 fail
- bun scripts/check.mjs autoclaw: ok
- HOME=$(mktemp -d) bun test: 1808 pass, 1 fail, the trae stream.test
"connection reset" under the full suite (#124, open); packages/trae/
alone 160/160 three times
- broken by hand: ZCode entry removed -> 3 red; pi entry removed -> 2 red;
unflag's role check removed -> 2 red
- not tried against the real gateway: no autoclaw-cn account is signed in
here