• 请不要在回答技术问题时复制粘贴 AI 生成的内容
bwnjnOEI
V2EX  ›  程序员

你们在 zcode v3.3.3 使用 opencode go glm-5.2 出问题了吗?

  •  
  •   bwnjnOEI · 2h 25m ago · 157 views

    前提不使用任何 LLM Gateway

    如题,今天出问题了 zcode 加了字段 opencode 那边不认

    ZCode 报错信息
    
    报错摘要
    Error from provider: Extra inputs are not permitted, field: 'extra_body'
    
    TraceID: a3c0beb8-c0db-4d7f-a8f7-b2fd7e44f26a
    
    报错详情
    Turn execution failed
    provider=e6946690-f10b-4b8d-8fd1-4fe4895658ff provider_code=invalid_request_error model=glm-5.2 request=ba64ec8b-2a19-4db1-8391-f76b18f5d290 reason=invalid_request status=400 retryable=false
    

    让 cc opus 修复了内容如下,发给你的 agent 让他帮你修,替你省 token:

    做了什么
    备份了原始文件:/opt/ZCode/resources/glm/zcode.cjs.bak
    
    Patch 了 hbn() 函数( zcode.cjs 位置 ~1958824 ):
    
    之前:extra_body: { chat_template_kwargs: { reasoning_effort: "max" } } → 被展开到请求体顶层,opencode 代理不认
    之后:reasoningEffort: "max" → 标准 OpenAI 兼容字段,被 AI SDK 提取为 reasoning_effort
    Patch 了 fPo() 函数(位置 ~8919210 ):
    
    "off" 推理级别的 extra_body: { thinking: { type: "disabled" } } → reasoningEffort: "low"
    config.json 也保留了 reasoning 配置(作为额外保护层,虽然实际上被 bbn defaults 覆盖了)
    
    为什么 config.json 单独不够
    ZCode 的 bbn 模型默认配置数组中有两条规则匹配 glm-5.2:
    
    glm-thinking-toggle (匹配所有含 "glm" 的模型)
    glm-5.2-reasoning-depth (匹配 glm-5.2 )
    两条都设置了 replaceReasoning: true ,在 AZt() 函数中强制覆盖 config.json 中的 reasoning 配置。所以必须 patch 源码。
    

    也不知道 glm coding plan 买不到用别人家的也不让用是怎么个意思?

    另外你还需生成配套的升级防覆盖脚本

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1173 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 17:56 · PVG 01:56 · LAX 10:56 · JFK 13:56
    ♥ Do have faith in what you're doing.