SessionStart injects raw JSON bundle: key list misses the engine's rendered_markdown field
まだ誰も着手していません。
評価
- 難易度
- 1/5
- 見積もり時間
- 1時間未満
- 初心者へのやさしさ
- 88/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- javascript, nodejs
- 領域
- tooling
調査の方向性
hooks/zcode-mem-hook.mjs を開き、L245-250 付近の summarizeContextBundle を読んでください。ここでは、JSON.stringify にフォールバックする前に render キーのリストがチェックされます。nmem --json context --source-app zcode の出力を渡し、出力がトップレベルの rendered_markdown 文字列を含む生の JSON を表示することを確認して再現してください。payload.rendered_markdown をルックアップリストの先頭に追加し、フックを再実行して、注入されるコンテキストが JSON ダンプではなく Markdown レンダーで始まることを確認してください。
索引モデルが issue の本文から書いたものです。
説明
Environment
- nowledge-mem-zcode: 0.2.2 (installed via ZCode plugin marketplace)
- nmem CLI / engine: 0.10.119
- OS: macOS (darwin 25.6.0, arm64)
What happens
On SessionStart, the hook's injected additionalContext is the entire context bundle pretty-printed as raw JSON (truncated to MAX_CONTEXT_CHARS = 6000), instead of the human-readable render the engine already provides.
Root cause
summarizeContextBundle (hooks/zcode-mem-hook.mjs, L245-250 in 0.2.2):
const rendered = payload.markdown || payload.content || payload.context || payload.working_memory;
if (typeof rendered === "string" && rendered.trim()) return rendered.trim();
return JSON.stringify(payload, null, 2);
The engine's context bundle (nmem --json context --source-app zcode) carries the human-readable render under a key this list does not cover:
- top-level keys observed:
active_space, agent_profile, authorship, bundle_kind, compiled_hash, generated_at, kfs_roots, owner_profile, rendered_markdown, rule_stack, schema_version, warnings, working_memory rendered_markdown: string, ~11.7k chars — a finished Markdown render (first line# Nowledge Mem Context Bundle)working_memory: object, so it fails thetypeof rendered === "string"check
All four lookups miss → the fallback dumps the whole bundle as JSON.
The engine clearly intends this surface to be human-readable: nmem context without --json (help text: "Emit raw JSON instead of human-readable output") outputs the same rendered Markdown, line-identical to rendered_markdown apart from two blank lines.
Suggested fix (one line)
Add the engine's key to the lookup list:
const rendered = payload.rendered_markdown || payload.markdown || payload.content || payload.context;
(working_memory can stay last or be dropped from the string path — it is an object in current engine output.)
Local workaround in place
A companion hook injecting nmem context plain-mode output as session-start additionalContext (coexists with the official hook until this is fixed). Verified on 0.2.2 + nmem 0.10.119: official hook output is the 6000-char JSON dump; plain-mode output is the clean render.
Notes
- 0.2.2 release notes do not mention SessionStart / rendered_markdown, so this appears unreported.
- Side observation: the SessionStart matcher (
startup|clear|compact) does not coverresume, which the ZCode host also fires for SessionStart hooks.
- 主要言語
- JavaScript
- スター
- 3
- フォーク
- 1
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
nowledge-co/zcode-plugin のほかの issue
-
UserPromptSubmit recall regex is English-only: Chinese prompts never trigger auto-recall対応中かも @ThaddeusJiang が 3 日前に担当しました。 オープンbug
難易度 1/5 1〜3時間 初心者へのやさしさ 82/100
nowledge-co/zcode-plugin#4 · コメント 1 件 · 担当者 1 名 ·
-
Hooks silently not loaded from a local directory marketplace; ZCode 0.16.5 Stop transcript is assistant-only so stock sync always fails対応中かも @ThaddeusJiang が 3 日前に担当しました。 オープンbug
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
nowledge-co/zcode-plugin#2 · コメント 2 件 · 担当者 1 名 ·
nowledge-co/zcode-plugin の issue をすべて見る
似ている issue
-
Add: QudsunaTV.psオープンchannels:add check:passed
難易度 1/5 1時間未満 初心者へのやさしさ 66/100
iptv-org/database#39416 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
swisstopo/topo-swisseobrowser#48 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
discovery:other factory-active task-identify-harness-labels-done task-identify-issue-type-done
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信