zai-org / zai-org/feedback

[Bug] Muse Spark 1.2 Contributor via OpenCode Go fails with `name must be at most 64 characters, got 67` in ZCode but works in Pi Agent

Open
#368 2 comments 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

问题描述 · Description

通过 OpenCode Go (https://opencode.ai/zen/go) 渠道调用 Muse Spark 1.2 Contributor (muse-spark-1.2-contributor) 时,在 ZCode 中稳定复现 400 invalid_request,错误信息为上游 name must be at most 64 characters, got 67同一渠道、同一模型在 Pi Agent 中完全正常,且关闭 ZCode 全部 MCP 后问题依然存在,说明很可能与 ZCode 自身注入的内置工具 / Agent 名 / Responses API 适配逻辑有关,而非用户 MCP 配置问题。

This is a clean cross-agent control experiment:

  • Same provider (OpenCode Go) + same model (muse-spark-1.2-contributor)
  • Pi Agent → OK vs ZCode → 400 invalid_request (name=67)

A nearly identical error (got 67 on muse-spark-1.2-contributor via opencode.ai/zen/go/v1/responses) has been reported in anomalyco/opencode#43714, suggesting the upstream /v1/responses endpoint has a strict 64-char name limit that some caller is violating.

Significant regression: this exact configuration was working normally earlier the same day without any ZCode update or provider config change. The next task suddenly started failing consistently.


复现步骤 · Steps to reproduce
  1. 配置 Provider 为 OpenCode Gohttps://opencode.ai/zen/go / https://opencode.ai/zen/go/v1/responses
  2. 模型选择 Muse Spark 1.2 Contributor (muse-spark-1.2-contributor)
  3. 在 ZCode (v3.9.1) 中新建任务,使用该模型发起任意对话(即使是简单的 hello
  4. 观察 Turn execution failed 弹窗
  5. 打开 设置 → MCP,禁用 全部 MCP servers,重启任务后重试 → 依然复现
  6. Pi Agent 中使用 完全相同的 Provider + 模型 发起同样对话 → 正常返回,无报错

Reproducibility: 必现 · Always (multiple retries in ZCode all return the same 400)


期望表现 · Expected behavior

与 Pi Agent 行为一致:请求应正常发往 opencode.ai/zen/go/v1/responses 并返回模型输出,不应因 name 字段长度触发 400 invalid_request

Should behave identically to Pi Agent — no name length violation.


实际表现 · Actual behavior

ZCode 前台:

Turn execution failed
reason=invalid_request
status=400
retryable=false

ZCode Console / Provider 日志:

Error from provider (Console Go): Upstream request failed:
[invalid_request_error] `name` must be at most 64 characters, got 67
  • HTTP 400, param: name, type: invalid_request_error
  • 关闭全部 MCP 后依然稳定复现
  • Pi Agent 同配置无此问题

环境 · Environment
  • ZCode 版本 · ZCode version: 3.9.1 (FileVersion 3.9.1.5853, D:\Users\TX\AppData\Local\Programs\ZCode\ZCode.exe)
  • 系统 · OS: Windows 11 家庭版 中文版 10.0.26200
  • Provider: OpenCode Go (https://opencode.ai/zen/go, endpoint https://opencode.ai/zen/go/v1/responses)
  • Model: muse-spark-1.2-contributor
  • Agent 框架 · Framework: opencode (OpenCode Go 托管, 非本地 opencode)
  • 此前状态: 同一配置当天早些时候正常工作;未更新 ZCode、未修改 Provider 配置,突然开始必现

对照实验 · Control experiment (关键证据)
维度 ZCode Pi Agent
Provider OpenCode Go OpenCode Go (same)
Model muse-spark-1.2-contributor muse-spark-1.2-contributor (same)
MCP 全部禁用后仍失败
结果 400 name must be at most 64 chars, got 67 正常

This isolates the problem to how ZCode constructs the Responses API request (built-in tools / agent name / structured output schema / Responses API adapter), not the provider itself.


关联 Issue · Related
  • anomalyco/opencode#43714 — Responses API Error — 完全相同的错误muse-spark-1.2-contributor + opencode.ai/zen/go/v1/responses + name must be at most 64 characters, got 67https://github.com/anomalyco/opencode/issues/43714
  • 本仓库搜索:未找到与 Muse Spark + got 67 重复的 ZCode issue(按官方建议提交至 zai-org/feedback

截图 / 日志 · Screenshots / Logs

建议审核时通过 ZCode → Export Logs 导出完整请求日志,重点查看发往 /v1/responses 的请求体中所有 name 字段(tools[].function.name / tool.name / structured output name 等),定位固定 67 字符的违规名称。

Upstream request failed: [invalid_request_error] `name` must be at most 64 characters, got 67
model=muse-spark-1.2-contributor
endpoint=https://opencode.ai/zen/go/v1/responses

如需,我可补充脱敏后的 Export Logs 片段。


开发者建议 · Suggestion for triage

请重点检查 ZCode 在 opencode 框架下发往 /v1/responses 的请求中以下几类 name 是否存在超长(67 字符)情况:

  1. 内置工具定义(即使 MCP 全关也会注入的工具)
  2. Agent 名称 / 会话名称 透传为 name
  3. 结构化输出 / JSON Schema 的 name / function
  4. Responses API 适配层是否对名称做了拼接(如 prefix + toolName 导致溢出)

由于 Pi Agent 同模型正常,可对比两者实际发出的请求体差异,快速定位 ZCode 多注入的那个 67 字符 name


提交前确认 · Pre-submission checklist
  • 已搜索现有 issue,确认非重复 / Searched existing issues, not a duplicate
  • 已阅读 CONTRIBUTING.md / Read CONTRIBUTING.md
分类 · Category
  • 对话 / Agent 交互 · Agent chat + 工具调用 / MCP · Tool use / MCP + 模型设置 / 切换 · Model config
严重程度 · Severity

阻塞使用 · Blocking — 核心模型完全不可用(core function unusable, 100% repro)

复现频率 · Reproducibility

必现 · 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 exporting ZCode logs and inspecting the request body sent to the /v1/responses endpoint, especially tools[].function.name, tool.name, and structured-output names. Compare the request with the working Pi Agent case, then trace the Responses API adapter or request-construction entry point that produces the 67-character value. Done means the request contains no name over 64 characters and the reported model completes successfully.

Written by the indexing model from the issue text.

Assessment

Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.