Hooks silently not loaded from a local directory marketplace; ZCode 0.16.5 Stop transcript is assistant-only so stock sync always fails
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- javascript
- 领域
- devtools
调研方向
The report describes two independent failures: hooks not loading from a local directory marketplace and assistant-only Stop transcripts failing sync. Start by tracing hook registration and the Stop hook's transcript handling, then inspect the ZCode session-store workaround described in the issue. Done means the failures are handled or surfaced clearly and sync works for the reported ZCode 0.16.5 case; no relevant source files or tests are named.
由索引模型根据 Issue 内容生成。
描述
Environment: plugin 0.2.0, nmem 0.10.73, ZCode CLI 0.16.5 / App 3.10.0, macOS — two Macs with identical versions of both nmem and the plugin.
We spent a full day diagnosing why one Mac auto-synced ZCode sessions and the other silently synced nothing. Two independent failure modes found; documenting both so others (and the plugin) can short-circuit this.
1. Same plugin, different marketplace source → hooks loaded vs never loaded
- Mac A installed via the GitHub marketplace source → plugin hooks load, sessions auto-sync. ✅
- Mac B installed the same plugin 0.2.0 from a local directory marketplace (local clone registered as a
directory-type source) → ZCode never loads the plugin's hooks. ❌
The only observable signal is in ZCode's startup log (~/.zcode/cli/log/zcode-<date>.jsonl, event bootstrap.app.startup.plugins.completed): hookCount: 0 on Mac B vs a positive count on Mac A. Nothing surfaces in the UI; nmem doctor shows everything green on both. Sessions just silently never sync.
The marketplace registration itself looks healthy on Mac B: plugin listed as enabled, cache populated, commands/skills resolvable.
Suggestions:
- Make hooks from
directory-source marketplaces load identically to GitHub-sourced ones — or fail loudly / document the limitation. - Add a doctor check "ZCode actually registered the plugin's hooks" (reading the same
hookCountsignal), so this failure mode is diagnosable without cross-machine diffing.
2. ZCode 0.16.5's Stop transcript contains only the last assistant message
ZCode 0.16.5's hook runner writes the Stop transcript as a single JSONL line with only the final assistant message:
{"message":{"content":[{"text":"…","type":"text"}],"role":"assistant"}}
(see Hei() in zcode.cjs — JDr("assistant", e.responseText ?? e.responsePreview)).
nmem t sync --from zcode then rejects it with:
ZCode session needs at least one user and one assistant message
So on this ZCode build the stock Stop hook fires but the sync can never succeed — the error only appears in hook stderr.
Workaround we deployed (working reliably on 0.16.5): instead of copying transcript_path, the Stop hook exports the full user/assistant conversation for session_id straight from ~/.zcode/cli/db/db.sqlite (session/message/part schema is OpenCode-compatible), emits it in the same one-line-per-message format, and feeds that to t sync --from zcode --apply. Full conversation per turn, idempotent, and it also survives the assistant-only transcript limitation.
Longer-term options:
- Have the hook script fall back to reading the ZCode sqlite store (like the workaround above), or
- Have
t sync --from zcodetolerate assistant-only transcripts by pulling the missing user turns via--session-id.
Footnote
Two more things that extended our debugging session, in case they help others:
- The MCP server
typemust behttp(notstreamableHttp) in~/.zcode/cli/config.json— wrong values are silently skipped (only aconfig.mcp_server.skippedwarn in the same log file). - Hooks are registered when the ZCode process starts; editing
config.jsonrequires a full app restart for hooks (MCP reconnects per session and picks changes up immediately).
- 主要语言
- JavaScript
- 星标
- 3
- 派生
- 1
- 平均合并
- 1 分钟
- 30 天内合并 PR
- 1
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
nowledge-co/zcode-plugin 的其他 Issue
-
难度 1/5 1-3 小时 新手友好度 82/100
查看 nowledge-co/zcode-plugin 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 1 天内回复
-
help wanted
难度 2/5 1-3 小时 新手友好度 77/100
Aethelgard-Systems/agent-postbox#32 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
SamuelNDCE/plume#42 ·
维护者通常 1 天内回复
-
[UI] Theme Provider Props table overflows on mobile viewports可能已有人在做 @SajanBisht 今天认领。 未关闭framework/gatsby help wanted kind/bug
难度 2/5 1-3 小时 新手友好度 78/100
layer5io/layer5#8264 · 1 条评论 ·
维护者通常 3 天内回复