Skip to content

[Bug] ZCode 3.1.6 (macOS, Apple Silicon) unusable via every entry point: desktop EPIPE + blank renderer; CLI missing @zcode/tui; CLI login "OAuth response is not valid JSON" (model & plan are fine) #51

Open

Description

@agentedeglobal-glitch

提交前确认 · Pre-submission checklist

  • 我已搜索过现有 issue,确认这不是重复 / I searched existing issues and confirmed this isn't a duplicate.
  • 我已阅读 CONTRIBUTING.md / I've read CONTRIBUTING.md.

问题类别 · Category

稳定性 / 崩溃 · Stability / Crash

涉及的 Agent 框架 · Agent framework

ZCode Agent(自研)

严重程度 · Severity

阻塞使用 · Blocking (无法使用核心功能 / core function unusable)

复现频率 · Reproducibility

必现 · Always

问题描述 · Description

Paid GLM Coding Lite subscriber. GLM-5.2 and the plan are healthy, but ZCode 3.1.6 fails through EVERY entry point — desktop GUI AND terminal CLI. 4 distinct, reproducible bugs:

  1. Desktop: write EPIPE on long / webReader tasks; work is lost; EPIPE is not retried.
  2. Desktop: blank/black renderer, even after a clean restart.
  3. CLI (TUI): missing package @zcode/tui (absent from the entire install).
  4. CLI login: OAuth response is not valid JSON (instant failure).

This is NOT quota / account / network / model: a direct call to the Anthropic-compatible endpoint returns HTTP 200, a long streaming reply completes cleanly with no EPIPE, the plan shows as "available", and quota is 96% (5h) / 99% (weekly) free. So the failures are inside the ZCode client / distribution. (Full evidence + IDs in the Logs field below.)

复现步骤 · Steps to reproduce

A) CLI login (clearest — instant):

  1. In Terminal, run: node "/Applications/ZCode.app/Contents/Resources/glm/zcode.cjs" login
  2. It fails immediately with: "Error: OAuth response is not valid JSON" (same with --no-browser; no browser ever opens).

B) CLI TUI:

  1. Run the CLI with no arguments (i.e. open the TUI).
  2. It fails with: "Cannot find package '@zcode/tui'".

C) Desktop EPIPE + blank renderer:

  1. Start a long task with webReader / high context (GLM-5.2) in the desktop app.
  2. After a while it dies with "Cannot connect to API: write EPIPE"; nothing is saved to disk.
  3. Reopen that conversation, or fully restart the app: the window stays blank and never renders the UI.

期望表现 · Expected behavior

  • Desktop runs long tasks without aborting (retry on transient socket close), and renders the UI after a restart.
  • The CLI TUI starts (the @zcode/tui package should be shipped in the distribution).
  • zcode login completes the OAuth flow successfully.

实际表现 · Actual behavior

  • Desktop: "Cannot connect to API: write EPIPE" (provider=builtin:zai-coding-plan, provider_code=EPIPE, retriable=false) on GLM-5.2 AND GLM-5-Turbo; sometimes shows "Worked for 0s"; unsaved work is lost. The window then stays blank/black after restart.
  • CLI (TUI): Error: Cannot find package '@zcode/tui' imported from /Applications/ZCode.app/Contents/Resources/glm/zcode.cjs
  • CLI login: Error: OAuth response is not valid JSON — instant, in a real TTY, repeated, never opens a browser. Because login fails, headless --prompt then fails with: "Model config is missing. Create ~/.zcode/cli/config.json ...".

ZCode 版本 · ZCode version

3.1.6 (desktop app); CLI bundle zcode.cjs 0.14.9

设备 / 系统 / 浏览器 · Device / OS / Browser

MacBook Air, Apple Silicon (arm64), macOS

截图 / 录屏 / 日志 · Screenshots / Recordings / Logs

Reference identifiers (one failing session):
TraceID: 4ec84c28-5e2a-4537-b7f0-241d2419bf43
Request ID: 0b40c9a9-1876-489e-bfb9-29cfc223ef51

Evidence it is client-side (NOT model / plan / network):

@zcode/tui verified ABSENT from the whole install: not in glm/packages, not in app.asar, not in app.asar.unpacked, no node_modules next to the bundle.

Account email available privately on request.

Activity

  1. added
    status: 待评估
    type: Bug
    on Jun 26, 2026
  2. github-actions commented on Jun 26, 2026

    @github-actions

    👋 感谢你的反馈,我们已经收到。

    • 维护者会在 3 个工作日内 给出首次响应。
    • 状态保持为 status: 待评估,你可以随时补充信息。
    • 信息不全时我们会打上 needs: 更多信息 标签并 @ 你。

    👋 Thanks — we've received your issue.

    • A maintainer will respond within 3 business days.
    • Status stays at status: 待评估 (Triage); feel free to add context.
    • If we need more details, we'll add needs: 更多信息 and ping you.
  3. m11a-dev commented on Jul 24, 2026

    @m11a-dev

    Reproduced on ZCode 0.15.2, darwin/arm64. The login failure is instant (no browser opens, no callback server starts) because the endpoint the CLI hits first no longer exists.

    Root cause

    The login flow's initial call is POST https://api.z.ai/oauth/cli/init (bundle string: `${t}/oauth/cli/init`). That path — and the entire /oauth/ namespace on api.z.ai — now returns a nginx 404 Not Found HTML page. The CLI does JSON.parse() on that HTML body and throws:

    $ zcode login
    Error: OAuth response is not valid JSON
    

    Repro (no auth, no CLI needed)

    $ curl -s -o /dev/null -w "%{http_code} %{content_type}\n" https://api.z.ai/oauth/cli/init
    404 text/html
    
    $ curl -s https://api.z.ai/oauth/cli/init | head -c 80
    404 Not Found...nginx...
    

    Every /oauth/* path returns the same 404 HTML (/oauth/cli/init, /oauth/cli/poll/*, /oauth/authorize, /oauth/token).

    What still works

    /api/auth/z/login on api.z.ai returns HTTP 200 JSON (the auth-code flow the desktop GUI uses), and the desktop app authenticates fine — it's only the CLI login command that points at the dead /oauth/cli/* paths.

    Impact

    Every headless entrypoint (zcode login, and therefore zcode --prompt / zcode app-server) can't acquire credentials, because the headless config store (~/.zcode/cli/) never gets populated by the OAuth flow. This blocks all headless/programmatic use.

    Suggested fix

    The login flow should either point at the live /api/auth/* endpoints the desktop client uses, or confirm whether /oauth/cli/* was intentionally retired and login needs a new flow.

  4. Flo5k5 commented on Aug 4, 2026

    @Flo5k5

    Reproducing the exact same symptom on macOS (Apple Silicon), ZCode CLI 0.16.1:

    $ node "/Applications/ZCode.app/Contents/Resources/glm/zcode.cjs" login
    Error: OAuth response is not valid JSON
    

    Fails instantly (no browser window opens), same as reported above. Desktop app session is fine (GLM-5.2 working normally, active builtin:zai-coding-plan provider, thousands of calls this week), so this is specifically the bare CLI login flow that's broken — confirms it's not account/quota/network related on my end either.

    Blocking use case: scripting zcode -p headlessly from another tool (subprocess dispatch) requires a CLI-level authenticated session distinct from the desktop app's, which this bug prevents from ever being established.

  5. Flo5k5 commented on Aug 4, 2026

    @Flo5k5

    Found the root cause and a workaround, for anyone else blocked on this.

    Root cause (from disassembling zcode.cjs): the headless bootstrap (resolveAppRuntimeConfig → requireRuntimeModelConfig) requires config.model to already be explicitly set:

    function requireRuntimeModelConfig(e){
      if(e.config.model) return e.config.model;
      throw ModelConfigMissingError(...)
    }

    The desktop app resolves this dynamically at runtime (picks the first enabled:true provider), but the bare CLI bootstrap has no such fallback — and since zcode login is broken (this issue), there's no way to populate it through the normal flow either.

    Workaround: the CLI also has a parseEnvConfig module that reads ZCODE_-prefixed env vars and bypasses the config file entirely:

    ZCODE_MODEL=zai/glm-5.2 \                              # format is provider/model, NOT the display name "GLM-5.2"
    ZCODE_BASE_URL=https://api.z.ai/api/anthropic \
    ANTHROPIC_API_KEY=<your Z.ai API key> \
      node /Applications/ZCode.app/Contents/Resources/glm/zcode.cjs -p "your prompt" --mode plan

    Notes:

    • ANTHROPIC_API_KEY is used because the zai-coding-plan provider has kind:"anthropic" internally — it's read via the generic Anthropic-auth code path, unrelated to the real Anthropic API.
    • The API key itself is already sitting in ~/.zcode/v2/config.json under provider.builtin:zai-coding-plan.options.apiKey (the desktop app's real session store — separate from ~/.zcode/cli/ that the bare CLI defaults to), so no new credential is needed, just surfacing the existing one via env var.
    • This got me a working headless response (exit 0) with GLM-5.2. It's a workaround, not a fix — zcode login itself should still be repaired so this isn't necessary.
  6. guanbear commented on Aug 12, 2026

    @guanbear

    Reproduced on ZCode Desktop 3.7.5 / bundled CLI 0.16.1 / macOS arm64. The desktop app and headless CLI work in this environment, so this isolates the remaining CLI packaging problem from the original desktop/auth failures.

    TUI still cannot start

    Both entry points fail:

    node /Applications/ZCode.app/Contents/Resources/glm/zcode.cjs
    node /Applications/ZCode.app/Contents/Resources/glm/zcode.cjs tui
    
    Error: Cannot find package '@zcode/tui' imported from /Applications/ZCode.app/Contents/Resources/glm/zcode.cjs\n```\n\n`@zcode/tui` is absent from `Contents/Resources`, including the unpacked node modules. `zcode doctor --json` reports CLI 0.16.1 with `packaging.default = node-bundle`; there is also no `zcode` executable installed on PATH.\n\n### Help/parser mismatch\n\nThe same bundle advertises `--settings <path>` and `--max-turns <n>` in `--help`, but both are rejected as unknown options before execution. By contrast, `--prompt`, `--json`, `--cwd`, `--mode`, and `--resume` work.\n\nThis currently blocks first-class terminal-host integration such as stablyai/orca#10654: headless subprocess use is possible, but the advertised interactive TUI cannot be launched from the desktop distribution. Could you confirm whether an official standalone CLI/TUI package is intended, or whether the desktop bundle should include `@zcode/tui`?
    
  7. m11a-dev commented on Aug 14, 2026

    @m11a-dev

    Update 2026-08-14, CLI 0.16.3 — login now targets the new zcode.z.ai/api/v1 gateway, and only its oauth/cli/* routes are missing

    The 0.16.3 bundle points the device-style OAuth flow at the new gateway (apiBaseUrl = https://zcode.z.ai/api/v1):

    • POST https://zcode.z.ai/api/v1/oauth/cli/init
    • GET https://zcode.z.ai/api/v1/oauth/cli/poll/<flowId> (Bearer poll token)

    Current server state, no auth needed to reproduce:

    $ curl -s -w '\n[%{http_code} %{content_type}]\n' -X POST https://zcode.z.ai/api/v1/oauth/cli/init
    404 page not found
    [404 text/plain]
    
    $ curl -s -o /dev/null -w '%{http_code}\n' https://zcode.z.ai/api/v1/zcode-plan/billing/balance
    401
    

    The second probe is the interesting one: on the same gateway, same /api/v1 prefix, the CLI's own plan-billing routes (/api/v1/zcode-plan/billing/balance, /billing/current) return 401 — route mounted, auth required — while oauth/cli/init / oauth/cli/poll/* return 404 page not found. The old https://api.z.ai/oauth/* namespace is still nginx-404 too. So the new gateway is clearly live and selectively routed; only the OAuth CLI routes are absent. zcode login still fails instantly with OAuth response is not valid JSON on 0.16.3.

    Two questions:

    1. Is oauth/cli/* missing from the new gateway by accident (rollout gap), or was CLI OAuth intentionally retired? If retired — what is the intended zcode login flow for 0.16.x?
    2. For GLM Coding Plan subscribers who need headless/programmatic use now: is env-config auth (ZCODE_BASE_URL=https://api.z.ai/api/anthropic + the coding-plan provider's API key from the desktop config) the supported interim path — and does it consume Coding Plan quota rather than pay-as-you-go credits? The configuration docs note /api/anthropic "stops billing against balance once a Coding Plan was ever purchased", which reads as plan billing; a confirmation would unblock scripted use for subscribers.

    This thread now has independent repros on 0.15.2, 0.16.1, and 0.16.3, and the issue has sat at status: 待评估 for ~3 weeks — any triage update appreciated.

    中文摘要

    0.16.3 的 login 指向新网关 zcode.z.ai/api/v1:其 oauth/cli/init、oauth/cli/poll/* 返回 404,而同网关同前缀的 /api/v1/zcode-plan/billing/* 返回 401(路由存在、需鉴权)——疑似新网关缺少 OAuth CLI 路由的挂载。请问是上线遗漏还是有意下线?若下线,0.16.x 的 CLI 登录应走哪条流程?另外请确认:Coding Plan 订阅用户用 https://api.z.ai/api/anthropic + 计划内 API key 做 headless 调用,是否计入 Coding Plan 配额而非按量计费余额?

  8. yule1991 commented on Aug 22, 2026

    @yule1991

    补充一个数据点:本 issue 第 3 条症状(CLI/TUI 报 Cannot find package '@zcode/tui')在 App 3.8.1(内置 zcode.cjs 0.16.3,macOS arm64) 下仍然存在。

    复现步骤:

    1. ~/.local/bin/zcode 是指向 /Applications/ZCode.app/Contents/Resources/glm/zcode.cjs 的符号链接(由桌面版创建)
    2. 桌面 App 经 Squirrel 自动更新到 3.8.1 后(包内文件被原地替换),在终端运行 zcode 或 zcode tui:
      Error: Cannot find package '@zcode/tui' imported from /Applications/ZCode.app/Contents/Resources/glm/zcode.cjs
      
    3. 全盘确认该包不存在:glm/ 下没有 node_modules/@zcode/tui;app.asar.unpacked/node_modules 只有 node-pty 和 ssh2;~/.zcode 运行时目录、公网与内网 npm registry 上均无此包

    不受影响的部分: zcode --prompt(headless)、zcode skills list、zcode doctor 等子命令正常,桌面 App 本身正常——问题只影响终端 TUI 入口。

    建议:

    环境:macOS(Apple Silicon,darwin 25.6.0)/ ZCode App 3.8.1 / 内置 CLI 0.16.3

  9. TerrysPOV commented on Oct 4, 2026

    @TerrysPOV

    Still reproducible on the latest build: ZCode Desktop 3.14.4 / bundled CLI 0.16.9, macOS arm64.

    $ zcode
    Error: Cannot find package '@zcode/tui' imported from /Applications/ZCode.app/Contents/Resources/glm/zcode.cjs
    

    Same setup as the earlier reports: ~/.local/bin/zcode is a symlink into ZCode.app/Contents/Resources/glm/zcode.cjs. zcode doctor reports sea: no (optional) and default artifact: node-bundle, and .node-bundle-meta.json says runtime: electron-node.

    What I checked, so nobody has to repeat it:

    • @zcode/tui is not under Contents/Resources/glm/, and it is not in app.asar either (I read the asar header; no @zcode packages at all).
    • npm view @zcode/tui returns 404, so there is nothing to npm install as a workaround.
    • This is not a corrupt install. I moved the app aside and did a clean brew install --cask zcode (cask is also 3.14.4) and the result is identical.
    • zcode --version, doctor and skills list work, so only the TUI entry point is affected.

    Impact: tools that need the interactive TUI cannot use ZCode at all. I hit this trying to run ZCode as an agent inside the Orca IDE, which launches it in interactive mode with yolo permissions. The headless route is not a fallback for Coding Plan users, because zcode -p cannot use the plan key (see zai-org/zai-coding-plugins#34).

    Request: please either bundle @zcode/tui into resources/glm/ (the entry file imports it, so it has to ship with it) or publish the standalone SEA CLI that #270 asked for. A release-time smoke test that runs zcode tui from the packaged app would catch this, since it has now been broken across at least 0.15.2, 0.16.1, 0.16.3 and 0.16.9.

    Related: the same non-SEA entry also fails with Cannot locate CLI ZCode Built-in Provider Config (#855). On macOS I got past that one by symlinking Resources/config/provider/zcode-builtin.json next to the ~/.local/bin/zcode entry, but there is no equivalent workaround for the missing TUI package.

  10. YFOOOO commented on Oct 17, 2026

    @YFOOOO

    独立复现 + 版本边界更新(2026-10-17,macOS Apple Silicon,ZCode 3.15.1.8093):

    $ node /Applications/ZCode.app/Contents/Resources/glm/zcode.cjs tui
    Error: Cannot find package '@zcode/tui' imported from …/glm/zcode.cjs
    
  11. SeveNOlogy7 commented on Oct 19, 2026

    @SeveNOlogy7

    版本边界更新(Windows,Desktop 3.16.1.8696 / 内置 CLI 0.17.0):仍然缺包;并修正一处结论

    复现环境:Windows 11 x64(简体中文),ZCode Desktop 3.16.1 (3.16.1.8696),内置 CLI 0.17.0;zcode doctor 报 sea: no (optional) / default artifact: node-bundle,.node-bundle-meta.json 为 runtime: electron-node。

    结论:3.16.1 仍然不含 @zcode/tui。

    证据 1 —— 本次更新往 resources\glm 实际写入的只有三样:

    zcode.cjs                14.8 MB
    packages\               103.6 MB   (插件 / skill 资源)
    .node-bundle-meta.json
    

    没有 node_modules\@zcode\tui(该目录的时间戳仍是安装前的时间,说明安装器根本没碰过这个路径)。

    证据 2 —— 0.17.0 的加载逻辑没变:

    const loadTuiRuntime = async () => {
      const sea = await import('node:sea');
      if (!sea.isSea()) return await import('@zcode/tui');   // node-bundle:仍然必须有这个包
      // SEA:把资产解到 %LOCALAPPDATA%\zcode\Cache\sea-assets\zcode-tui-runtime\0.17.0\<target>\<hash>\
      ...
    };

    证据 3 —— 把 node_modules\@zcode\tui 临时挪走后立刻复现:

    $ node ...\resources\glm\zcode.cjs tui
    Error: Cannot find package '@zcode/tui' imported from C:\Users\Loren\AppData\Local\Programs\ZCode\resources\glm\zcode.cjs
    

    挪回来,同一条命令就能进入 TUI(非 tty 下报 TUI requires an interactive terminal.)。

    一处结论修正(对上一条评论,仅供定位参考)

    上一条说「app 升级不带动内置 CLI」。至少在 3.15.3 → 3.16.1 这一次不成立:内置 CLI 从 0.16.9 升到了 0.17.0(zcode doctor 实测)。所以 app 与内置 CLI 的版本会一起走;真正跨版本持续存在的结构性问题,仍然是发布时没有把 @zcode/tui 放进 resources\glm(0.15.2 / 0.16.1 / 0.16.3 / 0.16.9 / 0.17.0 都如此)。

    另外,同一个非 SEA 入口还缺内置 provider config(#855)—— 我在那边补了定位:App 其实随包发了这个文件,只是 CLI 的候选路径多绕了 4 层。

    建议的发布冒烟测试(能一次性拦住这两个问题):

    在解包后的应用目录里执行:
      node resources/glm/zcode.cjs doctor     # 期望 version 与本次构建的 CLI 版本一致
      node resources/glm/zcode.cjs tui        # 期望不是 "Cannot find package '@zcode/tui'"
      node resources/glm/zcode.cjs -p ping    # 期望不是 "无法定位 CLI ZCode Built-in Provider Config"
                                              #(只需看是否立刻报错,不必等模型回复)
    把控制台代码页设为 936 的 Windows 上跑一遍,还能顺便挡住 #1059。
    
    English summary

    Confirmed still broken on Desktop 3.16.1 / bundled CLI 0.17.0 (Windows, node-bundle). The update shipped only zcode.cjs, packages/ and .node-bundle-meta.json into resources/glm — no @zcode/tui. 0.17.0's loadTuiRuntime still does a bare import("@zcode/tui") on the non-SEA path, and temporarily moving the package aside reproduces Cannot find package '@zcode/tui' verbatim. Also a correction to the previous comment: the bundled CLI did bump with the app this time (0.16.9 → 0.17.0), so "app upgrades don't move the bundled CLI" is not a general rule; the durable structural gap is that @zcode/tui is never staged into resources/glm at build time.

  12. rizkydwicmt commented on Nov 12, 2026

    @rizkydwicmt

    Root cause confirmed from the public source mirror (zai-org/ZCode @ v3.18.0):

    1. apps/zcode-cli/packages/cli/scripts/build.mjs keeps @zcode/tui in the esbuild external list — Ink 7 / yoga-layout use top-level await, so the CJS bundle loads the TUI via a runtime dynamic import("@zcode/tui").
    2. The SEA build collects the TUI into single-executable assets (scripts/zcode-distribution/assets.mjs → collectSeaTuiAssets), but packages/desktop/scripts/prepare-agent-node-bundle.mjs — which produces what actually ships in ZCode.app/Contents/Resources/glm — never stages it. Its header comment says: "app-server 命令路径不会加载 @zcode/tui,所以这里天然不打包 TUI". On the non-SEA path the bare import hits MODULE_NOT_FOUND, and since the package is absent from public npm, users have no legitimate way to obtain it.

    Proposed fix — branch fix/stage-tui-runtime-in-bundled-agent on my fork (PRs appear to be disabled on the source mirror):

    • new stageTuiRuntimeForGlm() step in prepare-agent-node-bundle.mjs: builds @zcode/tui, reuses collectSeaTuiAssets to stage the TUI runtime tree (opentui native packages selected per target platform) into bundled-agents/<platform>/glm/node_modules, and asserts the staged package exists so packaging fails loudly instead of shipping a broken TUI;
    • electron-builder.config.js: map glm/node_modules as a separate extraResources entry — electron-builder skips node_modules at the from root, same root cause already worked around for cua-helper in the same file;
    • the packaged app-server path is untouched (it never imports the TUI).

    Interim workaround for affected users: pnpm build:zcode from the public source mirror produces a complete standalone distribution (agent/zcode.cjs + staged TUI runtime + bin/zcode.mjs runner) whose interactive TUI already works — stageTuiRuntime / copyRuntimeNodeModules in scripts/zcode-distribution/assets.mjs do the right thing; the desktop bundle just never received the same treatment. I also added a zcode-dist GitHub Actions workflow on the fork that builds downloadable dist artifacts with a smoke test asserting the staged TUI runtime exists inside the tarball — the release smoke test proposed in this thread would have caught this gap across all affected versions.

  13. Futuri-Risk commented on Nov 15, 2026

    @Futuri-Risk

    Confirmed the same defect independently on Windows 11 x64 on 2026-11-15 (App 3.18.2, CLI 0.17.1): the desktop-bundled CLI cannot run the interactive TUI. As a workaround we built a standalone dist from @rizkydwicmt's staging-fix branch (fix/stage-tui-runtime-in-bundled-agent) using its documented build path (pnpm 10.33.2 --frozen-lockfile → node scripts/bootstrap.mjs → pnpm build:sea:prepare → node scripts/build-zcode.mjs). The build succeeded after fixing three Windows-only build-script defects (bare pnpm ENOENT in build-zcode.mjs, GNU tar parsing C: drive-letter paths as a remote host, and the bootstrap/build:sea:prepare ordering) — filed upstream in #1523, with the fixed branch public at https://github.com/Futuri-Risk/ZCode/tree/fix/windows-build-scripts. The resulting TUI boots and headless mode works; dist sha256 479f994bf8835a89bde7ea080ed1eec006e6f8d495cfc4c35dbc4a35e5b6. No maintainer action is needed on this comment — posting it as triage data.

  14. rizkydwicmt commented on Nov 15, 2026

    @rizkydwicmt

    @Futuri-Risk thanks for the independent Windows triage — I've integrated your fixes into rizkydwicmt/ZCode@fix/stage-tui-runtime-in-bundled-agent (cherry-picked your d646d1e9 onto the v3.18.0-based tree, clean) and added Windows to its dist CI. Getting the Windows job green needed four more fixes, all in the same spirit as yours:

    1. Runner image — windows-latest and windows-2025 both now resolve to the new windows-2025-vs2026 image (VS Enterprise 2026 only). build-windows-runtime-host.mjs hardcodes the Visual Studio 17 2022 CMake generator and node-gyp postinstalls need VS2022 too, so the dist workflow pins windows-2022 (last image shipping VS Enterprise 2022 17.14). Relevant if you ever CI your branch.

    2. zip extraction (scripts/prebuilt-binary-extract.mjs) — on those runner images powershell.exe resolves to pwsh 7, whose Microsoft.PowerShell.Archive fails on the ugrep.zip step in prepare:native-search with Cannot find an overload for "ExtractToDirectory" and the argument count: "3". Patched to try bsdtar first (tar -xf is zip-capable and ships with Windows 10+), keeping Expand-Archive as fallback. Same fix family as your item 2 — worth porting into your branch.

    3. Your [Bug] 发送引导排队的消息无法进行任何操作 #3, ported properly — the root cause is now fixed in prepare-agent-node-bundle.mjs itself: stageTuiRuntimeForGlm() builds the TUI runtime closure exactly like build:sea:prepare's first two steps (tsc -b packages/shared + recursive apps/zcode-cli build), so the desktop prep is bootstrap-order-independent. The dist workflow additionally runs build:sea:prepare before bootstrap as belt-and-braces.

    4. Smoke test — relative paths only: the packaged-CLI smoke test hit the same GNU-tar drive-letter parsing on -C $RUNNER_TEMP ("tar: D\:\a\_temp: Cannot open").

    Current state: 3-OS matrix green — macos-latest, ubuntu-latest, windows-2022 — each uploading a smoke-tested dist artifact (~85-88 MB: tarball + sha256 + install.sh + latest.json): https://github.com/rizkydwicmt/ZCode/actions/runs/43673254747. The Windows tarball's TUI boot was verified by your local build; ours is asserted structurally by the CI smoke test (staged @zcode/tui + opentui natives present in the extracted tarball).

    Between the two forks we now have: desktop-bundle TUI staging (#51), Windows-safe build scripts (#1523), and 3-OS CI artifacts. The source mirror remains read-only, so still waiting on z.ai to pick any of this up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: P2status: 待评估type: Bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions