Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Hooks silently not loaded from a local directory marketplace; ZCode 0.16.5 Stop transcript is assistant-only so stock sync always fails

Đang mở
#2 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
javascript
Lĩnh vực
devtools

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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 hookCount signal), 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 zcode tolerate 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 type must be http (not streamableHttp) in ~/.zcode/cli/config.json — wrong values are silently skipped (only a config.mcp_server.skipped warn in the same log file).
  • Hooks are registered when the ZCode process starts; editing config.json requires a full app restart for hooks (MCP reconnects per session and picks changes up immediately).
Ngôn ngữ chính
JavaScript
Star
3
Fork
1
Merge trung bình
1 phút
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của nowledge-co/zcode-plugin

Tất cả issue của nowledge-co/zcode-plugin

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.