SessionStart injects raw JSON bundle: key list misses the engine's rendered_markdown field
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 1/5
- Tiempo estimado
- Menos de una hora
- Aptitud para principiantes
- 88/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- javascript, nodejs
- Área
- tooling
Línea de trabajo
Abre hooks/zcode-mem-hook.mjs y lee summarizeContextBundle alrededor de L245-250, donde se comprueba la lista de claves de render antes de recurrir a JSON.stringify. Reproduce esto pasándole la salida de nmem --json context --source-app zcode y confirmando que la salida muestra JSON sin procesar con una cadena rendered_markdown de nivel superior. Añade payload.rendered_markdown al principio de la lista de búsqueda y vuelve a ejecutar el hook para confirmar que el contexto inyectado empieza con el render de Markdown en lugar de un volcado de JSON.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- JavaScript
- Estrellas
- 3
- Forks
- 1
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de nowledge-co/zcode-plugin
-
UserPromptSubmit recall regex is English-only: Chinese prompts never trigger auto-recallPosiblemente ocupada @ThaddeusJiang la tomó hace 3 días. Abiertobug
Dificultad 1/5 1-3 horas Aptitud para principiantes 82/100
nowledge-co/zcode-plugin#4 · 1 comentario · 1 asignado ·
-
Hooks silently not loaded from a local directory marketplace; ZCode 0.16.5 Stop transcript is assistant-only so stock sync always failsPosiblemente ocupada @ThaddeusJiang la tomó hace 3 días. Abiertobug
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
nowledge-co/zcode-plugin#2 · 2 comentarios · 1 asignado ·
Todos los issues de nowledge-co/zcode-plugin
Issues similares
-
Add: QudsunaTV.psAbiertochannels:add check:passed
Dificultad 1/5 Menos de una hora Aptitud para principiantes 66/100
iptv-org/database#39416 · 2 comentarios ·
Los mantenedores suelen responder en 2 días
-
[TEXT] Flache Karte ist 2DAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
swisstopo/topo-swisseobrowser#48 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Los mantenedores suelen responder en 1 día
-
discovery:other factory-active task-identify-harness-labels-done task-identify-issue-type-done
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
vercel/ai#25068 · 4 comentarios ·
Los mantenedores suelen responder en 1 día