zai-org / zai-org/feedback

[建议] 默认系统提示词包含与 Claude Code 逐字一致的样板句,易被第三方网关签名风控误伤(新会话首轮 400)

Open Beginner friendly
#679 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

priority: P2
Dominant language
No language data
Stars
22
Forks
1
PR merge metrics
No merged PRs in 30d

Description

类别 Category: 模型设置 / 切换 · Model config | 框架 Framework: ZCode Agent(自研) | 严重程度 Severity: 影响体验 · Major | 频率 Frequency: 必现 · Always

建议 · Suggestion

ZCode 默认完整系统提示词的 gitStatus 段使用了与 Claude Code 逐字一致的样板句:

Main branch (you will usually use this for PRs): main

zcode.cjs 内唯一模板常量,每个新会话首轮的完整系统提示词都会包含。)实测有第三方 OpenAI 兼容网关按该句做 agent 指纹签名风控:请求文本包含该句即返回 400 code 11128 "Illegal API invocation from an unapproved channel"

验证证据 · Evidence

对同一份 91KB 真实请求体做单变量对照(多次重复、结果确定):

  • 原文(系统提示词含该句)→ 必被拦截(400/11128);
  • 仅把该句改写为 Main branch (for pull requests),其余 90KB+ 内容不变 → 通过;
  • 同账号、同一时刻,不含该句的请求(标题生成、长会话后续轮次的精简投影)均正常。

影响 · Impact

  1. 通过自定义 openai-compatible provider 接入做了类似风控的第三方网关时,ZCode 新会话首轮必被拦(完整系统提示词必含该句),且错误被归类为不可重试,整轮直接失败,用户侧表现为"新会话不可用、老会话正常",非常难排查;
  2. 该句使 ZCode 流量被识别/降级为 Claude Code 客户端——对 ZCode 的生态独立性与用户流量公平性都不利。

建议 · Suggested fix

对默认提示词中的 Claude Code 原版样板句做轻度改写(例如 Main branch (for pull requests))或替换为 ZCode 特有措辞,避免与 Claude Code 逐字重合。改动成本极低(一处模板常量),可显著降低第三方网关误伤面。

环境 · Environment

  • ZCode Desktop 3.11.2 (6792) / CLI 0.16.5
  • macOS(darwin 25.5.0)arm64
  • 复现频率:在实施该类签名风控的网关上必现(Always)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the unique gitStatus template constant in zcode.cjs and inspect the line containing “Main branch (you will usually use this for PRs): main”. Replace that wording with the proposed ZCode-specific text, then verify that new-session request prompts no longer contain the original sentence and retain the rest of the prompt unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
ai
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
85/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.