zai-org / zai-org/feedback

[Bug] ZCode 3.7.7 (macOS arm64) host 进程登录后 60 秒内必崩 exit 6:账号含生效中 Start Plan/off-peak 权益时,getOffPeakClientConfig 触发原生内存分配失败(8GiB)

Open
#278 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

提交前确认 · Pre-submission checklist
✅ 已搜索现有 issue,非重复(与 #51 的 EPIPE/黑屏、#34 的 context canceled 均不同)
✅ 已阅读 CONTRIBUTING.md
问题类别 · Category
稳定性 / 崩溃 · Stability / Crash

涉及的 Agent 框架 · Agent framework
ZCode Agent(自研)

严重程度 · Severity
阻塞使用 · Blocking(登录后无法进行任何对话,核心功能完全不可用)

复现频率 · Reproducibility
必现 · Always(登录后 100% 在 60 秒内崩溃)

问题描述 · Description
ZCode 3.7.7 桌面版(macOS arm64),OAuth 登录成功后约 60 秒内,host 进程 zcode-host-local-1(Electron Utility / node.mojom.NodeService)原生崩溃,exit code 6。崩溃后所有会话请求返回 "ZCode Agent runtime is not running",对话无法打开、无法发送消息、模型选择器不可用。

日志关键证据:

contained host allocation failure from native TLS callback {"external":8604898499 (~8GiB), "heapUsed":~46MB, "message":"Failed to allocate memory"} —— V8 external 内存计数器瞬间被打到约 8.6GB(恰为物理内存 16GB 的一半),而实际 RSS 仅 ~250MB
所有后续原生分配失败:RangeError: Failed to allocate memory,堆栈在 BrotliDecompress / createUnsafeBuffer / readFileHandle
崩溃点稳定落在 coding-plan / off-peak 相关 RPC:coding-plan-subscription.getOffPeakClientConfig、getEnterprisePricing、getStaticTeamProducts、getBillingDiscount
触发条件与账号权益强相关:billing/balance 返回 hasActiveStartPlan: true 且权益 ID 为 ent_start_0815_glm(2026-08-15 生效的 Start Plan,即 8/11 新上线的闲时任务/off-peak 权益)时必崩
已排除(均有对照实验):

网络问题:直连与代理下均复现;彻底断网(强制代理指向 127.0.0.1:1,所有请求秒失败)仍复现 → 不需要任何服务器响应
本地数据污染:全新安装(app.asar 与官方 update.zip MD5 一致)+ 清空 ~/.zcode + 清空 ~/Library/Application Support/ZCode、Preferences、HTTPStorages、Caches 后登录仍复现
早期另有独立的 config.json provider 条目损坏问题(已通过重置解决,与本 issue 无关)
时间线佐证:8月10日–14日同版本零崩溃;8月15日 20:11 起首次崩溃;当晚新权益生效后变为登录必崩。

复现步骤 · Steps to reproduce
macOS arm64 安装 ZCode 3.7.7(当前最新版)
使用一个含有生效中 Start Plan / 闲时任务(off-peak)权益的 GLM Coding Plan 账号 OAuth 登录
登录成功后不做任何操作,等待约 60 秒
host 进程崩溃(日志:host process (local-1) exited with code 6),UI 全部会话功能失效
期望表现 · Expected behavior
登录后 host 稳定运行,可正常选择模型并发送消息。

实际表现 · Actual behavior
登录后 60 秒内 host 原生崩溃,exit 6;每次重启重复同样崩溃;应用不可用。删除 pending 崩溃转储(~/.zcode/v2/crash/live/pending/*.dmp)后重启可短暂存活数分钟。

ZCode 版本 · ZCode version
3.7.7(desktop,2026-08-14 发布;此前 3.7.6 及更早未观察到此崩溃)

设备 / 系统 / 浏览器 · Device / OS / Browser
Mac mini (Apple Silicon, arm64, 16GB RAM),macOS(系统内存充足,崩溃时全系统内存占用约 20%)

截图 / 录屏 / 日志 · Screenshots / Recordings / Logs
崩溃转储:/.zcode/v2/crash/archive/*.dmp(crash-capture 已自动归档多个)
日志:
/.zcode/v2/logs/2026-08-15.log、2026-08-16.log(含完整 allocation failure 记录与 RPC 崩点)
典型日志行: [host-log] contained host allocation failure from native TLS callback {"external":8604978323,"heapUsed":49593504,"message":"Failed to allocate memory"} [crash-capture] child-process-gone: {"type":"Utility","reason":"crashed","exitCode":6,"serviceName":"node.mojom.NodeService","name":"zcode-host-local-1"}
可按需提供完整日志压缩包

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 reviewing ~/.zcode/v2/logs/2026-08-15.log and 2026-08-16.log alongside the archived crash dumps in ~/.zcode/v2/crash/archive/. Reproduce the crash with an account having the active Start Plan/off-peak entitlement and inspect the getOffPeakClientConfig-related host failure. Done means the host remains stable after login and conversations, model selection, and message sending work normally.

Written by the indexing model from the issue text.

Assessment

Tech stack
electron, node.js
Domain
desktop
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.